vm.canRevert()
: allow tests to revert in expected cases
#4090
Labels
Milestone
vm.canRevert()
: allow tests to revert in expected cases
#4090
Component
Forge
Describe the feature you would like
Often it's desirable to check properties of results, such as a new price of an AMM. However, these functions can contain error-checks and revert on certain inputs. And sometimes I want to make sure a property holds only if I actually get a result from a call and ignore the reverting cases.
An example of what this could look like is:
A current workaround is to use low-level calls or
try ... catch ...
, but these have to be set up for each function manually.An implementation of
vm.canRevert
/vm.allowRevert
could add to the counter ofvm.assume
checks to make sure that one isn't rejecting all calls.Additional context
No response
The text was updated successfully, but these errors were encountered: