foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.33k stars 1.76k forks source link

chore: `isFile` and `isDir` functions should be views #9284

Closed iainnash closed 1 week ago

iainnash commented 3 weeks ago

https://github.com/foundry-rs/forge-std/blob/1eea5bae12ae557d589f9f0f0edae2faa47cb262/src/Vm.sol#L690

If readFile is a view, why are isFile and isDir not views?

mds1 commented 2 weeks ago

cc @grandizzy, guessing these can also be view?

grandizzy commented 2 weeks ago

yep, they can be changed. additionally we may want to review all fns in vm and update sigs where needed.

iainnash commented 1 week ago

I imagine most filesystem getXXX would be views and not external mutable calls in a few cases.

I have a PR updating this here: https://github.com/foundry-rs/foundry/pull/9289