@@ -53,6 +53,7 @@ use starknet_api::executable_transaction::AccountTransaction;
5353use starknet_api:: rpc_transaction:: {
5454 InternalRpcTransaction ,
5555 RpcDeclareTransaction ,
56+ RpcInvokeTransaction ,
5657 RpcTransaction ,
5758 RpcTransactionLabelValue ,
5859} ;
@@ -278,7 +279,17 @@ async fn setup_mock_state(
278279) {
279280 let input_tx = tx_args. get_rpc_tx ( ) ;
280281 let expected_internal_tx = tx_args. get_internal_tx ( ) ;
281-
282+ if let RpcTransaction :: Invoke ( RpcInvokeTransaction :: V3 ( ref v3_tx) ) = input_tx {
283+ if !v3_tx. proof_facts . is_empty ( ) {
284+ let proof_facts_hash = v3_tx. proof_facts . hash ( ) ;
285+ mock_dependencies
286+ . mock_proof_manager_client
287+ . expect_set_proof ( )
288+ . once ( )
289+ . with ( eq ( proof_facts_hash) , eq ( v3_tx. proof . clone ( ) ) )
290+ . return_once ( |_, _| Ok ( ( ) ) ) ;
291+ }
292+ }
282293 setup_transaction_converter_mock ( & mut mock_dependencies. mock_transaction_converter , tx_args) ;
283294
284295 let address = expected_internal_tx. contract_address ( ) ;
@@ -570,6 +581,18 @@ async fn add_tx_returns_error_when_extract_state_nonce_and_run_validations_fails
570581 . return_once ( || Ok ( Box :: new ( mock_stateful_transaction_validator) ) ) ;
571582
572583 let tx_args = invoke_args ( ) ;
584+ let input_tx = tx_args. get_rpc_tx ( ) ;
585+ if let RpcTransaction :: Invoke ( RpcInvokeTransaction :: V3 ( ref v3_tx) ) = input_tx {
586+ if !v3_tx. proof_facts . is_empty ( ) {
587+ let proof_facts_hash = v3_tx. proof_facts . hash ( ) ;
588+ mock_dependencies
589+ . mock_proof_manager_client
590+ . expect_set_proof ( )
591+ . once ( )
592+ . with ( eq ( proof_facts_hash) , eq ( v3_tx. proof . clone ( ) ) )
593+ . return_once ( |_, _| Ok ( ( ) ) ) ;
594+ }
595+ }
573596 setup_transaction_converter_mock ( & mut mock_dependencies. mock_transaction_converter , & tx_args) ;
574597 let gateway = Gateway {
575598 config : Arc :: new ( mock_dependencies. config ) ,
@@ -580,7 +603,7 @@ async fn add_tx_returns_error_when_extract_state_nonce_and_run_validations_fails
580603 proof_manager_client : Arc :: new ( mock_dependencies. mock_proof_manager_client ) ,
581604 } ;
582605
583- let result = gateway. add_tx ( tx_args . get_rpc_tx ( ) , None ) . await ;
606+ let result = gateway. add_tx ( input_tx , None ) . await ;
584607
585608 assert ! ( result. is_err( ) ) ;
586609 assert_eq ! ( result. unwrap_err( ) . code, error_code) ;
@@ -600,6 +623,7 @@ async fn stateless_transaction_validator_error(mut mock_dependencies: MockDepend
600623 . expect_validate ( )
601624 . return_once ( |_| arbitrary_validation_error) ;
602625 mock_dependencies. mock_stateless_transaction_validator = mock_stateless_transaction_validator;
626+
603627 let gateway = mock_dependencies. gateway ( ) ;
604628 let result = gateway. add_tx ( invoke_args ( ) . get_rpc_tx ( ) , None ) . await ;
605629
@@ -623,6 +647,18 @@ async fn add_tx_returns_error_when_instantiating_validator_fails(
623647 . return_once ( || Err ( expected_error) ) ;
624648
625649 let tx_args = invoke_args ( ) ;
650+ let input_tx = tx_args. get_rpc_tx ( ) ;
651+ if let RpcTransaction :: Invoke ( RpcInvokeTransaction :: V3 ( ref v3_tx) ) = input_tx {
652+ if !v3_tx. proof_facts . is_empty ( ) {
653+ let proof_facts_hash = v3_tx. proof_facts . hash ( ) ;
654+ mock_dependencies
655+ . mock_proof_manager_client
656+ . expect_set_proof ( )
657+ . once ( )
658+ . with ( eq ( proof_facts_hash) , eq ( v3_tx. proof . clone ( ) ) )
659+ . return_once ( |_, _| Ok ( ( ) ) ) ;
660+ }
661+ }
626662 setup_transaction_converter_mock ( & mut mock_dependencies. mock_transaction_converter , & tx_args) ;
627663 let gateway = Gateway {
628664 config : Arc :: new ( mock_dependencies. config ) ,
@@ -633,7 +669,7 @@ async fn add_tx_returns_error_when_instantiating_validator_fails(
633669 proof_manager_client : Arc :: new ( mock_dependencies. mock_proof_manager_client ) ,
634670 } ;
635671
636- let result = gateway. add_tx ( tx_args . get_rpc_tx ( ) , None ) . await ;
672+ let result = gateway. add_tx ( input_tx , None ) . await ;
637673
638674 assert ! ( result. is_err( ) ) ;
639675 assert_eq ! ( result. unwrap_err( ) . code, error_code) ;
0 commit comments