Return value from array on subscription (#262)
This commit is contained in:
committed by
Amaury Martiny
parent
dc5802abe4
commit
a47485c9bf
@@ -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])
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user