Fix tests

This commit is contained in:
Omar Abdulla
2025-07-14 21:30:35 +03:00
parent 075c8235a7
commit 83c20b1be3
+3 -3
View File
@@ -1,4 +1,4 @@
use std::{collections::HashMap, str::FromStr}; use std::collections::HashMap;
use alloy::{ use alloy::{
json_abi::JsonAbi, json_abi::JsonAbi,
@@ -210,7 +210,7 @@ fn resolve_argument(
.ok_or_else(|| anyhow::anyhow!("`-0` is invalid literal"))?; .ok_or_else(|| anyhow::anyhow!("`-0` is invalid literal"))?;
Ok(U256::MAX.checked_sub(value).expect("Always valid")) Ok(U256::MAX.checked_sub(value).expect("Always valid"))
} else if let Some(value) = value.strip_prefix("0x") { } else if let Some(value) = value.strip_prefix("0x") {
Ok(U256::from_str(value) Ok(U256::from_str_radix(value, 16)
.map_err(|error| anyhow::anyhow!("Invalid hexadecimal literal: {}", error))?) .map_err(|error| anyhow::anyhow!("Invalid hexadecimal literal: {}", error))?)
} else { } else {
// TODO: This is a set of "variables" that we need to be able to resolve to be fully in // TODO: This is a set of "variables" that we need to be able to resolve to be fully in
@@ -313,7 +313,7 @@ mod tests {
.selector() .selector()
.0; .0;
let input = Input { let input: Input = Input {
instance: "Contract".to_string(), instance: "Contract".to_string(),
method: Method::FunctionName("send".to_owned()), method: Method::FunctionName("send".to_owned()),
calldata: Some(Calldata::Compound(vec![ calldata: Some(Calldata::Compound(vec![