feat(cheatcodes): Make expectCall only work for the next call's subcalls#4986
Merged
feat(cheatcodes): Make expectCall only work for the next call's subcalls#4986
expectCall only work for the next call's subcalls#4986Conversation
Member
Author
|
the ci failure looks a tad strange @mattsse — this shouldn't be making revm randomly fail to check the journaled state? we're not accessing it on places it might be undefined i believe, but it seems like the usage of |
mattsse
reviewed
May 20, 2023
Member
mattsse
left a comment
There was a problem hiding this comment.
seems like only the transact_fork test is affected,
could also be an rpc provider issue with that test, but it's weird that this panics
mattsse
approved these changes
May 24, 2023
Comment on lines
+896
to
+897
| // If the depth is 0, then this is the root call terminating | ||
| if data.journaled_state.depth() == 0 { |
Member
Author
|
Reverting this to merge into a feature branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Right now,
expectCallworks at the "test" level—as long as there are enough calls to the target contract at any depth level in the test, it will pass. This will make it so that the calls are only counted if they happen in an external call, meaning calls performed at the "test" ("root") level will not count.New behavior
The current behavior allows using expectCall this way:
This is not the intended behavior, due to this reason:
expect*cheatcodes should only work for the next call.This means that
expectCallshould actually expect to match calls that are "subcalls" of the next call.This PR introduces the following behavior
TODO: