handle integer result returned by 'hmy_getAccountNonce'

pull/65/head
peekpi 4 years ago
parent f0e8056f84
commit 95453ee2e7
  1. 2
      packages/harmony-account/src/account.ts
  2. 2
      packages/harmony-account/src/hdnode.ts

@ -510,7 +510,7 @@ class Account {
if (nonce.isError()) {
throw nonce.error.message;
}
return Number.parseInt(hexToNumber(nonce.result), 10);
return nonce.result;
}
/**

@ -211,7 +211,7 @@ export class HDNode {
const nonce =
txParams.nonce !== undefined && isHex(txParams.nonce)
? Number.parseInt(hexToNumber(txParams.nonce), 10)
: Number.parseInt(hexToNumber(accountNonce.result), 10);
: accountNonce.result;
const data = txParams.data !== undefined && isHex(txParams.data) ? txParams.data : '0x';
const prv = this.wallets[from].privateKey;

Loading…
Cancel
Save