@@ -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 > =
@@ -1487,33 +1486,12 @@ async fn test_new_class_flow(#[case] use_kzg_da: bool, #[case] n_blocks_in_multi
14871486 payload : L2ToL1Payload :: default ( ) ,
14881487 } ) ;
14891488
1490- // The OS is expected to write the (number -> hash) mapping of this block. Make sure the current
1491- // block number is greater than STORED_BLOCK_HASH_BUFFER.
1492- let old_block_number = current_block_number. 0 - STORED_BLOCK_HASH_BUFFER ;
1493- assert ! (
1494- old_block_number > 0 ,
1495- "Block number must be big enough to test a non-trivial block hash mapping update."
1496- ) ;
1497-
1498- // Add old block hashes to expected storage updates.
1499- let block_hash_contract_address = ContractAddress (
1500- PatriciaKey :: try_from ( Const :: BlockHashContractAddress . fetch_from_os_program ( ) . unwrap ( ) )
1501- . unwrap ( ) ,
1502- ) ;
1503- for block_number in current_block_number. 0
1504- ..( current_block_number. 0 + u64:: try_from ( n_blocks_in_multi_block) . unwrap ( ) )
1505- {
1506- let ( old_block_number, old_block_hash) =
1507- maybe_dummy_block_hash_and_number ( BlockNumber ( block_number) ) . unwrap ( ) ;
1508- update_expected_storage (
1509- & mut expected_storage_updates,
1510- block_hash_contract_address,
1511- Felt :: from ( old_block_number. 0 ) ,
1512- old_block_hash. 0 ,
1513- ) ;
1514- }
1515-
15161489 // Run the test.
1490+ update_expected_storage_updates_for_block_hash_contract (
1491+ & mut expected_storage_updates,
1492+ current_block_number,
1493+ n_blocks_in_multi_block,
1494+ ) ;
15171495 test_manager. divide_transactions_into_n_blocks ( n_blocks_in_multi_block) ;
15181496 let test_output = test_manager
15191497 . execute_test_with_default_block_contexts ( & TestParameters {
0 commit comments