Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make fs read cheatcodes views #9289

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

iainnash
Copy link
Contributor

@iainnash iainnash commented Nov 8, 2024

Motivation

Closes #9284
This updates the Vm.sol file to have a few more view functions marked as views. Currently, some functions that operate as views are called a nonpayable which makes writing getters in tests and deployment scripts as views impossible even those that's a better naming convention for them.

This allows for code to be more organized for deployment / testing libraries where not all functions have to be write functions and can be further organized as view / pure functions when needed.

Solution

Add a view modifier to all FS view related functions in the cheatcodes definitions.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@grandizzy grandizzy merged commit bb545b1 into foundry-rs:master Nov 9, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore: isFile and isDir functions should be views
3 participants