Use rpc.account.nextIndex in submittables (#1422)

This commit is contained in:
Jaco Greeff
2019-09-25 17:20:46 +02:00
committed by GitHub
parent c0a804332b
commit ad4a6e63ce
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -193,7 +193,9 @@ export default class Submittable<ApiType> extends _Extrinsic implements Submitta
return combineLatest([
// if we have a nonce already, don't retrieve the latest, use what is there
isUndefined(options.nonce)
? this._api.query.system.accountNonce<Index>(address)
? this._api.rpc.account.nextIndex
? this._api.rpc.account.nextIndex(address)
: this._api.query.system.accountNonce(address)
: of(createType('Index', options.nonce)),
// if we have an era provided already or eraLength is <= 0 (immortal)
// don't get the latest block, just pass null, handle in mergeMap