aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-08-24 10:34:37 +0800
committerDan Finlay <dan@danfinlay.com>2017-08-24 10:34:44 +0800
commit5feda433607fc5a762e1e0843598bacda9d11ca9 (patch)
tree65ce2282b5801ceceac004c4189639c80d1476b5 /test/unit
parent1f0223d0a0b617ffaf1704210b7ed328d12c48d1 (diff)
downloadtangerine-wallet-browser-5feda433607fc5a762e1e0843598bacda9d11ca9.tar
tangerine-wallet-browser-5feda433607fc5a762e1e0843598bacda9d11ca9.tar.gz
tangerine-wallet-browser-5feda433607fc5a762e1e0843598bacda9d11ca9.tar.bz2
tangerine-wallet-browser-5feda433607fc5a762e1e0843598bacda9d11ca9.tar.lz
tangerine-wallet-browser-5feda433607fc5a762e1e0843598bacda9d11ca9.tar.xz
tangerine-wallet-browser-5feda433607fc5a762e1e0843598bacda9d11ca9.tar.zst
tangerine-wallet-browser-5feda433607fc5a762e1e0843598bacda9d11ca9.zip
Add failing test for newly identified error state
Reproduces #1966
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/nonce-tracker-test.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/nonce-tracker-test.js b/test/unit/nonce-tracker-test.js
index 11f99751c..5b0732d44 100644
--- a/test/unit/nonce-tracker-test.js
+++ b/test/unit/nonce-tracker-test.js
@@ -125,6 +125,23 @@ describe('Nonce Tracker', function () {
await nonceLock.releaseLock()
})
})
+
+ describe('when there are pending nonces non sequentially over the network nonce.', function () {
+ beforeEach(function () {
+ const txGen = new MockTxGen()
+ txGen.generate({ status: 'submitted' }, { count: 5 })
+ // 5 over that number
+ pendingTxs = txGen.generate({ status: 'submitted' }, { count: 5 })
+ nonceTracker = generateNonceTrackerWith(pendingTxs, [], '0x00')
+ })
+
+ it('should return nonce after network nonce', async function () {
+ this.timeout(15000)
+ const nonceLock = await nonceTracker.getNonceLock('0x7d3517b0d011698406d6e0aed8453f0be2697926')
+ assert.equal(nonceLock.nextNonce, '0', `nonce should be 0 got ${nonceLock.nextNonce}`)
+ await nonceLock.releaseLock()
+ })
+ })
})
})