Skip to content

NONCE_EXPIRED when doing many txs with ethers.js on local hardhat node #2699

Answered by ARyaskov
ARyaskov asked this question in Q&A
Discussion options

You must be logged in to vote

Oh, just completely got it!
I used
snapshot = await ethers.provider.send('evm_snapshot') in mocha's beforeAll()

await ethers.provider.send('evm_revert', [snapshot]) in mocha's afterAll()

There were collisions between snapshots nonces. Be careful with evm_snapshot/evm_revert

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ARyaskov
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ARyaskov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2697 on February 15, 2022 16:45.