Component
Forge
Describe the feature you would like
With support for --isolate when running tests and scripts, it would be helpful to expose a function lastGasUsed() in VM.sol that returns the gasUsed of the immediate last top-level transaction.
Better still, a function gasUsed() returns (uint256[] memory) that returns an array of gasUsed of all top level calls made in that isolated vm execution
Additional context
This would be particularly helpful given that currently, when a function is called multiple times, the only way to see the gas used for individual calls is to look at the expanded trace, a gasUsed helper function, would make it possible for a dev to access and use this info how they deem fit.
No response
Component
Forge
Describe the feature you would like
With support for
--isolatewhen running tests and scripts, it would be helpful to expose a functionlastGasUsed()in VM.sol that returns the gasUsed of the immediate last top-level transaction.Better still, a function
gasUsed() returns (uint256[] memory)that returns an array of gasUsed of all top level calls made in that isolated vm executionAdditional context
This would be particularly helpful given that currently, when a function is called multiple times, the only way to see the gas used for individual calls is to look at the expanded trace, a
gasUsedhelper function, would make it possible for a dev to access and use this info how they deem fit.No response