aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-08-22 08:29:31 +0800
committerDan Finlay <dan@danfinlay.com>2017-08-22 08:29:31 +0800
commit38ba31bbe01785761c03f5d7d781939104d34f37 (patch)
tree496ac9c9c9812df573e2f241f4e7afcc107bd307 /test
parent7d34b22d78713aa1a12dbdab0559ccaf4c1be93c (diff)
downloadtangerine-wallet-browser-38ba31bbe01785761c03f5d7d781939104d34f37.tar
tangerine-wallet-browser-38ba31bbe01785761c03f5d7d781939104d34f37.tar.gz
tangerine-wallet-browser-38ba31bbe01785761c03f5d7d781939104d34f37.tar.bz2
tangerine-wallet-browser-38ba31bbe01785761c03f5d7d781939104d34f37.tar.lz
tangerine-wallet-browser-38ba31bbe01785761c03f5d7d781939104d34f37.tar.xz
tangerine-wallet-browser-38ba31bbe01785761c03f5d7d781939104d34f37.tar.zst
tangerine-wallet-browser-38ba31bbe01785761c03f5d7d781939104d34f37.zip
Refer to pending nonces, not just their count
Diffstat (limited to 'test')
-rw-r--r--test/unit/nonce-tracker-test.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/nonce-tracker-test.js b/test/unit/nonce-tracker-test.js
index 9a819b146..11f99751c 100644
--- a/test/unit/nonce-tracker-test.js
+++ b/test/unit/nonce-tracker-test.js
@@ -110,6 +110,21 @@ describe('Nonce Tracker', function () {
await nonceLock.releaseLock()
})
})
+
+ describe('when there are some pending nonces below the remote one and some over.', function () {
+ beforeEach(function () {
+ const txGen = new MockTxGen()
+ pendingTxs = txGen.generate({ status: 'submitted' }, { count: 5 })
+ nonceTracker = generateNonceTrackerWith(pendingTxs, [], '0x03')
+ })
+
+ it('should return nonce after those', async function () {
+ this.timeout(15000)
+ const nonceLock = await nonceTracker.getNonceLock('0x7d3517b0d011698406d6e0aed8453f0be2697926')
+ assert.equal(nonceLock.nextNonce, '5', `nonce should be 5 got ${nonceLock.nextNonce}`)
+ await nonceLock.releaseLock()
+ })
+ })
})
})