-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Display revert reasoning string in exception. #976
Comments
@kyriediculous Yes!! Super excited about this. Current status is:
Thanks for opening. |
Awesome, thanks for being on top of it ! |
Hi! Also interested in this issue. Will the new version of Ganache also pass along |
On There is also a nice PR open at ganache to do the decoding there. |
Thanks for the update! Is there anything I could help with or is it just waiting for things to be merged and released? |
@kronosapiens Yes it's kind of the latter. The reason string logic looks like it's working. It's bound up with a pull-request that targets the next major release and is a rewrite truffle's migrations command. That should go into review next week and be available as an alpha (or something) relatively soon. Thanks so much for your offer of help - really nice of you. Because we're coming up on a release the main thing that needs to be done is stress-testing the new code. Migrations are an especially complicated case - there are multiple clients which people connect to in several different ways with variant responses happening at different time scales. Will definitely ping this issue when there's a build of this available (so you can see where it's broken :).) |
@cgewecke This is fantastic news! I assume the debugger will display it during a session? |
@roschler I'm not sure about that actually - it should be visible in the source |
Small update: - We're getting ready to release a beta soon - the next tag is an unstable preview / nightly for that . . .
|
Cool ! I will check it out over the weekend and report my findings! Many thanks. |
Turns out we didn't have the reason string in the Not sure when this will make it out for release - I'd guess sometime in the next couple of weeks. That said I'm in the process of automating our releases so that we'll be able to push out smaller improvements like this more frequently. |
Hi I tried displaying the error reason string in my JS test without success. The error string is always "Transaction has been reverted by the EVM" even if my test is running on ganache-cli version 2.2.1. Is there a specific path or constraint to follow in order to display the error reason strings or is it too early to implement such features? |
I used these reasoning strings in my contracts until I got my contract so huge that it couldn't fit into ethereum transaction limit. I would like to see these reasoning strings in tests to distinguish one case from another but can skip for production use. Is it possible somehow? |
@eloudsa We have some unit tests that verify that the reason string works as expected with ganache here (for ganache when its --noVMErrorsOnRPCResponse flag is set to true) and here for the default case. If you have a chance could you look at those and see if there are any obvious differences between your implementation and ours? Could you also verify that you're not accidentally connecting to a non-ganache client running in the background? @danaki There is a ganache-cli option which lets you turn off the contract size limit: |
@cgewecke Thanks for your reply. I'm using ganache as I can check transactions in the console window. Without the --noVMErrorsOnRPCResponse flag, the reason string message is displayed in the error message. But, the reason remains undefined. Do you have a any small truffle project (contract and test) I can use to check my environment? @cgewecke Another issue: If I run ganache-cli with a block time, the reason is not more displayed. |
Does the reason string propagate through Web3.js? If so, any particular
version/library?
…On Sun, Sep 23, 2018 at 2:39 PM, Said Eloudrhiri ***@***.***> wrote:
@cgewecke <https://github.com/cgewecke> Thanks for your reply. I'm using
ganache as I can check transactions in the console window. Without the
--noVMErrorsOnRPCResponse flag, the reason string message is displayed in
the error message. But, the reason remains undefined. Do you have a any
small truffle project (contract and test) I can use to check my environment?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#976 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEcdB8zO1fvhNteOSYuf5cQmOfSieYGdks5ud9VKgaJpZM4UU14f>
.
--
Thanks,
Robert Oschler
Twitter: https://twitter.com/roschler <http://twitter.com/roschler>
LinkedIn: https://www.linkedin.com/in/natlang/
|
This should be released and available in v5. Let us know if we missed a use case and we'll re-open. Thank you! |
Been using truffle ^5.0.0 for some weeks now and the reasoning strings work very well while testing. 10/10 |
My ganache GUI version is v2.5.4, truffle version is v5.1.57. But I cannot got error reason string when the transaction revert! |
@qiluge best to open a new issue for this |
Issue
It seems that, in contrast to Remix, truffle does not yet display the reasoning strings that can be added to Revert/Require since solidity 0.4.22
Steps to Reproduce
Make a function that reverts with a message and call it from a unit test, console.error() the exception.
Expected Behavior
Actual Results
Error: VM Exception while processing transaction: revert
Environment
truffle version
): Truffle v4.1.8 (core: 4.1.9)node --version
): 8.11.2npm --version
): 5.6.0The text was updated successfully, but these errors were encountered: