Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(blockifier): cleanup use of enforce_fee() by AccountTransaction #2100

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading