Tuple extends Array (#432)

* Tuple extend array

* Fix all tests

* Add tests on Tupel

* Remove getAtIndex for tuples

* Add noInheritDoc

* Update comments

* Update docs
This commit is contained in:
Amaury Martiny
2018-12-03 15:54:52 +01:00
committed by Jaco Greeff
parent 41e98ed243
commit 1d1832111b
18 changed files with 241 additions and 150 deletions
+8 -8
View File
@@ -12,9 +12,9 @@ const ProposalStruct: Constructor<Struct<any>> = Struct.with({ id: PropIndex, pr
export class RxProposal extends ProposalStruct {
constructor (value: Tuple) {
super({
id: value.getAtIndex(0),
proposal: value.getAtIndex(1),
address: value.getAtIndex(2)
id: value[0],
proposal: value[1],
address: value[2]
});
}
@@ -36,8 +36,8 @@ const DepositStruct: Constructor<Struct<any>> = Struct.with({ balance: Balance,
export class RxProposalDeposits extends DepositStruct {
constructor (value: Tuple) {
super({
balance: value.getAtIndex(0),
addresses: value.getAtIndex(1)
balance: value[0],
addresses: value[1]
});
}
@@ -55,9 +55,9 @@ const ReferendumStruct: Constructor<Struct<any>> = Struct.with({ blockNumber: Bl
export class RxReferendum extends ReferendumStruct {
constructor (value: Tuple, id: ReferendumIndex | BN | number) {
super({
blockNumber: value.getAtIndex(0),
proposal: value.getAtIndex(1),
voteThreshold: value.getAtIndex(2),
blockNumber: value[0],
proposal: value[1],
voteThreshold: value[2],
id
});
}