Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • I don't see how this answers the question. This is only useful for reading explicit revert reasons, not for simulating transactions Commented Apr 16, 2020 at 5:12
  • @LauriPeltonen How do you define 'simulating the transactions'? If you connect to the main blockchain via Web3 and run the TestContract.methods.myMethod(myParam).call, it runs the transaction as it would when you send it, but without actually sending it. Commented Apr 16, 2020 at 5:28
  • No call does not run a transaction and it does not even create a transaction. It's used only for access constant data in the blockchain and its data is read directly from your own node. web3js.readthedocs.io/en/v1.2.0/… Commented Apr 16, 2020 at 5:42
  • @LauriPeltonen Exactly, but you can call any state modifying function. I understand now what you mean by simulating it as in actually sending it to a local blockchain. However, I don't know what that might be useful for. And the original poster asked for 'the exact error (or line of code)' which you can perfectly get the way I described. Commented Apr 16, 2020 at 5:48
  • To me it sounds like a good idea to simulate a tx in advance. If for example you want to issue a tx which either costs a lot or might cause unwanted side effects then you can safely test the consequences locally in ganache Commented Apr 16, 2020 at 5:56