feat(forge): add vm.lastCallGas cheatcode#7573
Merged
Merged
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
zerosnacks
commented
Apr 5, 2024
zerosnacks
commented
Apr 5, 2024
zerosnacks
commented
Apr 5, 2024
Collaborator
|
Before merge let's make sure this feature is actually the best solution to the problem, ref #7272 (comment) |
zerosnacks
commented
Apr 5, 2024
klkvr
reviewed
Apr 5, 2024
Member
|
Can't we make this work for non-isolated tests as well? |
vm.lastGasUsed cheatcodevm.lastCallGas cheatcode
Evalir
reviewed
Apr 8, 2024
Evalir
left a comment
Contributor
There was a problem hiding this comment.
excited to see this, i think it's going to be pretty useful. nits:
klkvr
requested changes
Apr 8, 2024
klkvr
left a comment
Member
There was a problem hiding this comment.
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
This was referenced Apr 26, 2024
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Closes #7272
Solution
lastCallGascheatcode, primarily to be used in isolation mode for accurate measurements.exclude_contractsto test filterGasstruct instead of proposeduint256, with details like gas spend on memory and gas refunds