From 7606e03e74d0514df95d415fd4d280ee01e53e8c Mon Sep 17 00:00:00 2001 From: Aviv Greenburg Date: Tue, 3 Dec 2024 17:24:44 +0200 Subject: [PATCH] chore(blockifier): remover only_qury from IvokeTxArgs --- .../src/transaction/account_transactions_test.rs | 1 - .../blockifier/src/transaction/execution_flavors_test.rs | 8 -------- crates/blockifier/src/transaction/test_utils.rs | 5 ++--- crates/blockifier/src/transaction/transactions_test.rs | 1 - 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/crates/blockifier/src/transaction/account_transactions_test.rs b/crates/blockifier/src/transaction/account_transactions_test.rs index 23f3d7e9f9..0adecfc3f6 100644 --- a/crates/blockifier/src/transaction/account_transactions_test.rs +++ b/crates/blockifier/src/transaction/account_transactions_test.rs @@ -327,7 +327,6 @@ fn test_account_flow_test( version: tx_version, resource_bounds, nonce: nonce_manager.next(account_address), - only_query, }, ) .unwrap(); diff --git a/crates/blockifier/src/transaction/execution_flavors_test.rs b/crates/blockifier/src/transaction/execution_flavors_test.rs index d369fc0d09..9873571a84 100644 --- a/crates/blockifier/src/transaction/execution_flavors_test.rs +++ b/crates/blockifier/src/transaction/execution_flavors_test.rs @@ -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) } @@ -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 { @@ -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 { @@ -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, @@ -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, diff --git a/crates/blockifier/src/transaction/test_utils.rs b/crates/blockifier/src/transaction/test_utils.rs index 24a4af1eae..479e1b5032 100644 --- a/crates/blockifier/src/transaction/test_utils.rs +++ b/crates/blockifier/src/transaction/test_utils.rs @@ -301,8 +301,7 @@ pub fn create_account_tx_for_validate_test( // TODO(AvivG): Consider removing this function. 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 } } @@ -311,8 +310,8 @@ pub fn run_invoke_tx( block_context: &BlockContext, invoke_args: InvokeTxArgs, ) -> TransactionExecutionResult { - 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 }; diff --git a/crates/blockifier/src/transaction/transactions_test.rs b/crates/blockifier/src/transaction/transactions_test.rs index ceff8a22b4..a6cd754b05 100644 --- a/crates/blockifier/src/transaction/transactions_test.rs +++ b/crates/blockifier/src/transaction/transactions_test.rs @@ -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 };