-
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
feat(forge): add vm.lastCallGas
cheatcode
#7573
Conversation
…h gas related information rather than a uint256
…re therefore it doesnt actually remember the correct value from the previous execution but only of the previous executed cheatcode
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.
this looks clean, only have one comment re name,
wdyt @klkvr ?
Before merge let's make sure this feature is actually the best solution to the problem, ref #7272 (comment) |
Can't we make this work for non-isolated tests as well? |
vm.lastGasUsed
cheatcodevm.lastCallGas
cheatcode
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.
excited to see this, i think it's going to be pretty useful. nits:
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.
nice work! lgtm overall, would like to improve tests for this a bit
…ment subset of cheats that require to be tested in isolation mode as well
…est filter, not just individual tests or paths
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
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.
tests look great, lgtm
Motivation
Closes #7272
Solution
lastCallGas
cheatcode, primarily to be used in isolation mode for accurate measurements.exclude_contracts
to test filterGas
struct instead of proposeduint256
, with details like gas spend on memory and gas refunds