diff options
author | kumavis <aaron@kumavis.me> | 2017-07-27 01:16:08 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2017-07-27 01:16:08 +0800 |
commit | 39d28922de31fa26b50eca5c7719ae9feefae770 (patch) | |
tree | 0fbd81694db60c5f89bd3e6b6e51e7493ea67e2a /app/scripts/lib/nonce-tracker.js | |
parent | f16802e2d4f7e917e894e3ec38a716255f6b0942 (diff) | |
download | tangerine-wallet-browser-39d28922de31fa26b50eca5c7719ae9feefae770.tar.gz tangerine-wallet-browser-39d28922de31fa26b50eca5c7719ae9feefae770.tar.zst tangerine-wallet-browser-39d28922de31fa26b50eca5c7719ae9feefae770.zip |
nonce-tracker - validation - add validation failing value type to error message
Diffstat (limited to 'app/scripts/lib/nonce-tracker.js')
-rw-r--r-- | app/scripts/lib/nonce-tracker.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/scripts/lib/nonce-tracker.js b/app/scripts/lib/nonce-tracker.js index 4bba1f1a8..81b500550 100644 --- a/app/scripts/lib/nonce-tracker.js +++ b/app/scripts/lib/nonce-tracker.js @@ -31,12 +31,12 @@ class NonceTracker { const currentBlock = await this._getCurrentBlock() const pendingTransactions = this.getPendingTransactions(address) 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 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 - 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 { nextNonce, releaseLock } } |