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

feat(script): simulate mining on the onchain simulation with --slow #2481

Merged
merged 3 commits into from
Jul 26, 2022

Conversation

joshieDo
Copy link
Collaborator

Motivation

ref #2474

And should also close #1902 to my understanding. ( @naps62 )

Solution

Increment block.number in between calls during the onchain simulation.

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.

This will disable the cheatcodes as they are not used anyway as this is actually meant for simulation/use, correct?

Would this cause side effects when using cheatcodes in scripts?

@joshieDo
Copy link
Collaborator Author

Would this cause side effects when using cheatcodes in scripts?

I don't think so. Given that it's the onchain simulation, i'd say that's the recommended way actually.

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.

lgtm!

@mattsse
Copy link
Member

mattsse commented Jul 26, 2022

smol merge conflict @joshieDo then good 2 merge

@mattsse mattsse merged commit 180790d into foundry-rs:master Jul 26, 2022
@mattsse mattsse added Cmd-forge-script Command: forge script T-feature Type: feature labels Jul 26, 2022
iFrostizz pushed a commit to iFrostizz/foundry that referenced this pull request Nov 9, 2022
…foundry-rs#2481)

* increment block.number on onchain simulation with --slow

* add doc to executor.build_env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cmd-forge-script Command: forge script T-feature Type: feature
Projects
None yet
2 participants