Skip to content

Commit 4da0544

Browse files
starknet_os_flow_tests: remove unnecessary impl of FlowTestState (#11429)
1 parent e0ce76c commit 4da0544

File tree

4 files changed

+7
-16
lines changed

4 files changed

+7
-16
lines changed

crates/starknet_os_flow_tests/src/initial_state.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::collections::{BTreeMap, HashMap, HashSet};
22

33
use blockifier::context::BlockContext;
4+
use blockifier::state::state_api::UpdatableState;
45
use blockifier::transaction::transaction_execution::Transaction;
56
use blockifier_test_utils::cairo_versions::{CairoVersion, RunnableCairo1};
67
use blockifier_test_utils::calldata::create_calldata;
@@ -35,7 +36,6 @@ use starknet_committer::db::facts_db::db::FactsDb;
3536
use starknet_patricia_storage::map_storage::MapStorage;
3637
use starknet_types_core::felt::Felt;
3738

38-
use crate::state_trait::FlowTestState;
3939
use crate::test_manager::{
4040
block_context_for_flow_tests,
4141
EXPECTED_STRK_FEE_TOKEN_ADDRESS,
@@ -58,6 +58,10 @@ const STRK_TOKEN_NAME: &[u8] = b"StarkNet Token";
5858
const STRK_SYMBOL: &[u8] = b"STRK";
5959
const STRK_DECIMALS: u8 = 18;
6060

61+
/// Trait alias for state readers used in flow tests.
62+
pub(crate) trait FlowTestState: Default + UpdatableState + Send {}
63+
impl<S: Default + UpdatableState + Send> FlowTestState for S {}
64+
6165
/// Gathers the information needed to execute a flow test.
6266
pub(crate) struct InitialStateData<S: FlowTestState> {
6367
pub(crate) initial_state: InitialState<S>,
@@ -140,7 +144,7 @@ pub(crate) async fn create_default_initial_state_data<S: FlowTestState, const N:
140144
extra_contracts_addresses,
141145
) = create_default_initial_state_txs_and_contracts(extra_contracts);
142146
// Execute these 4 txs.
143-
let initial_state_reader = S::create_empty_state();
147+
let initial_state_reader = S::default();
144148
let initial_block_number = BlockNumber(CURRENT_BLOCK_NUMBER);
145149
let use_kzg_da = false;
146150
let block_context = block_context_for_flow_tests(initial_block_number, use_kzg_da);

crates/starknet_os_flow_tests/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
pub(crate) mod initial_state;
44
pub(crate) mod special_contracts;
5-
pub(crate) mod state_trait;
65
pub(crate) mod test_manager;
76
pub(crate) mod tests;
87
pub(crate) mod utils;

crates/starknet_os_flow_tests/src/state_trait.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

crates/starknet_os_flow_tests/src/test_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ use starknet_types_core::felt::Felt;
7979
use crate::initial_state::{
8080
create_default_initial_state_data,
8181
get_initial_deploy_account_tx,
82+
FlowTestState,
8283
InitialState,
8384
InitialStateData,
8485
OsExecutionContracts,
8586
};
86-
use crate::state_trait::FlowTestState;
8787
use crate::tests::NON_TRIVIAL_RESOURCE_BOUNDS;
8888
use crate::utils::{
8989
commit_state_diff,

0 commit comments

Comments
 (0)