Open mds1 opened 7 months ago
Would love to see this, as it would resolve a dilemma wherein we need to choose between:
import { console2 as console } from "forge-std/console2.sol";
to every test file, even if it remains unused (which breaks our linting rules).
Component
Forge
Describe the feature you would like
We can remove the large codegen'd console.log libraries in forge-std and replace them with native
vm.print
cheats (notvm.log
since that naming would cause confusion with event logs).As part of this, we should have methods to print all the structs and enums in
Vm.sol
, both as standalone, and array variants (e.g.vm.print(AccountAccess)
andvm.print(AccountAccess[])
because you get an array back fromvm.stopAndReturnStateDiff()
.Additionally, all print methods should be
pure
.Performance expectations:
This allows us to remove the
console
andconsole2
libraries. However, we still have thesafeconsole
library which does not affect memory. If possible, it would be great for the print cheats to replace that as well. Ref https://github.com/foundry-rs/forge-std/pull/375This issue is something we've discussed in the past and the idea to add print methods for structs is inspired by https://github.com/foundry-rs/forge-std/pull/439.
Additional context
No response