-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: smarter getCode
validation
#7597
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, this check makes sense to me,
can we add a test for this as well?
@mattsse created a separate profile for tests in multi-version environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, pending @DaniPopes
As we're already here, also added more input options for vm.getCode("Counter.sol");
vm.getCode("Counter");
vm.getCode("Counter:0.X.X");
vm.getCode("Counter.sol:0.X.X");
vm.getCode("Counter.sol:Counter:0.X.X")` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Motivation
One more fix after #7334
If we've found multiple matching artifacts for
vm.getCode
and exactly one of them matches version of the currently running test/script source, return that.Ref https://t.me/foundry_support/52016
Solution
This changes test runner flow a bit so we now create executor for each
ContractRunner
to alter cheatcodes config with running contract version