aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-08-30 02:36:53 +0800
committerDan Finlay <dan@danfinlay.com>2017-08-30 02:36:53 +0800
commit2117490d41a31eeb2d39383bfc5ae7751f445420 (patch)
tree64fc6d24c824a8282da098c38f1e2573970805fb /test/unit
parent71de68fc13d83934e8bc81ba43574a946bc32159 (diff)
downloadtangerine-wallet-browser-2117490d41a31eeb2d39383bfc5ae7751f445420.tar
tangerine-wallet-browser-2117490d41a31eeb2d39383bfc5ae7751f445420.tar.gz
tangerine-wallet-browser-2117490d41a31eeb2d39383bfc5ae7751f445420.tar.bz2
tangerine-wallet-browser-2117490d41a31eeb2d39383bfc5ae7751f445420.tar.lz
tangerine-wallet-browser-2117490d41a31eeb2d39383bfc5ae7751f445420.tar.xz
tangerine-wallet-browser-2117490d41a31eeb2d39383bfc5ae7751f445420.tar.zst
tangerine-wallet-browser-2117490d41a31eeb2d39383bfc5ae7751f445420.zip
Add test for trying to reproduce faq#67
Failed to reproduce this issue with the same inputs.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/nonce-tracker-test.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/nonce-tracker-test.js b/test/unit/nonce-tracker-test.js
index 3312a3bd0..8970cf84d 100644
--- a/test/unit/nonce-tracker-test.js
+++ b/test/unit/nonce-tracker-test.js
@@ -162,6 +162,25 @@ describe('Nonce Tracker', function () {
await nonceLock.releaseLock()
})
})
+
+ describe('Faq issue 67', function () {
+ beforeEach(function () {
+ const txGen = new MockTxGen()
+ const confirmedTxs = txGen.generate({ status: 'confirmed' }, { count: 64 })
+ const pendingTxs = txGen.generate({
+ status: 'submitted',
+ }, { count: 10 })
+ // 0x40 is 64 in hex:
+ nonceTracker = generateNonceTrackerWith(pendingTxs, [], '0x40')
+ })
+
+ it('should return nonce after network nonce', async function () {
+ this.timeout(15000)
+ const nonceLock = await nonceTracker.getNonceLock('0x7d3517b0d011698406d6e0aed8453f0be2697926')
+ assert.equal(nonceLock.nextNonce, '74', `nonce should be 74 got ${nonceLock.nextNonce}`)
+ await nonceLock.releaseLock()
+ })
+ })
})
})