aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/nonce-tracker-test.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-04-03 01:47:24 +0800
committerGitHub <noreply@github.com>2018-04-03 01:47:24 +0800
commit6d5f1392a529c5c809d416aaebc6e3424ee55ae1 (patch)
tree7feb008f31933a579a4a9bdeb42e22c99d78597a /test/unit/nonce-tracker-test.js
parent812a06ffcd9cea39453e8a59563bf1d12e17c065 (diff)
parent69a867b4a420acd4b4354aab2cc4051736a778cb (diff)
downloadtangerine-wallet-browser-6d5f1392a529c5c809d416aaebc6e3424ee55ae1.tar
tangerine-wallet-browser-6d5f1392a529c5c809d416aaebc6e3424ee55ae1.tar.gz
tangerine-wallet-browser-6d5f1392a529c5c809d416aaebc6e3424ee55ae1.tar.bz2
tangerine-wallet-browser-6d5f1392a529c5c809d416aaebc6e3424ee55ae1.tar.lz
tangerine-wallet-browser-6d5f1392a529c5c809d416aaebc6e3424ee55ae1.tar.xz
tangerine-wallet-browser-6d5f1392a529c5c809d416aaebc6e3424ee55ae1.tar.zst
tangerine-wallet-browser-6d5f1392a529c5c809d416aaebc6e3424ee55ae1.zip
Merge branch 'master' into i18n-helper
Diffstat (limited to 'test/unit/nonce-tracker-test.js')
-rw-r--r--test/unit/nonce-tracker-test.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/unit/nonce-tracker-test.js b/test/unit/nonce-tracker-test.js
index 8970cf84d..5a27882ef 100644
--- a/test/unit/nonce-tracker-test.js
+++ b/test/unit/nonce-tracker-test.js
@@ -33,6 +33,42 @@ describe('Nonce Tracker', function () {
})
})
+ describe('sentry issue 476304902', function () {
+ beforeEach(function () {
+ const txGen = new MockTxGen()
+ pendingTxs = txGen.generate({ status: 'submitted' }, {
+ fromNonce: 3,
+ count: 29,
+ })
+ nonceTracker = generateNonceTrackerWith(pendingTxs, [], '0x3')
+ })
+
+ it('should return 9', async function () {
+ this.timeout(15000)
+ const nonceLock = await nonceTracker.getNonceLock('0x7d3517b0d011698406d6e0aed8453f0be2697926')
+ assert.equal(nonceLock.nextNonce, '32', `nonce should be 32 got ${nonceLock.nextNonce}`)
+ await nonceLock.releaseLock()
+ })
+ })
+
+ describe('issue 3670', function () {
+ beforeEach(function () {
+ const txGen = new MockTxGen()
+ pendingTxs = txGen.generate({ status: 'submitted' }, {
+ fromNonce: 6,
+ count: 3,
+ })
+ nonceTracker = generateNonceTrackerWith(pendingTxs, [], '0x6')
+ })
+
+ it('should return 9', async function () {
+ this.timeout(15000)
+ const nonceLock = await nonceTracker.getNonceLock('0x7d3517b0d011698406d6e0aed8453f0be2697926')
+ assert.equal(nonceLock.nextNonce, '9', `nonce should be 9 got ${nonceLock.nextNonce}`)
+ await nonceLock.releaseLock()
+ })
+ })
+
describe('with no previous txs', function () {
beforeEach(function () {
nonceTracker = generateNonceTrackerWith([], [])