You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
The nonce calculation fails in a local testrpc after you revert the state to a prior one.
The error:
Error: the tx doesn't have the correct nonce. account has nonce of: 18 tx has nonce of: 19
at /Users/anxo/code/gnosis/dx-services/node_modules/web3-provider-engine/subproviders/provider.js:19:36
at XMLHttpRequest.request.onreadystatechange (/Users/anxo/code/gnosis/dx-services/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/httpprovider.js:118:13)
at XMLHttpRequest.Object.<anonymous>.XMLHttpRequestEventTarget.dispatchEvent (/Users/anxo/code/gnosis/dx-services/node_modules/xhr2/lib/xhr2.js:64:18)
at XMLHttpRequest.Object.<anonymous>.XMLHttpRequest._setReadyState (/Users/anxo/code/gnosis/dx-services/node_modules/xhr2/lib/xhr2.js:354:12)
at XMLHttpRequest.Object.<anonymous>.XMLHttpRequest._onHttpResponseEnd (/Users/anxo/code/gnosis/dx-services/node_modules/xhr2/lib/xhr2.js:509:12)
at IncomingMessage.<anonymous> (/Users/anxo/code/gnosis/dx-services/node_modules/xhr2/lib/xhr2.js:469:24)
at IncomingMessage.emit (events.js:187:15)
at IncomingMessage.EventEmitter.emit (domain.js:441:20)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
I believe the issue is because the NonceTrackerSubprovider is caching the nonce even after reverting the state of a the local ganache.
Reverting the state in a local testrpc is very common thing to do in order to make the test repeatable, and to avoid tests influence each other.
Clearing the cache, make sure, we get the new nonce from the new state of the blockchain.
The text was updated successfully, but these errors were encountered:
The cache is also not updated when a transaction simply fails. I assume the "sendRawTransaction" method is never called and as such the cached nonce is not increased. However ganache increases the nonce for the account trying to send the reverted (failed) transaction. I had a look at the code to see whether I could force some kind of update but I did not see a chance. Is there no way to just manually increase the nonce?
The nonce calculation fails in a local testrpc after you revert the state to a prior one.
The error:
I believe the issue is because the
NonceTrackerSubprovider
is caching the nonce even after reverting the state of a the local ganache.Reverting the state in a local testrpc is very common thing to do in order to make the test repeatable, and to avoid tests influence each other.
Clearing the cache, make sure, we get the new nonce from the new state of the blockchain.
The text was updated successfully, but these errors were encountered: