Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
rename mock_code_balance
Browse files Browse the repository at this point in the history
  • Loading branch information
ChihChengLiang committed Jul 24, 2023
1 parent 3abae63 commit 2228e4d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions eth-types/src/geth_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/callop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/error_oog_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ mod test {
}

fn callee(code: Bytecode) -> Account {
Account::mock_code_or_balance(code)
Account::mock_code_balance(code)
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/error_oog_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ mod test {
}

fn callee(code: Bytecode) -> Account {
Account::mock_code_or_balance(code)
Account::mock_code_balance(code)
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/error_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 2228e4d

Please sign in to comment.