Return value from array on subscription (#262)

This commit is contained in:
Jaco Greeff
2018-10-12 12:33:18 +02:00
committed by Amaury Martiny
parent dc5802abe4
commit a47485c9bf
2 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -206,7 +206,8 @@ export default class ApiPromise extends ApiBase<Rpc, QueryableStorage, Submittab
return this.rpc.state.storage(
[[method, args.length === 1 ? undefined : args[0]]],
args[args.length - 1]
(result: Array<Base | null | undefined> = []) =>
args[args.length - 1](result[0])
);
};
+6
View File
@@ -116,6 +116,12 @@ export default class UInt extends Base<BN> {
: this.raw.div(bnToBn(other));
}
eq (other: UInt | BN | number): boolean {
return other instanceof UInt
? this.raw.eq(other.raw)
: this.raw.eq(bnToBn(other));
}
isZero (): boolean {
return this.raw.isZero();
}