Open JoseMiguelHerrera opened 3 months ago
since https://github.com/foundry-rs/foundry/pull/7186 --gas-report
enables isolation by default. You can verify that by comparing forge test --isolate
and forge test --gas-report
outputs
since foundry-rs/foundry#7186
--gas-report
enables isolation by default. You can verify that by comparingforge test --isolate
andforge test --gas-report
outputs
Thanks, makes sense. So what's the best practice to test features that use transient storage?
Transformed this ticket into a documentation ticket aiming to document best practices in regards to transient storage + gas snapshots
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (c2e5297 2024-06-14T00:22:57.565836000Z)
What command(s) is the bug in?
forge test --gas-report
Operating System
macOS (Intel)
Describe the bug
I'm using transient storage for context setting. Just before the function ends, I expect there to be some context in transient storage that I can fetch. This behaviour is working perfectly when I test with "forge test".
However, when I check with forge test --gas-report, the transient storage is empty, as if it has been cleared or never written at all.
What is so different between these 2 modes of operation that would cause this?
Cheers