Skip to content

Commit

Permalink
test: Add u256 overflow decompile tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Becker committed Jan 30, 2025
1 parent 05653c7 commit 220d20f
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions crates/core/tests/test_decompile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,56 @@ mod integration_tests {
}
}

#[tokio::test]
async fn test_decompile_u256_conversion_overflow_1() {
let rpc_url = std::env::var("RPC_URL").unwrap_or_else(|_| {
println!("RPC_URL not set, skipping test");
std::process::exit(0);
});

let result = decompile(DecompilerArgs {
target: String::from("0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7"),
rpc_url,
default: true,
skip_resolving: true,
include_solidity: true,
include_yul: false,
output: String::from(""),
name: String::from(""),
timeout: 10000,
abi: None,
openai_api_key: String::from(""),
llm_postprocess: false,
})
.await
.expect("failed to decompile");
}

#[tokio::test]
async fn test_decompile_u256_conversion_overflow_2() {
let rpc_url = std::env::var("RPC_URL").unwrap_or_else(|_| {
println!("RPC_URL not set, skipping test");
std::process::exit(0);
});

let result = decompile(DecompilerArgs {
target: String::from("0x5141b82f5ffda4c6fe1e372978f1c5427640a190"),
rpc_url,
default: true,
skip_resolving: true,
include_solidity: true,
include_yul: false,
output: String::from(""),
name: String::from(""),
timeout: 10000,
abi: None,
openai_api_key: String::from(""),
llm_postprocess: false,
})
.await
.expect("failed to decompile");
}

#[tokio::test]
async fn test_decompile_weth() {
let rpc_url = std::env::var("RPC_URL").unwrap_or_else(|_| {
Expand Down

0 comments on commit 220d20f

Please sign in to comment.