From debeb7361e254c9daa1ad313b03f64e6a9b12059 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Mon, 20 Nov 2023 19:50:21 +0100 Subject: [PATCH] Compliance fix #6 --- .github/workflows/rust.yml | 1 + jsontests/src/run.rs | 8 +++++++- src/backend/in_memory.rs | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 615634d32..5a1894291 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,6 +38,7 @@ jobs: cargo run --release --verbose -p jsontests -- \ jsontests/res/ethtests/GeneralStateTests/stCodeCopyTest/ \ jsontests/res/ethtests/GeneralStateTests/stExample/ \ + jsontests/res/ethtests/GeneralStateTests/stSelfBalance \ jsontests/res/ethtests/GeneralStateTests/stSLoadTest/ \ jsontests/res/ethtests/GeneralStateTests/VMTests/vmArithmeticTest/ \ jsontests/res/ethtests/GeneralStateTests/VMTests/vmBitwiseLogicOperation/ \ diff --git a/jsontests/src/run.rs b/jsontests/src/run.rs index 75a01afaa..eb4bf7331 100644 --- a/jsontests/src/run.rs +++ b/jsontests/src/run.rs @@ -81,7 +81,13 @@ pub fn run_test(_filename: &str, _test_name: &str, test: Test, debug: bool) -> R state, logs: Vec::new(), suicides: Vec::new(), - hots: BTreeSet::new(), + hots: { + let mut hots = BTreeSet::new(); + for i in 1..10 { + hots.insert((u256_to_h256(U256::from(i)).into(), None)); + } + hots + }, }], }; let mut step_backend = run_backend.clone(); diff --git a/src/backend/in_memory.rs b/src/backend/in_memory.rs index c1b8554b8..894d5c6c5 100644 --- a/src/backend/in_memory.rs +++ b/src/backend/in_memory.rs @@ -240,6 +240,10 @@ impl RuntimeBackend for InMemoryBackend { } fn deposit(&mut self, target: H160, value: U256) { + if value == U256::zero() { + return; + } + self.current_layer_mut() .state .entry(target)