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

fix(cheatcodes): return early in case of reverts to not conflict with expect* logic #6172

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

Evalir
Copy link
Member

@Evalir Evalir commented Oct 30, 2023

Fixes #6170.

The bug was caused by the logic around detecting unmatched calls/events when the root test call is terminating. The unrelated revert was causing the revert reason to be completely unrelated to what actually caused the real revert, which was visible if the verbosity was increased.

We should actually early return at depth 0 before running any vm.expect* cheatcode logic as if not we'll polute the revert reason with something else.

@Evalir Evalir requested a review from mattsse October 30, 2023 16:57
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

can we add a repro test for the example of

#6170

feeling a bit uneasy applying all these fixes

I see this just changed the order

@mattsse
Copy link
Member

mattsse commented Oct 30, 2023

fyi @DaniPopes merging this because critical

@mattsse mattsse merged commit 8efbdae into master Oct 30, 2023
16 checks passed
@mattsse mattsse deleted the evalir/fix-events branch October 30, 2023 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing related to events broken
2 participants