Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Commit 30027c7

Browse files
committed
apply pr suggestions
1 parent 931e211 commit 30027c7

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

crates/ef-testing/src/evm_sequencer/account/mod.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use reth_primitives::{Address, U256};
55
use starknet::core::utils::cairo_short_string_to_felt;
66
use starknet_api::{core::Nonce, state::StorageKey};
77
use starknet_crypto::{poseidon_permute_comp, Felt};
8-
98
use crate::evm_sequencer::constants::storage_variables::{
109
ACCOUNT_BYTECODE_LEN, ACCOUNT_CODE_HASH, ACCOUNT_EVM_ADDRESS, ACCOUNT_IS_INITIALIZED,
1110
ACCOUNT_NONCE, ACCOUNT_STORAGE, ACCOUNT_VALID_JUMPDESTS,
@@ -90,11 +89,9 @@ impl KakarotAccount {
9089
starknet_storage!(ACCOUNT_EVM_ADDRESS, evm_address),
9190
starknet_storage!(ACCOUNT_IS_INITIALIZED, 1u8),
9291
starknet_storage!(ACCOUNT_BYTECODE_LEN, code.len() as u32),
92+
starknet_storage!(ACCOUNT_NONCE, nonce),
9393
];
9494

95-
// Write the nonce of the account is written to storage after each tx.
96-
storage.append(&mut vec![starknet_storage!(ACCOUNT_NONCE, nonce)]);
97-
9895
// Initialize the bytecode storage var.
9996
let mut bytecode_storage = pack_byte_array_to_starkfelt_array(code)
10097
.enumerate()
@@ -104,9 +101,9 @@ impl KakarotAccount {
104101

105102
// Initialize the code hash var
106103
let account_is_empty =
107-
code.is_empty() && nonce == Felt::from(0) && balance == U256::from(0);
104+
code.is_empty() && nonce == Felt::ZERO && balance == U256::ZERO;
108105
let code_hash = if account_is_empty {
109-
U256::from(0)
106+
U256::ZERO
110107
} else if code.is_empty() {
111108
U256::from_be_slice(KECCAK_EMPTY.as_slice())
112109
} else {

crates/ef-testing/src/evm_sequencer/evm_state/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ mod tests {
393393
let signature =
394394
sign_message(*PRIVATE_KEY, transaction.transaction.signature_hash()).unwrap();
395395
transaction.signature = signature;
396-
let eoa_nonce = U256::from(0);
396+
let eoa_nonce = U256::ZERO;
397397
let contract_bytecode = Bytes::from(vec![96, 1, 96, 0, 85]); // PUSH 01 PUSH 00 SSTORE
398398
let contract_nonce = U256::from(1);
399399

crates/ef-testing/src/evm_sequencer/sequencer/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ use crate::evm_sequencer::constants::{
4343
storage_variables::KAKAROT_CAIRO1_HELPERS_CLASS_HASH, CAIRO1_HELPERS_CLASS,
4444
CAIRO1_HELPERS_CLASS_HASH,
4545
};
46-
4746
use blockifier::abi::abi_utils::get_storage_var_address;
4847
#[allow(unused_imports)]
4948
use blockifier::state::state_api::{

0 commit comments

Comments
 (0)