-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📈assertRevert with message checking. #917
Comments
Not 100% sure on what you have in mind with this: do you want to provide an expected error message and have the assert fail on a mismatch? |
Bingo, that is exactly what I meant. |
There's #888 for discussing revert reasons (error messages) in OpenZeppelin itself. It makes sense to move forward with this helper though even before we introduce reasons in OpenZeppelin. |
Hi @MoMannn , I was looking into this issue and wanted to extend |
@justuswilhelm Sorry I have never went into the details of truffle so I can't really help you here it is just a feature I would like to have. |
Sadly, it looks like this isn't yet possible in web3: web3/web3.js#1707. |
web3.js is not the culprit. There is actually no way to retrieve the revert reason from a node. EIP 758 is a proposal to solve that, and there's Geth (ethereum/go-ethereum#16424) and Ganache (trufflesuite/ganache#116) issues to implement it. I guess we'll have to wait and see how that plays out. |
@justuswilhelm looks like truffle 5.0 will allow for this to be possible: see the relevant beta release notes. |
It is worth noting that checking revert reason is currently possible with Ganache CLI, as demoed in this repo https://github.com/remon-nashid/assertRevert. |
@remon-nashid Nice! Are you interested in incorporating your code into the OpenZeppelin helper? |
IMO this issue can be closed as 'assertRevert' is superseded by |
@remon-nashid agreed. Closing. |
Provide assertRevert with the ability to check the revert message (added in solidity 0.4.22).
The text was updated successfully, but these errors were encountered: