@@ -45,6 +45,9 @@ use starknet_api::transaction::fields::{
4545 VIRTUAL_SNOS ,
4646} ;
4747use starknet_api:: transaction:: TransactionHash ;
48+ #[ cfg( feature = "os_input" ) ]
49+ use starknet_api:: { contract_address, felt, nonce, proof_facts, storage_key, tx_hash} ;
50+ #[ cfg( not( feature = "os_input" ) ) ]
4851use starknet_api:: { proof_facts, tx_hash} ;
4952use starknet_types_core:: felt:: Felt ;
5053use tokio:: sync:: mpsc:: { UnboundedReceiver , UnboundedSender } ;
@@ -100,6 +103,8 @@ async fn block_execution_artifacts(
100103 let block_summary = BlockExecutionSummary {
101104 state_diff : Default :: default ( ) ,
102105 compressed_state_diff : Default :: default ( ) ,
106+ #[ cfg( feature = "os_input" ) ]
107+ initial_reads : test_initial_reads ( ) ,
103108 bouncer_weights : BouncerWeights { l1_gas : 100 , ..BouncerWeights :: empty ( ) } ,
104109 casm_hash_computation_data_sierra_gas : CasmHashComputationData :: default ( ) ,
105110 casm_hash_computation_data_proving_gas : CasmHashComputationData :: default ( ) ,
@@ -135,6 +140,14 @@ fn execution_info() -> TransactionExecutionInfo {
135140 }
136141}
137142
143+ #[ cfg( feature = "os_input" ) ]
144+ fn test_initial_reads ( ) -> StateMaps {
145+ let mut initial_reads = StateMaps :: default ( ) ;
146+ initial_reads. nonces . insert ( contract_address ! ( "0x1" ) , nonce ! ( 7_u64 ) ) ;
147+ initial_reads. storage . insert ( ( contract_address ! ( "0x1" ) , storage_key ! ( "0x2" ) ) , felt ! ( 8_u8 ) ) ;
148+ initial_reads
149+ }
150+
138151async fn one_chunk_test_expectations ( ) -> TestExpectations {
139152 let input_txs = test_txs ( 0 ..3 ) ;
140153 let block_size = input_txs. len ( ) ;
@@ -445,6 +458,8 @@ async fn transaction_failed_test_expectations() -> TestExpectations {
445458 Ok ( BlockExecutionSummary {
446459 state_diff : expected_block_artifacts_copy. commitment_state_diff ,
447460 compressed_state_diff : None ,
461+ #[ cfg( feature = "os_input" ) ]
462+ initial_reads : test_initial_reads ( ) ,
448463 bouncer_weights : expected_block_artifacts_copy. bouncer_weights ,
449464 casm_hash_computation_data_sierra_gas : expected_block_artifacts_copy
450465 . casm_hash_computation_data_sierra_gas ,
@@ -543,6 +558,8 @@ async fn set_close_block_expectations(
543558 Ok ( BlockExecutionSummary {
544559 state_diff : output_block_artifacts. commitment_state_diff ,
545560 compressed_state_diff : None ,
561+ #[ cfg( feature = "os_input" ) ]
562+ initial_reads : test_initial_reads ( ) ,
546563 bouncer_weights : output_block_artifacts. bouncer_weights ,
547564 casm_hash_computation_data_sierra_gas : output_block_artifacts
548565 . casm_hash_computation_data_sierra_gas ,
@@ -1080,6 +1097,8 @@ async fn failed_l1_handler_transaction_consumed() {
10801097 Ok ( BlockExecutionSummary {
10811098 state_diff : Default :: default ( ) ,
10821099 compressed_state_diff : None ,
1100+ #[ cfg( feature = "os_input" ) ]
1101+ initial_reads : test_initial_reads ( ) ,
10831102 bouncer_weights : BouncerWeights :: empty ( ) ,
10841103 casm_hash_computation_data_sierra_gas : CasmHashComputationData :: default ( ) ,
10851104 casm_hash_computation_data_proving_gas : CasmHashComputationData :: default ( ) ,
@@ -1141,6 +1160,8 @@ async fn partial_chunk_execution_proposer() {
11411160 Ok ( BlockExecutionSummary {
11421161 state_diff : expected_block_artifacts. commitment_state_diff ,
11431162 compressed_state_diff : None ,
1163+ #[ cfg( feature = "os_input" ) ]
1164+ initial_reads : test_initial_reads ( ) ,
11441165 bouncer_weights : expected_block_artifacts. bouncer_weights ,
11451166 casm_hash_computation_data_sierra_gas : expected_block_artifacts
11461167 . casm_hash_computation_data_sierra_gas ,
0 commit comments