aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-08-24 12:01:42 +0800
committerDan Finlay <dan@danfinlay.com>2017-08-24 12:01:42 +0800
commitdae7c632d6b7bed74abbe6bbc7b6b43deb2f2f0d (patch)
tree7511c8c0a49dea6da87ea5e07604e1eb18d53dac /test
parent855f4eeacbcf7b3e056cf7956edea2c84fa256d5 (diff)
downloadtangerine-wallet-browser-dae7c632d6b7bed74abbe6bbc7b6b43deb2f2f0d.tar
tangerine-wallet-browser-dae7c632d6b7bed74abbe6bbc7b6b43deb2f2f0d.tar.gz
tangerine-wallet-browser-dae7c632d6b7bed74abbe6bbc7b6b43deb2f2f0d.tar.bz2
tangerine-wallet-browser-dae7c632d6b7bed74abbe6bbc7b6b43deb2f2f0d.tar.lz
tangerine-wallet-browser-dae7c632d6b7bed74abbe6bbc7b6b43deb2f2f0d.tar.xz
tangerine-wallet-browser-dae7c632d6b7bed74abbe6bbc7b6b43deb2f2f0d.tar.zst
tangerine-wallet-browser-dae7c632d6b7bed74abbe6bbc7b6b43deb2f2f0d.zip
Add mysterious failing test
Diffstat (limited to 'test')
-rw-r--r--test/unit/nonce-tracker-test.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/unit/nonce-tracker-test.js b/test/unit/nonce-tracker-test.js
index 758bf9eb6..5f247b46b 100644
--- a/test/unit/nonce-tracker-test.js
+++ b/test/unit/nonce-tracker-test.js
@@ -142,6 +142,26 @@ describe('Nonce Tracker', function () {
await nonceLock.releaseLock()
})
})
+
+ describe('A normal usage condition.', function () {
+ beforeEach(function () {
+ const txGen = new MockTxGen()
+ const confirmedTxs = txGen.generate({ status: 'confirmed' }, { count: 10 })
+ const pendingTxs = txGen.generate({
+ status: 'submitted',
+ nonce: 100,
+ }, { count: 1 })
+ // 0x32 is 50 in hex:
+ nonceTracker = generateNonceTrackerWith(pendingTxs, confirmedTxs, '0x32')
+ })
+
+ it('should return nonce after network nonce', async function () {
+ this.timeout(15000)
+ const nonceLock = await nonceTracker.getNonceLock('0x7d3517b0d011698406d6e0aed8453f0be2697926')
+ assert.equal(nonceLock.nextNonce, '10', `nonce should be 10 got ${nonceLock.nextNonce}`)
+ await nonceLock.releaseLock()
+ })
+ })
})
})