From 2228e4deddf92d028661343e05c4af08285eda04 Mon Sep 17 00:00:00 2001 From: ChihChengLiang Date: Mon, 24 Jul 2023 16:45:30 +0200 Subject: [PATCH] rename mock_code_balance --- eth-types/src/geth_types.rs | 4 ++-- zkevm-circuits/src/evm_circuit/execution/callop.rs | 2 +- .../src/evm_circuit/execution/error_invalid_jump.rs | 2 +- zkevm-circuits/src/evm_circuit/execution/error_oog_call.rs | 2 +- .../src/evm_circuit/execution/error_oog_constant.rs | 2 +- zkevm-circuits/src/evm_circuit/execution/error_oog_log.rs | 2 +- zkevm-circuits/src/evm_circuit/execution/error_stack.rs | 2 +- .../src/evm_circuit/execution/error_write_protection.rs | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eth-types/src/geth_types.rs b/eth-types/src/geth_types.rs index e7d25696d1..66323c04d7 100644 --- a/eth-types/src/geth_types.rs +++ b/eth-types/src/geth_types.rs @@ -45,8 +45,8 @@ impl Account { && self.storage.is_empty() } - /// Generate an account that has either code or balance - pub fn mock_code_or_balance(code: Bytecode) -> Self { + /// Generate an account that is either empty or has code, balance, and non-zero nonce + pub fn mock_code_balance(code: Bytecode) -> Self { let is_empty = code.codesize() == 0; Self { address: Address::repeat_byte(0xff), diff --git a/zkevm-circuits/src/evm_circuit/execution/callop.rs b/zkevm-circuits/src/evm_circuit/execution/callop.rs index 24cbca9417..3258fe88fe 100644 --- a/zkevm-circuits/src/evm_circuit/execution/callop.rs +++ b/zkevm-circuits/src/evm_circuit/execution/callop.rs @@ -779,7 +779,7 @@ mod test { } fn callee(code: bytecode::Bytecode) -> Account { - Account::mock_code_or_balance(code) + Account::mock_code_balance(code) } fn caller(opcode: &OpcodeId, stack: Stack, caller_is_success: bool) -> Account { diff --git a/zkevm-circuits/src/evm_circuit/execution/error_invalid_jump.rs b/zkevm-circuits/src/evm_circuit/execution/error_invalid_jump.rs index 44c4b6759b..0d4eb1e9fd 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_invalid_jump.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_invalid_jump.rs @@ -240,7 +240,7 @@ mod test { } fn callee(code: Bytecode) -> Account { - Account::mock_code_or_balance(code) + Account::mock_code_balance(code) } // jump or jumpi error happen in internal call diff --git a/zkevm-circuits/src/evm_circuit/execution/error_oog_call.rs b/zkevm-circuits/src/evm_circuit/execution/error_oog_call.rs index 0044e4eb20..f2f884e293 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_oog_call.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_oog_call.rs @@ -273,7 +273,7 @@ mod test { } fn callee(code: Bytecode) -> Account { - Account::mock_code_or_balance(code) + Account::mock_code_balance(code) } fn test_oog(caller: &Account, callee: &Account, is_root: bool) { diff --git a/zkevm-circuits/src/evm_circuit/execution/error_oog_constant.rs b/zkevm-circuits/src/evm_circuit/execution/error_oog_constant.rs index d367a2c39e..01e12c3a00 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_oog_constant.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_oog_constant.rs @@ -238,7 +238,7 @@ mod test { } fn callee(code: Bytecode) -> Account { - Account::mock_code_or_balance(code) + Account::mock_code_balance(code) } #[test] diff --git a/zkevm-circuits/src/evm_circuit/execution/error_oog_log.rs b/zkevm-circuits/src/evm_circuit/execution/error_oog_log.rs index 4af29dbef0..dd4ef88ad0 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_oog_log.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_oog_log.rs @@ -279,7 +279,7 @@ mod test { } fn callee(code: Bytecode) -> Account { - Account::mock_code_or_balance(code) + Account::mock_code_balance(code) } #[test] diff --git a/zkevm-circuits/src/evm_circuit/execution/error_stack.rs b/zkevm-circuits/src/evm_circuit/execution/error_stack.rs index dfc9a537b0..60235e8fce 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_stack.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_stack.rs @@ -211,7 +211,7 @@ mod test { } fn callee(code: Bytecode) -> Account { - Account::mock_code_or_balance(code) + Account::mock_code_balance(code) } // internal call error test diff --git a/zkevm-circuits/src/evm_circuit/execution/error_write_protection.rs b/zkevm-circuits/src/evm_circuit/execution/error_write_protection.rs index e83986e7b3..6182e413d5 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_write_protection.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_write_protection.rs @@ -149,7 +149,7 @@ mod test { use mock::TestContext; fn callee(code: Bytecode) -> Account { - Account::mock_code_or_balance(code) + Account::mock_code_balance(code) } #[test]