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

refactor(cheatcodes): rewrite string parsing with dyn abi #6269

Merged
merged 7 commits into from
Nov 9, 2023

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Nov 9, 2023

The static encoder is too inflexible for this task. We can still use it for defaults tho.

Closes #6070
Closes #6268
Closes #6265 via alloy-rs/core#410

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.

nice!
smol pedantic naming nit

crates/cheatcodes/src/env.rs Show resolved Hide resolved
Comment on lines +134 to +135
"1" => true,
"0" => false,
Copy link
Member

Choose a reason for hiding this comment

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

nice

crates/cheatcodes/src/string.rs Show resolved Hide resolved
}

// More lenient parsers than `coerce_str`.
fn parse_value_fallback(s: &str, ty: &DynSolType) -> Option<Result<DynSolValue, &'static str>> {
Copy link
Member

Choose a reason for hiding this comment

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

very nice

crates/cheatcodes/src/string.rs Show resolved Hide resolved
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.

let's replace the env value with the env name in the error message for env cheatcodes

@DaniPopes
Copy link
Member Author

Done

@DaniPopes
Copy link
Member Author

CI very flaky

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.

absolute fire!

@DaniPopes DaniPopes merged commit 834d959 into master Nov 9, 2023
20 checks passed
@DaniPopes DaniPopes deleted the dani/dyn-cheatcodes branch November 9, 2023 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants