Skip to content
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

Gas estimation error is not forwarded to the caller in v5-beta #829

Closed
sz-piotr opened this issue May 11, 2020 · 5 comments
Closed

Gas estimation error is not forwarded to the caller in v5-beta #829

sz-piotr opened this issue May 11, 2020 · 5 comments
Labels
enhancement New feature or improvement.

Comments

@sz-piotr
Copy link

Relevant code:
https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abstract-signer/src.ts/index.ts#L170-L176

In Waffle (https://github.com/EthWorks/waffle) we rely on ganache throwing an error containing the revert message during gas estimation in order for matchers like .revertedWith(message) to work. The new ethers behaviour eliminates this possibility.

Is there anything that we can do to be able to see error message similar to those that were in v4?

RuntimeError: VM Exception while processing transaction: revert Reason
@ricmoo
Copy link
Member

ricmoo commented May 13, 2020

I'd generally prefer systems like Ganache find a more standards compliant way to bubble errors like this back to the user (and in this case, should not trigger an error at all), but since it is a service fairly widely adopted already, does it help if the wrapped error includes the original error?

It would be accessible at error.error to get the original error...

Sound fair/good? :)

@ricmoo
Copy link
Member

ricmoo commented May 13, 2020

(actually; I may be wrong. I'm not sure what a standard node would do in this case, I should research that a bit. And bring it up in my talks with the Eth2 peeps on standardizing errors.)

@ricmoo ricmoo added enhancement New feature or improvement. next version (v5) on-deck This Enhancement or Bug is currently being worked on. labels May 13, 2020
@ricmoo
Copy link
Member

ricmoo commented May 13, 2020

The error should now be available in 5.0.0-beta.187. Try it out and let me know if that works for you. :)

@ricmoo ricmoo removed the on-deck This Enhancement or Bug is currently being worked on. label May 13, 2020
@sz-piotr
Copy link
Author

I will get back to you as soon as we try it out in waffle

@ricmoo
Copy link
Member

ricmoo commented May 14, 2020

Awesome. I'll close this for now then, because I think that should address your issue. But if it is still a problem, or inadequate, please re-open.

Thanks! :)

@ricmoo ricmoo closed this as completed May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement.
Projects
None yet
Development

No branches or pull requests

2 participants