@@ -604,6 +604,32 @@ fn test_invoke_tx(
604604) {
605605 let block_context = & BlockContext :: create_for_account_testing_with_kzg ( use_kzg_da) ;
606606 let versioned_constants = & block_context. versioned_constants ;
607+
608+ // Adjust resource bounds for client-side proving transactions.
609+ let resource_bounds = if proof_facts. is_empty ( ) {
610+ resource_bounds
611+ } else {
612+ match resource_bounds {
613+ ValidResourceBounds :: AllResources ( all_bounds) => {
614+ // For client-side proving transactions, reserve extra L2 gas for the fixed proof
615+ // cost.
616+ let proof_gas_cost: u64 =
617+ versioned_constants. archival_data_gas_costs . gas_per_proof . to_integer ( ) ;
618+
619+ ValidResourceBounds :: AllResources ( AllResourceBounds {
620+ l2_gas : ResourceBounds {
621+ max_amount : GasAmount ( all_bounds. l2_gas . max_amount . 0 + proof_gas_cost) ,
622+ ..all_bounds. l2_gas
623+ } ,
624+ ..all_bounds
625+ } )
626+ }
627+ // Skip impossible combination: proof_facts only exist in V3 transactions,
628+ // and V3 uses AllResourceBounds (L1Gas is legacy-only).
629+ ValidResourceBounds :: L1Gas ( _) => return ,
630+ }
631+ } ;
632+
607633 let account_contract = FeatureContract :: AccountWithoutValidations ( account_cairo_version) ;
608634 let test_contract = FeatureContract :: TestContract ( CairoVersion :: Cairo0 ) ;
609635 let chain_info = & block_context. chain_info ;
@@ -623,6 +649,7 @@ fn test_invoke_tx(
623649 // transaction.
624650 let calldata_length = invoke_tx. calldata_length ( ) ;
625651 let signature_length = invoke_tx. signature_length ( ) ;
652+ let proof_facts_length = invoke_tx. proof_facts_length ( ) ;
626653 let state_changes_for_fee = StateChangesCount {
627654 n_storage_updates : 1 ,
628655 n_modified_contracts : 1 ,
@@ -635,8 +662,7 @@ fn test_invoke_tx(
635662 StateResources :: new_for_testing ( state_changes_for_fee, 0 ) ,
636663 None ,
637664 ExecutionSummary :: default ( ) ,
638- // TODO(AvivG): Test non-zero proof facts length after invoke_tx supports retrieving it.
639- 0 ,
665+ proof_facts_length,
640666 ) ;
641667 let sender_address = invoke_tx. sender_address ( ) ;
642668
0 commit comments