-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Revert messages are not bubbled in proxy constructors #2425
Comments
Looking into the source code I stumdled across this
Is it because of the |
Thanks for reporting! Yes, it seems that we're not bubbling the revert reason in the constructor! (It is bubbled in the fallback function.) Unfortunately I don't think there's a workaround for you to be able to write the tests you want. I'm going to move this issue to our OpenZeppelin Contracts repo where proxies are hosted. We should fix it over there. We have to update the Upgrades Plugins to use those (see OpenZeppelin/openzeppelin-upgrades#164). |
Fixed by #2454. |
I'm trying to write some tests to check if some of the user inputs are correct. More specifically I've got the following code in my smart contract function. The code is part of the initialize function.
I have written a test that checks if the correct message is thrown when a 0x address is passed. I used the helper
Now when I run this it revert, however the error I get doesn't include the message defined in the require() section. Instead I get the default message
-revert
Now if I deploy the contract user
.new
function and manually invoking the initialize function then I get the correct message.I'm using:
The text was updated successfully, but these errors were encountered: