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

Rust: Use Typed State Mutability #12

Merged
merged 4 commits into from
Sep 5, 2024
Merged

Rust: Use Typed State Mutability #12

merged 4 commits into from
Sep 5, 2024

Conversation

tonyke-bot
Copy link
Contributor

This PR aims to add an enum StateMutability into the rust part and change the return type of function_state_mutability from &'static str to this enum.

Using enum for such determined return values reduces the chance of typo mistake when consuming the return value from evmole

@cdump
Copy link
Owner

cdump commented Sep 5, 2024

Maybe we can use https://docs.rs/alloy-json-abi/0.8.0/alloy_json_abi/enum.StateMutability.html
We already have alloy_json_abi as dependency for our alloy-dyn-abi direct dependency

@tonyke-bot
Copy link
Contributor Author

Ah! absolutely. Don't want to create a new enum either

src/state_mutability.rs Show resolved Hide resolved
src/state_mutability.rs Show resolved Hide resolved
src/state_mutability.rs Show resolved Hide resolved
src/state_mutability.rs Show resolved Hide resolved
@cdump cdump merged commit 382c215 into cdump:master Sep 5, 2024
17 checks passed
@cdump
Copy link
Owner

cdump commented Sep 5, 2024

Merged, thanks. Next version will be 0.5.0 as this PR breaks the 0.4.x API.

@tonyke-bot
Copy link
Contributor Author

Make sense to bump the major version. Thank you!

@tonyke-bot tonyke-bot deleted the rust-typed-state-mutability branch September 5, 2024 10:41
@cdump cdump mentioned this pull request Sep 5, 2024
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.

2 participants