trufflesuite / trufflesuite.com

Trufflesuite website source ✨
https://trufflesuite.com
181 stars 418 forks source link

metamask incorrect nonce when using truffle develop testrpc #30

Closed saneletm closed 6 years ago

saneletm commented 6 years ago

I am trying to find the course for this issue. https://github.com/MetaMask/metamask-extension/issues/2373

I have a feeling it has to do with the accounts the truffle develop testrpc generates. It might have to do with the fact that the Mnemonic: candy maple cake sugar pudding cream honey rich smooth crumble sweet treat is always used. Can this be randomized and changed per instance of the truffle develop testrpc. I haven't looked at the code for the testrpc on truffle yet. this is just my higher level understanding after playing with it. I might be wrong, but would really appreciate some help.

saneletm commented 6 years ago

I will try to find and paste the exact error when I come across it online. its hard to copy it from metamask because it is just on a tooltip that appear when you hover your mouse over the "failed" string next to the transaction on metamask.

bmmpxf commented 6 years ago

Hi @saneletm . Thanks, we're definitely familiar with this issue. I've encountered it multiple times personally.

It's a tossup on whether it's a Truffle or MetaMask issue to be honest. MetaMask should be able to reset its network history when something has changed. Truffle Develop arguably should be able to change its mnemonic.

But I think the MetaMask team is going to beat us to the solution, as they have a fix in place for the network reset. See https://github.com/MetaMask/metamask-extension/issues/1999 . And since we have a workaround, having people use either Ganache (or ganache-cli, formerly known as the TestRPC) I think we're likely going to wait for MetaMask to update.

But I'll leave this ticket open for now at least until that happens. Thanks for the issue report!

saneletm commented 6 years ago

sounds good, thanks!

eumend commented 6 years ago

Just notifying Metamask has just published their current fix with a "Reset Account" button meant for developers and it works in MetaMask/metamask-extension#1999, BUT the UI doesn't update with the correct amount of ether so remember to re-fund your Metamask accounts.

bmmpxf commented 6 years ago

Thanks for the update @eumend !