1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Refer to pending nonces, not just their count

This commit is contained in:
Dan Finlay 2017-08-21 17:29:31 -07:00
parent 7d34b22d78
commit 38ba31bbe0

View File

@ -110,6 +110,21 @@ describe('Nonce Tracker', function () {
await nonceLock.releaseLock() 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()
})
})
}) })
}) })