Skip to content

Commit 220d20f

Browse files
committed
test: Add u256 overflow decompile tests
1 parent 05653c7 commit 220d20f

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

crates/core/tests/test_decompile.rs

+50
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,56 @@ mod integration_tests {
3838
}
3939
}
4040

41+
#[tokio::test]
42+
async fn test_decompile_u256_conversion_overflow_1() {
43+
let rpc_url = std::env::var("RPC_URL").unwrap_or_else(|_| {
44+
println!("RPC_URL not set, skipping test");
45+
std::process::exit(0);
46+
});
47+
48+
let result = decompile(DecompilerArgs {
49+
target: String::from("0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7"),
50+
rpc_url,
51+
default: true,
52+
skip_resolving: true,
53+
include_solidity: true,
54+
include_yul: false,
55+
output: String::from(""),
56+
name: String::from(""),
57+
timeout: 10000,
58+
abi: None,
59+
openai_api_key: String::from(""),
60+
llm_postprocess: false,
61+
})
62+
.await
63+
.expect("failed to decompile");
64+
}
65+
66+
#[tokio::test]
67+
async fn test_decompile_u256_conversion_overflow_2() {
68+
let rpc_url = std::env::var("RPC_URL").unwrap_or_else(|_| {
69+
println!("RPC_URL not set, skipping test");
70+
std::process::exit(0);
71+
});
72+
73+
let result = decompile(DecompilerArgs {
74+
target: String::from("0x5141b82f5ffda4c6fe1e372978f1c5427640a190"),
75+
rpc_url,
76+
default: true,
77+
skip_resolving: true,
78+
include_solidity: true,
79+
include_yul: false,
80+
output: String::from(""),
81+
name: String::from(""),
82+
timeout: 10000,
83+
abi: None,
84+
openai_api_key: String::from(""),
85+
llm_postprocess: false,
86+
})
87+
.await
88+
.expect("failed to decompile");
89+
}
90+
4191
#[tokio::test]
4292
async fn test_decompile_weth() {
4393
let rpc_url = std::env::var("RPC_URL").unwrap_or_else(|_| {

0 commit comments

Comments
 (0)