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

vm.expectRevert should support an empty signature to catch reverts with no message #885

Closed
StErMi opened this issue Mar 9, 2022 · 0 comments · Fixed by #918
Closed

vm.expectRevert should support an empty signature to catch reverts with no message #885

StErMi opened this issue Mar 9, 2022 · 0 comments · Fixed by #918
Assignees
Labels
A-cheatcodes Area: cheatcodes C-forge Command: forge Cmd-forge-test Command: forge test P-normal Priority: normal T-feature Type: feature

Comments

@StErMi
Copy link

StErMi commented Mar 9, 2022

Component

Forge

Describe the feature you would like

I know that's not the best practice and we should not support it but as we discussed on telegram forge will also be used by auditors that have no power on the devs choice but maybe would like to audit the project using the powerful tools that forge use.

I was testing a contract that have this requirement in the code

require(poolBalance == balanceBefore);

and the only way to cover that case in my tests was to use

vm.expectRevert(bytes(""));

from a dev UX prospective, I would expect to have a expectRevert function with an empty selector that will cover that case

Additional context

No response

@StErMi StErMi added the T-feature Type: feature label Mar 9, 2022
@onbjerg onbjerg added Cmd-forge-test Command: forge test C-forge Command: forge A-cheatcodes Area: cheatcodes P-normal Priority: normal labels Mar 12, 2022
@onbjerg onbjerg self-assigned this Mar 14, 2022
@onbjerg onbjerg linked a pull request Mar 17, 2022 that will close this issue
18 tasks
@onbjerg onbjerg mentioned this issue Mar 21, 2022
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cheatcodes Area: cheatcodes C-forge Command: forge Cmd-forge-test Command: forge test P-normal Priority: normal T-feature Type: feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants