nonce-tracker - validation - add validation failing value type to error message

feature/default_network_editable
kumavis 7 years ago
parent f16802e2d4
commit 39d28922de
  1. 6
      app/scripts/lib/nonce-tracker.js

@ -31,12 +31,12 @@ class NonceTracker {
const currentBlock = await this._getCurrentBlock() const currentBlock = await this._getCurrentBlock()
const pendingTransactions = this.getPendingTransactions(address) const pendingTransactions = this.getPendingTransactions(address)
const pendingCount = pendingTransactions.length const pendingCount = pendingTransactions.length
assert(Number.isInteger(pendingCount), `nonce-tracker - pendingCount is not an integer - got: "${pendingCount}"`) assert(Number.isInteger(pendingCount), `nonce-tracker - pendingCount is not an integer - got: (${typeof pendingCount}) "${pendingCount}"`)
const baseCountHex = await this._getTxCount(address, currentBlock) const baseCountHex = await this._getTxCount(address, currentBlock)
const baseCount = parseInt(baseCountHex, 16) const baseCount = parseInt(baseCountHex, 16)
assert(Number.isInteger(baseCount), `nonce-tracker - baseCount is not an integer - got: "${baseCount}"`) assert(Number.isInteger(baseCount), `nonce-tracker - baseCount is not an integer - got: (${typeof baseCount}) "${baseCount}"`)
const nextNonce = baseCount + pendingCount const nextNonce = baseCount + pendingCount
assert(Number.isInteger(nextNonce), `nonce-tracker - nextNonce is not an integer - got: "${nextNonce}"`) assert(Number.isInteger(nextNonce), `nonce-tracker - nextNonce is not an integer - got: (${typeof nextNonce}) "${nextNonce}"`)
// return next nonce and release cb // return next nonce and release cb
return { nextNonce, releaseLock } return { nextNonce, releaseLock }
} }

Loading…
Cancel
Save