@@ -8,7 +8,7 @@ use starknet_api::test_utils::declare::executable_declare_tx;
8
8
use starknet_api:: test_utils:: { NonceManager , TEST_ERC20_CONTRACT_ADDRESS2 } ;
9
9
use starknet_api:: transaction:: constants:: DEPLOY_CONTRACT_FUNCTION_ENTRY_POINT_NAME ;
10
10
use starknet_api:: transaction:: fields:: { ContractAddressSalt , Fee , ValidResourceBounds } ;
11
- use starknet_api:: transaction:: TransactionVersion ;
11
+ use starknet_api:: transaction:: { TransactionHash , TransactionVersion } ;
12
12
use starknet_api:: { contract_address, declare_tx_args, felt, invoke_tx_args, nonce, storage_key} ;
13
13
use starknet_types_core:: felt:: Felt ;
14
14
@@ -100,7 +100,8 @@ pub fn test_commit_tx() {
100
100
]
101
101
. into_iter ( )
102
102
. map ( Transaction :: Account )
103
- . collect :: < Vec < Transaction > > ( ) ;
103
+ . map ( |tx| ( TransactionHash :: default ( ) , tx) )
104
+ . collect :: < Vec < ( TransactionHash , Transaction ) > > ( ) ;
104
105
let mut bouncer = Bouncer :: new ( block_context. bouncer_config . clone ( ) ) ;
105
106
let cached_state =
106
107
test_state ( & block_context. chain_info , BALANCE , & [ ( account, 1 ) , ( test_contract, 1 ) ] ) ;
@@ -169,7 +170,7 @@ pub fn test_commit_tx() {
169
170
assert_eq ! ( felt!( expected_sequencer_storage_read) , actual_sequencer_storage_read, ) ;
170
171
}
171
172
}
172
- let tx_context = executor. block_context . to_tx_context ( & txs[ commit_idx] ) ;
173
+ let tx_context = executor. block_context . to_tx_context ( & txs[ commit_idx] . 1 ) ;
173
174
expected_sequencer_balance_low += actual_fee;
174
175
// Check that the sequencer balance was updated correctly in the state.
175
176
verify_sequencer_balance_update (
@@ -196,11 +197,11 @@ fn test_commit_tx_when_sender_is_sequencer() {
196
197
let ( sequencer_balance_key_low, sequencer_balance_key_high) =
197
198
get_sequencer_balance_keys ( & block_context) ;
198
199
199
- let sequencer_tx = [ Transaction :: Account ( trivial_calldata_invoke_tx (
200
+ let sequencer_tx = [ ( TransactionHash :: default ( ) , Transaction :: Account ( trivial_calldata_invoke_tx (
200
201
account_address,
201
202
test_contract_address,
202
203
nonce ! ( 0_u8 ) ,
203
- ) ) ] ;
204
+ ) ) ) ] ;
204
205
205
206
let mut bouncer = Bouncer :: new ( block_context. bouncer_config . clone ( ) ) ;
206
207
@@ -224,7 +225,7 @@ fn test_commit_tx_when_sender_is_sequencer() {
224
225
let read_values_before_commit = fee_transfer_call_info. storage_read_values . clone ( ) ;
225
226
drop ( execution_task_outputs) ;
226
227
227
- let tx_context = & executor. block_context . to_tx_context ( & sequencer_tx[ 0 ] ) ;
228
+ let tx_context = & executor. block_context . to_tx_context ( & sequencer_tx[ 0 ] . 1 ) ;
228
229
let fee_token_address =
229
230
executor. block_context . chain_info . fee_token_address ( & tx_context. tx_info . fee_type ( ) ) ;
230
231
let sequencer_balance_high_before =
@@ -310,8 +311,8 @@ fn test_worker_execute(default_all_resource_bounds: ValidResourceBounds) {
310
311
311
312
let txs = [ tx_success, tx_failure, tx_revert]
312
313
. into_iter ( )
313
- . map ( Transaction :: Account )
314
- . collect :: < Vec < Transaction > > ( ) ;
314
+ . map ( |tx| ( TransactionHash :: default ( ) , tx . into ( ) ) )
315
+ . collect :: < Vec < ( TransactionHash , Transaction ) > > ( ) ;
315
316
316
317
let mut bouncer = Bouncer :: new ( block_context. bouncer_config . clone ( ) ) ;
317
318
let worker_executor = WorkerExecutor :: new (
@@ -470,9 +471,8 @@ fn test_worker_validate(default_all_resource_bounds: ValidResourceBounds) {
470
471
471
472
let txs = [ account_tx0, account_tx1]
472
473
. into_iter ( )
473
- . map ( Transaction :: Account )
474
- . collect :: < Vec < Transaction > > ( ) ;
475
-
474
+ . map ( |tx| ( TransactionHash :: default ( ) , tx. into ( ) ) )
475
+ . collect :: < Vec < ( TransactionHash , Transaction ) > > ( ) ;
476
476
let mut bouncer = Bouncer :: new ( block_context. bouncer_config . clone ( ) ) ;
477
477
let worker_executor = WorkerExecutor :: new (
478
478
safe_versioned_state. clone ( ) ,
@@ -583,7 +583,7 @@ fn test_deploy_before_declare(
583
583
} ) ;
584
584
585
585
let txs =
586
- [ declare_tx, invoke_tx] . into_iter ( ) . map ( Transaction :: Account ) . collect :: < Vec < Transaction > > ( ) ;
586
+ [ declare_tx, invoke_tx] . into_iter ( ) . map ( Transaction :: Account ) . map ( |tx| ( TransactionHash :: default ( ) , tx ) ) . collect :: < Vec < ( TransactionHash , Transaction ) > > ( ) ;
587
587
588
588
let mut bouncer = Bouncer :: new ( block_context. bouncer_config . clone ( ) ) ;
589
589
let worker_executor =
@@ -656,7 +656,8 @@ fn test_worker_commit_phase(default_all_resource_bounds: ValidResourceBounds) {
656
656
nonce: nonce_manager. next( sender_address)
657
657
} ) )
658
658
} )
659
- . collect :: < Vec < Transaction > > ( ) ;
659
+ . map ( |tx| ( TransactionHash :: default ( ) , tx) )
660
+ . collect :: < Vec < ( TransactionHash , Transaction ) > > ( ) ;
660
661
661
662
let mut bouncer = Bouncer :: new ( block_context. bouncer_config . clone ( ) ) ;
662
663
let worker_executor =
@@ -747,7 +748,8 @@ fn test_worker_commit_phase_with_halt() {
747
748
nonce_manager. next ( sender_address) ,
748
749
) )
749
750
} )
750
- . collect :: < Vec < Transaction > > ( ) ;
751
+ . map ( |tx| ( TransactionHash :: default ( ) , tx) )
752
+ . collect :: < Vec < ( TransactionHash , Transaction ) > > ( ) ;
751
753
752
754
let mut bouncer = Bouncer :: new ( block_context. bouncer_config . clone ( ) ) ;
753
755
let worker_executor =
0 commit comments