You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
substitute the return-status of the next sub-call that matches the revert or not. Similar to how we set up a prank, we need to remember an expected-revert in the call-frame, to then apply it as we bubble back the revert.
There might be a way to change the return-status in the existing tracer. Otherwise we may need a new but simple geth hook, similar to the caller-override.
The text was updated successfully, but these errors were encountered:
One note is that expectRevert in forge has a giant footgun in that it's intended to only work on the next CALL, but by accident it also works on code at the same call depth as the test (e.g. JUMPs to a function), but only for the first one in a test, and the rest of the test silently does not execute. Example + more info in this issue: foundry-rs/foundry#3437 (comment)
Everyone has come to rely on this bug in expectRevert so it has not been removed yet. Regardless, let's take the stricter approach here and only support expectRevert on CALLs, which is the ideal foundry v1 fix since that is how all other expect* cheats work: foundry-rs/foundry#7238
Request by @maurelian: support the
vm.expectRevert
cheatcode in the Go EVM-script environment.Docs: https://book.getfoundry.sh/cheatcodes/expect-revert?highlight=expectRevert#expectrevert
To implement:
expectPartialRevert
: selector matched onlyexpectRevert(bytes)
: exact full messageexpectRevert(bytes4)
: exact selector onlyexpectRevert()
: any messageThe text was updated successfully, but these errors were encountered: