foundry icon indicating copy to clipboard operation
foundry copied to clipboard

fix: Respect `--override-*` flags on `cast call` with `--trace` flag

Open Yen opened this issue 6 months ago • 3 comments

Fixes #10720

Yen avatar Jun 05 '25 21:06 Yen

I have looked at the existing tests for --override and they use the stderr_eq check to ensure the output is expected. If I add additional tests in the case of --trace this output is more complex and I assume it will change more often. Is it ok for the tests to fail when the format of the trace changes in the future, would the expectation be that the tests are updated to reflect this?

Yen avatar Jun 06 '25 13:06 Yen

Ah, actually I did not see the SNAPSHOTS=overwrite functionality which I assume is meant to assist in this case. I will add equivalent tests to the existing --override tests with the --trace flag enabled.

Yen avatar Jun 06 '25 13:06 Yen

I have added tests and rebased onto the latest master. Thanks

Yen avatar Jun 13 '25 13:06 Yen

@Yen cast call accepts now block.time and block.number overrides (as of https://github.com/foundry-rs/foundry/pull/10727) mind to add those to work with --trace as well? thank you

grandizzy avatar Jun 19 '25 05:06 grandizzy

I have rebased and added the block overrides to work with --trace. The changes were minor. 👍

Yen avatar Jun 19 '25 14:06 Yen

Tests in CI are failing after the rebase but not sure what the reason is as these tests don't use --trace. Can a maintainer confirm these are caused by the changes here as I can't understand what change causes them.

Yen avatar Jun 19 '25 15:06 Yen

yeah, not related, looks like a contract we use in a test was upgraded and returns different now

grandizzy avatar Jun 19 '25 15:06 grandizzy