Skip to content

Commit

Permalink
chore(blockifier): remover only_qury from IvokeTxArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
avivg-starkware committed Dec 3, 2024
1 parent b79941b commit 6980513
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ fn test_account_flow_test(
version: tx_version,
resource_bounds,
nonce: nonce_manager.next(account_address),
only_query,
},
)
.unwrap();
Expand Down
8 changes: 0 additions & 8 deletions crates/blockifier/src/transaction/execution_flavors_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ fn get_pre_validate_test_args(
sender_address: account_address,
calldata: create_trivial_calldata(test_contract_address),
version,
only_query,
};
(block_context, state, pre_validation_base_args, nonce_manager)
}
Expand Down Expand Up @@ -596,14 +595,12 @@ fn test_simulate_validate_charge_fee_mid_execution(
resource_bounds: default_l1_resource_bounds,
sender_address: account_address,
version,
only_query,
};

// First scenario: logic error. Should result in revert; actual fee should be shown.
let tx = invoke_tx(invoke_tx_args! {
calldata: recurse_calldata(test_contract_address, true, 3),
nonce: nonce_manager.next(account_address),
only_query,
..execution_base_args.clone()
});
let account_tx = AccountTransaction {
Expand Down Expand Up @@ -655,8 +652,6 @@ fn test_simulate_validate_charge_fee_mid_execution(
resource_bounds: l1_resource_bounds(gas_bound, gas_price.into()),
calldata: recurse_calldata(test_contract_address, false, 1000),
nonce: nonce_manager.next(account_address),
only_query,

..execution_base_args.clone()
});
let account_tx = AccountTransaction {
Expand Down Expand Up @@ -804,7 +799,6 @@ fn test_simulate_validate_charge_fee_post_execution(
nonce: nonce_manager.next(account_address),
sender_address: account_address,
version,
only_query,
});
let account_tx = AccountTransaction {
tx,
Expand Down Expand Up @@ -867,8 +861,6 @@ fn test_simulate_validate_charge_fee_post_execution(
nonce: nonce_manager.next(account_address),
sender_address: account_address,
version,
only_query,

});
let account_tx = AccountTransaction {
tx,
Expand Down
5 changes: 2 additions & 3 deletions crates/blockifier/src/transaction/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,7 @@ pub fn create_account_tx_for_validate_test(
}

pub fn account_invoke_tx(invoke_args: InvokeTxArgs) -> AccountTransaction {
let only_query = invoke_args.only_query;
let execution_flags = ExecutionFlags { only_query, ..ExecutionFlags::default() };
let execution_flags = ExecutionFlags::default();
AccountTransaction { tx: invoke_tx(invoke_args), execution_flags }
}

Expand All @@ -310,8 +309,8 @@ pub fn run_invoke_tx(
block_context: &BlockContext,
invoke_args: InvokeTxArgs,
) -> TransactionExecutionResult<TransactionExecutionInfo> {
let only_query = invoke_args.only_query;
let tx = invoke_tx(invoke_args);
let only_query = false;
let charge_fee = enforce_fee(&tx, only_query);
let execution_flags = ExecutionFlags { charge_fee, only_query, ..ExecutionFlags::default() };
let account_tx = AccountTransaction { tx, execution_flags };
Expand Down
1 change: 0 additions & 1 deletion crates/blockifier/src/transaction/transactions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2239,7 +2239,6 @@ fn test_only_query_flag(
calldata: execute_calldata,
resource_bounds: default_all_resource_bounds,
sender_address,
only_query,
});
let execution_flags = ExecutionFlags { only_query, ..Default::default() };
let invoke_tx = AccountTransaction { tx, execution_flags };
Expand Down

0 comments on commit 6980513

Please sign in to comment.