Skip to content

Commit

Permalink
chore(blockifier): cleanup use of enforce_fee() by AccountTransaction (
Browse files Browse the repository at this point in the history
  • Loading branch information
avivg-starkware authored Nov 17, 2024
1 parent a5e2fce commit 913d374
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions crates/blockifier/src/blockifier/stateful_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use crate::state::errors::StateError;
use crate::state::state_api::StateReader;
use crate::transaction::account_transaction::AccountTransaction;
use crate::transaction::errors::{TransactionExecutionError, TransactionPreValidationError};
use crate::transaction::objects::TransactionInfoCreator;
use crate::transaction::transaction_execution::Transaction;
use crate::transaction::transactions::ValidatableTransaction;

Expand Down Expand Up @@ -115,7 +114,7 @@ impl<S: StateReader> StatefulValidator<S> {
let mut execution_resources = ExecutionResources::default();
let tx_context = Arc::new(self.tx_executor.block_context.to_tx_context(tx));

let limit_steps_by_resources = tx.create_tx_info().enforce_fee();
let limit_steps_by_resources = tx.enforce_fee();
let validate_call_info = tx.validate_tx(
self.tx_executor.block_state.as_mut().expect(BLOCK_STATE_ACCESS_ERR),
&mut execution_resources,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ fn test_fee_enforcement(
&mut NonceManager::default(),
);

let enforce_fee = deploy_account_tx.create_tx_info().enforce_fee();
let enforce_fee = deploy_account_tx.enforce_fee();
assert_ne!(zero_bounds, enforce_fee);
let result = deploy_account_tx.execute(state, &block_context, enforce_fee, true);
// Execution should fail if the fee is enforced because the account doesn't have sufficient
Expand All @@ -238,7 +238,7 @@ fn test_all_bounds_combinations_enforce_fee(
DEFAULT_STRK_L1_DATA_GAS_PRICE.into(),
),
});
assert_eq!(account_tx.create_tx_info().enforce_fee(), expected_enforce_fee);
assert_eq!(account_tx.enforce_fee(), expected_enforce_fee);
}

#[rstest]
Expand Down

0 comments on commit 913d374

Please sign in to comment.