From c99a650a5128210e96be5b15fd6eea65628709ab Mon Sep 17 00:00:00 2001 From: Evgeny Ukhanov Date: Mon, 8 Apr 2024 21:24:24 +0200 Subject: [PATCH] Fix all tests that before Cancun hard fork --- evm-tests/ethjson/src/spec/spec.rs | 4 +++- evm-tests/jsontests/src/state.rs | 6 ++++-- evm-tests/jsontests/tests/state.rs | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/evm-tests/ethjson/src/spec/spec.rs b/evm-tests/ethjson/src/spec/spec.rs index 8493d81b..75d9694d 100644 --- a/evm-tests/ethjson/src/spec/spec.rs +++ b/evm-tests/ethjson/src/spec/spec.rs @@ -46,9 +46,11 @@ pub enum ForkSpec { London, /// Paris - The Merge (#15,537,394, 2022-09-15) Merge, + /// Paris - The Merge (#15,537,394, 2022-09-15) + Paris, /// Shanghai (#17,034,870, 2023-04-12) Shanghai, - /// Cancun + /// Cancun (2024-03-13) Cancun, /// Byzantium transition test-net diff --git a/evm-tests/jsontests/src/state.rs b/evm-tests/jsontests/src/state.rs index c468fe03..817973d9 100644 --- a/evm-tests/jsontests/src/state.rs +++ b/evm-tests/jsontests/src/state.rs @@ -235,7 +235,7 @@ fn test_run(name: &str, test: Test) { ethjson::spec::ForkSpec::London => (Config::london(), true), ethjson::spec::ForkSpec::Merge => (Config::merge(), true), ethjson::spec::ForkSpec::Shanghai => (Config::shanghai(), true), - ethjson::spec::ForkSpec::Cancun => (Config::shanghai(), true), + // ethjson::spec::ForkSpec::Cancun => (Config::cancun(), true), spec => { println!("Skip spec {spec:?}"); continue; @@ -252,7 +252,9 @@ fn test_run(name: &str, test: Test) { } let vicinity = vicinity.unwrap(); let caller = test.unwrap_caller(); - let caller_balance = original_state.get(&caller).unwrap().balance; + let caller_balance = original_state + .get(&caller) + .map_or_else(U256::zero, |acc| acc.balance); for (i, state) in states.iter().enumerate() { print!("Running {}:{:?}:{} ... ", name, spec, i); diff --git a/evm-tests/jsontests/tests/state.rs b/evm-tests/jsontests/tests/state.rs index 49034f02..4c450339 100644 --- a/evm-tests/jsontests/tests/state.rs +++ b/evm-tests/jsontests/tests/state.rs @@ -47,10 +47,12 @@ const SKIPPED_CASES: &[&str] = &[ // run, whereas this test runner parses everything up-front before // running the test. "stTransactionTest/ValueOverflow", + "stTransactionTest/ValueOverflowParis", // The below test cases are failing in geth too and as such are // skipped here until they are fixed there (otherwise we don't know // what the expected value should be for each test output). "stTransactionTest/HighGasPrice", + "stTransactionTest/HighGasPriceParis", "stCreateTest/CreateTransactionHighNonce", ];