@@ -21,7 +21,6 @@ use starknet_api::core::{
2121 ContractAddress ,
2222 EthAddress ,
2323 Nonce ,
24- PatriciaKey ,
2524} ;
2625use starknet_api:: executable_transaction:: {
2726 DeclareTransaction ,
@@ -76,7 +75,6 @@ use starknet_committer::patricia_merkle_tree::types::CompiledClassHash;
7675use starknet_core:: crypto:: ecdsa_sign;
7776use starknet_crypto:: { get_public_key, Signature } ;
7877use starknet_os:: hints:: hint_implementation:: deprecated_compiled_class:: class_hash:: compute_deprecated_class_hash;
79- use starknet_os:: hints:: vars:: Const ;
8078use starknet_os:: io:: os_output:: MessageToL2 ;
8179use starknet_types_core:: felt:: Felt ;
8280use starknet_types_core:: hash:: { Pedersen , StarkHash } ;
@@ -98,6 +96,7 @@ use crate::utils::{
9896 get_class_info_of_feature_contract,
9997 maybe_dummy_block_hash_and_number,
10098 update_expected_storage,
99+ update_expected_storage_updates_for_block_hash_contract,
101100} ;
102101
103102pub ( crate ) static NON_TRIVIAL_RESOURCE_BOUNDS : LazyLock < ValidResourceBounds > =
@@ -1490,33 +1489,12 @@ async fn test_new_class_flow(#[case] use_kzg_da: bool, #[case] n_blocks_in_multi
14901489 payload : L2ToL1Payload :: default ( ) ,
14911490 } ) ;
14921491
1493- // The OS is expected to write the (number -> hash) mapping of this block. Make sure the current
1494- // block number is greater than STORED_BLOCK_HASH_BUFFER.
1495- let old_block_number = current_block_number. 0 - STORED_BLOCK_HASH_BUFFER ;
1496- assert ! (
1497- old_block_number > 0 ,
1498- "Block number must be big enough to test a non-trivial block hash mapping update."
1499- ) ;
1500-
1501- // Add old block hashes to expected storage updates.
1502- let block_hash_contract_address = ContractAddress (
1503- PatriciaKey :: try_from ( Const :: BlockHashContractAddress . fetch_from_os_program ( ) . unwrap ( ) )
1504- . unwrap ( ) ,
1505- ) ;
1506- for block_number in current_block_number. 0
1507- ..( current_block_number. 0 + u64:: try_from ( n_blocks_in_multi_block) . unwrap ( ) )
1508- {
1509- let ( old_block_number, old_block_hash) =
1510- maybe_dummy_block_hash_and_number ( BlockNumber ( block_number) ) . unwrap ( ) ;
1511- update_expected_storage (
1512- & mut expected_storage_updates,
1513- block_hash_contract_address,
1514- Felt :: from ( old_block_number. 0 ) ,
1515- old_block_hash. 0 ,
1516- ) ;
1517- }
1518-
15191492 // Run the test.
1493+ update_expected_storage_updates_for_block_hash_contract (
1494+ & mut expected_storage_updates,
1495+ current_block_number,
1496+ n_blocks_in_multi_block,
1497+ ) ;
15201498 test_manager. divide_transactions_into_n_blocks ( n_blocks_in_multi_block) ;
15211499 let test_output = test_manager
15221500 . execute_test_with_default_block_contexts ( & TestParameters {
0 commit comments