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

chore(deps): bump foundry-compilers 0.12.4 #9455

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions crates/cheatcodes/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl Cheatcode for toString_0Call {
impl Cheatcode for toString_1Call {
fn apply(&self, _state: &mut Cheatcodes) -> Result {
let Self { value } = self;
Ok(hex::encode_prefixed(value).abi_encode())
Ok(value.to_string().abi_encode())
}
}

Expand Down Expand Up @@ -95,39 +95,34 @@ impl Cheatcode for parseBoolCall {
}
}

// toLowercase
impl Cheatcode for toLowercaseCall {
fn apply(&self, _state: &mut Cheatcodes) -> Result {
let Self { input } = self;
Ok(input.to_lowercase().abi_encode())
}
}

// toUppercase
impl Cheatcode for toUppercaseCall {
fn apply(&self, _state: &mut Cheatcodes) -> Result {
let Self { input } = self;
Ok(input.to_uppercase().abi_encode())
}
}

// trim
impl Cheatcode for trimCall {
fn apply(&self, _state: &mut Cheatcodes) -> Result {
let Self { input } = self;
Ok(input.trim().abi_encode())
}
}

// Replace
impl Cheatcode for replaceCall {
fn apply(&self, _state: &mut Cheatcodes) -> Result {
let Self { input, from, to } = self;
Ok(input.replace(from, to).abi_encode())
}
}

// Split
impl Cheatcode for splitCall {
fn apply(&self, _state: &mut Cheatcodes) -> Result {
let Self { input, delimiter } = self;
Expand All @@ -136,15 +131,13 @@ impl Cheatcode for splitCall {
}
}

// indexOf
impl Cheatcode for indexOfCall {
fn apply(&self, _state: &mut Cheatcodes) -> Result {
let Self { input, key } = self;
Ok(input.find(key).map(U256::from).unwrap_or(U256::MAX).abi_encode())
}
}

// contains
impl Cheatcode for containsCall {
fn apply(&self, _state: &mut Cheatcodes) -> Result {
let Self { subject, search } = self;
Expand Down Expand Up @@ -202,7 +195,7 @@ fn parse_value_fallback(s: &str, ty: &DynSolType) -> Option<Result<DynSolValue,
DynSolType::Uint(_) |
DynSolType::FixedBytes(_) |
DynSolType::Bytes => {
if !s.starts_with("0x") && s.chars().all(|c| c.is_ascii_hexdigit()) {
if !s.starts_with("0x") && hex::check_raw(s) {
return Some(Err("missing hex prefix (\"0x\") for hex string"));
}
}
Expand Down
Loading