bug: vm.txGasPrice
cheatcode incompatible with --gas-report/--isolate
option
#7277
Open
2 tasks done
Labels
A-cheatcodes
Area: cheatcodes
A-gas-snapshots
Area: gas snapshotting/reporting
C-forge
Command: forge
Cmd-forge-test
Command: forge test
P-normal
Priority: normal
T-bug
Type: bug
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (2f432fb 2024-02-29T00:16:38.827810253Z)
What command(s) is the bug in?
forge test --gas-report
Operating System
Windows
Describe the bug
Example repo: https://github.com/KirienzoEth/foundry-gas-report-txgasprice-issue
The
vm.txGasPrice
cheatcode seems to be incompatible with the use of--gas-report
in functions that usetx.gasprice
.The
--gas-report
option seem to be calling the contract that is tested with a new transaction (to measure the gas used I'm assuming), but asvm.txGasPrice
only works in the current transaction (see foundry book), any function relying ontx.gasprice
will fail.The text was updated successfully, but these errors were encountered: