From bba378c2330f92ce8a3bde13bb08aea38bde27fb Mon Sep 17 00:00:00 2001 From: Gregory Edison Date: Tue, 19 Sep 2023 09:04:20 +0700 Subject: [PATCH] renaming --- crates/ef-testing/src/models/case.rs | 17 ++++++----------- crates/ef-testing/src/storage/eoa.rs | 4 ++-- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/crates/ef-testing/src/models/case.rs b/crates/ef-testing/src/models/case.rs index 277b5a98..4d651012 100644 --- a/crates/ef-testing/src/models/case.rs +++ b/crates/ef-testing/src/models/case.rs @@ -42,23 +42,18 @@ async fn handle_pre_state( ) -> Result<(), RunnerError> { let kakarot_address = kakarot.kakarot_address; - let mut starknet_state = env.sequencer().sequencer.backend.state.write().await; - let db = starknet_state + let mut starknet = env.sequencer().sequencer.backend.state.write().await; + let starknet_db = starknet .maybe_as_cached_db() .ok_or_else(|| RunnerError::Other("failed to get Katana database".to_string()))?; - let eoa_class_hash = get_eoa_class_hash(env, &db)?; + let eoa_class_hash = get_eoa_class_hash(env, &starknet_db)?; let class_hashes = ClassHashes::new( kakarot.proxy_class_hash, eoa_class_hash, kakarot.contract_account_class_hash, ); - write_test_state( - pre_state, - kakarot_address, - class_hashes, - &mut starknet_state, - )?; + write_test_state(pre_state, kakarot_address, class_hashes, &mut starknet)?; Ok(()) } @@ -178,10 +173,10 @@ impl BlockchainTestCase { let starknet_contract_address = StarknetContractAddress(Into::::into(starknet_address).try_into()?); - let db = starknet + let starknet_db = starknet .maybe_as_cached_db() .ok_or_else(|| RunnerError::Other("failed to get Katana database".to_string()))?; - let actual_state = db.storage.get(&starknet_contract_address); + let actual_state = starknet_db.storage.get(&starknet_contract_address); match actual_state { None => { // if no state, check post state is empty diff --git a/crates/ef-testing/src/storage/eoa.rs b/crates/ef-testing/src/storage/eoa.rs index dc02980f..384cfd20 100644 --- a/crates/ef-testing/src/storage/eoa.rs +++ b/crates/ef-testing/src/storage/eoa.rs @@ -15,7 +15,7 @@ use super::{ /// Returns the class hash used for the EOA contract. pub fn get_eoa_class_hash( ctx: &KakarotTestEnvironmentContext, - starknet: &AsCachedDb, + starknet_db: &AsCachedDb, ) -> Result { let eoa = &ctx.kakarot().eoa_addresses; @@ -23,7 +23,7 @@ pub fn get_eoa_class_hash( StarknetContractAddress(Into::::into(eoa.starknet_address).try_into()?); // deriving the eao class hash this way so things are always based off the katana dump file - let eoa_class_hash: FieldElement = (*starknet + let eoa_class_hash: FieldElement = (*starknet_db .storage .get(&eoa_address) .ok_or_else(|| {