@@ -453,13 +453,15 @@ impl AccountTransaction {
453
453
) )
454
454
}
455
455
456
+ #[ allow( clippy:: too_many_arguments) ]
456
457
fn run_revertible < S : StateReader > (
457
458
& self ,
458
459
state : & mut TransactionalState < ' _ , S > ,
459
460
resources : & mut ExecutionResources ,
460
461
remaining_gas : & mut u64 ,
461
462
block_context : & BlockContext ,
462
463
mut execution_context : EntryPointExecutionContext ,
464
+ charge_fee : bool ,
463
465
validate : bool ,
464
466
) -> TransactionExecutionResult < ValidateExecuteCallInfo > {
465
467
let account_tx_context = self . get_account_transaction_context ( ) ;
@@ -543,7 +545,7 @@ impl AccountTransaction {
543
545
!Self :: is_sufficient_fee_balance ( balance_low, balance_high, actual_fee) ;
544
546
let max_fee = account_tx_context. max_fee ;
545
547
546
- if actual_fee > max_fee || is_maxed_out {
548
+ if charge_fee && ( actual_fee > max_fee || is_maxed_out) {
547
549
// Insufficient fee. Revert the execution and charge what is available.
548
550
let ( final_fee, revert_error) = if actual_fee > max_fee {
549
551
(
@@ -644,6 +646,7 @@ impl AccountTransaction {
644
646
resources : & mut ExecutionResources ,
645
647
remaining_gas : & mut u64 ,
646
648
block_context : & BlockContext ,
649
+ charge_fee : bool ,
647
650
validate : bool ,
648
651
) -> TransactionExecutionResult < ValidateExecuteCallInfo > {
649
652
let account_tx_context = self . get_account_transaction_context ( ) ;
@@ -672,6 +675,7 @@ impl AccountTransaction {
672
675
remaining_gas,
673
676
block_context,
674
677
execution_context,
678
+ charge_fee,
675
679
validate,
676
680
)
677
681
}
@@ -741,8 +745,14 @@ impl<S: StateReader> ExecutableTransaction<S> for AccountTransaction {
741
745
revert_error,
742
746
final_fee,
743
747
final_resources,
744
- } =
745
- self . run_or_revert ( state, & mut resources, & mut remaining_gas, block_context, validate) ?;
748
+ } = self . run_or_revert (
749
+ state,
750
+ & mut resources,
751
+ & mut remaining_gas,
752
+ block_context,
753
+ charge_fee,
754
+ validate,
755
+ ) ?;
746
756
747
757
let fee_transfer_call_info =
748
758
self . handle_fee ( state, block_context, final_fee, charge_fee) ?;
0 commit comments