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

anvil: Fix snapshot revert not updating block-env correctly #6107

Merged

Conversation

ngotchac
Copy link
Contributor

It seems that #6097 wasn't sufficient to properly revert the block environment (latest block) after a snapshot revert. A simple eth_call that would return the latest block timestamp would show that it wasn't properly reverted.

Solution

I update the whole self.env.block to the past block-env, so that all fields for the current "latest" block are correct.

I also added a test, which calls the already on-chain deployed Multicall contract.

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.

oh yeah that's way better.

tysm, triggering release

@mattsse mattsse added the C-anvil Command: anvil label Oct 25, 2023
@mattsse mattsse merged commit 950d863 into foundry-rs:master Oct 25, 2023
16 checks passed
@ngotchac ngotchac deleted the ngotchac/upstream-fix-revert-snapshot branch October 25, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants