From d005b7bcf35ed2bb47682937fb1cd6514ecc1c57 Mon Sep 17 00:00:00 2001 From: Arnon Hod Date: Tue, 13 Jan 2026 13:42:04 +0200 Subject: [PATCH] apollo_integration_tests: rename test scenario to a specific name --- .../src/end_to_end_flow_utils.rs | 13 ++++++++----- .../tests/bootstrap_declare.rs | 6 +++--- .../tests/declare_tx_flow_test.rs | 6 +++--- .../tests/deploy_account_and_invoke_flow_test.rs | 6 +++--- .../tests/funding_txs_flow_test.rs | 6 +++--- .../tests/l1_to_l2_message_flow_test.rs | 6 +++--- .../tests/multiple_account_txs_flow_test.rs | 6 +++--- .../tests/reverted_l1_handler_tx_flow_test.rs | 6 +++--- .../tests/test_custom_cairo0_txs.rs | 6 +++--- .../tests/test_custom_cairo1_txs.rs | 6 +++--- crates/apollo_integration_tests/tests/test_many.rs | 6 +++--- 11 files changed, 38 insertions(+), 35 deletions(-) diff --git a/crates/apollo_integration_tests/src/end_to_end_flow_utils.rs b/crates/apollo_integration_tests/src/end_to_end_flow_utils.rs index f1ebce608fb..b52c49d69c0 100644 --- a/crates/apollo_integration_tests/src/end_to_end_flow_utils.rs +++ b/crates/apollo_integration_tests/src/end_to_end_flow_utils.rs @@ -21,7 +21,7 @@ use crate::utils::{ pub struct EndToEndFlowArgs { pub test_identifier: TestIdentifier, pub instance_indices: [u16; 3], - pub test_scenario: TestScenario, + pub test_scenario: EndToEndTestScenario, pub block_max_capacity_gas: GasAmount, // Used to max both sierra and proving gas. pub expecting_full_blocks: bool, pub expecting_reverted_transactions: bool, @@ -31,7 +31,7 @@ pub struct EndToEndFlowArgs { impl EndToEndFlowArgs { pub fn new( test_identifier: TestIdentifier, - test_scenario: TestScenario, + test_scenario: EndToEndTestScenario, block_max_capacity_gas: GasAmount, ) -> Self { Self { @@ -113,8 +113,11 @@ pub async fn end_to_end_flow(args: EndToEndFlowArgs) { let mut total_expected_batched_txs_count = 0; // Build multiple heights to ensure heights are committed. - let TestScenario { create_rpc_txs_fn, create_l1_to_l2_messages_args_fn, test_tx_hashes_fn } = - test_scenario; + let EndToEndTestScenario { + create_rpc_txs_fn, + create_l1_to_l2_messages_args_fn, + test_tx_hashes_fn, + } = test_scenario; // Create and send transactions. // TODO(Arni): move send messages to l2 into [run_test_scenario]. @@ -169,7 +172,7 @@ pub async fn end_to_end_flow(args: EndToEndFlowArgs) { ); } -pub struct TestScenario { +pub struct EndToEndTestScenario { pub create_rpc_txs_fn: CreateRpcTxsFn, pub create_l1_to_l2_messages_args_fn: CreateL1ToL2MessagesArgsFn, // TODO(Arni): replace with an optional apply shuffle to the tx hashes + a length assertion diff --git a/crates/apollo_integration_tests/tests/bootstrap_declare.rs b/crates/apollo_integration_tests/tests/bootstrap_declare.rs index 78450092695..dabced1f837 100644 --- a/crates/apollo_integration_tests/tests/bootstrap_declare.rs +++ b/crates/apollo_integration_tests/tests/bootstrap_declare.rs @@ -3,13 +3,13 @@ use apollo_integration_tests::end_to_end_flow_utils::{ end_to_end_flow, test_single_tx, EndToEndFlowArgs, - TestScenario, + EndToEndTestScenario, }; use mempool_test_utils::starknet_api_test_utils::generate_bootstrap_declare; use starknet_api::execution_resources::GasAmount; -fn create_bootstrap_declare_scenario() -> TestScenario { - TestScenario { +fn create_bootstrap_declare_scenario() -> EndToEndTestScenario { + EndToEndTestScenario { create_rpc_txs_fn: |_| vec![generate_bootstrap_declare()], create_l1_to_l2_messages_args_fn: |_| vec![], test_tx_hashes_fn: test_single_tx, diff --git a/crates/apollo_integration_tests/tests/declare_tx_flow_test.rs b/crates/apollo_integration_tests/tests/declare_tx_flow_test.rs index 3d1724225f5..bc66833443c 100644 --- a/crates/apollo_integration_tests/tests/declare_tx_flow_test.rs +++ b/crates/apollo_integration_tests/tests/declare_tx_flow_test.rs @@ -3,7 +3,7 @@ use apollo_integration_tests::end_to_end_flow_utils::{ end_to_end_flow, test_single_tx, EndToEndFlowArgs, - TestScenario, + EndToEndTestScenario, }; use apollo_integration_tests::utils::ACCOUNT_ID_0; use blockifier::bouncer::BouncerWeights; @@ -25,8 +25,8 @@ async fn declare_tx_flow() { .await } -fn create_test_scenarios() -> TestScenario { - TestScenario { +fn create_test_scenarios() -> EndToEndTestScenario { + EndToEndTestScenario { create_rpc_txs_fn: create_declare_tx, create_l1_to_l2_messages_args_fn: |_| vec![], test_tx_hashes_fn: test_single_tx, diff --git a/crates/apollo_integration_tests/tests/deploy_account_and_invoke_flow_test.rs b/crates/apollo_integration_tests/tests/deploy_account_and_invoke_flow_test.rs index a0a2a93c330..056c41c9391 100644 --- a/crates/apollo_integration_tests/tests/deploy_account_and_invoke_flow_test.rs +++ b/crates/apollo_integration_tests/tests/deploy_account_and_invoke_flow_test.rs @@ -3,7 +3,7 @@ use apollo_integration_tests::end_to_end_flow_utils::{ end_to_end_flow, validate_tx_count, EndToEndFlowArgs, - TestScenario, + EndToEndTestScenario, }; use apollo_integration_tests::utils::{ create_deploy_account_tx_and_invoke_tx, @@ -29,8 +29,8 @@ async fn deploy_account_and_invoke_flow() { .await } -fn create_test_scenarios() -> TestScenario { - TestScenario { +fn create_test_scenarios() -> EndToEndTestScenario { + EndToEndTestScenario { create_rpc_txs_fn: deploy_account_and_invoke, create_l1_to_l2_messages_args_fn: |_| vec![], test_tx_hashes_fn: |tx_hashes| validate_tx_count(tx_hashes, 2), diff --git a/crates/apollo_integration_tests/tests/funding_txs_flow_test.rs b/crates/apollo_integration_tests/tests/funding_txs_flow_test.rs index be7ebb67a87..e3f46ef6f2a 100644 --- a/crates/apollo_integration_tests/tests/funding_txs_flow_test.rs +++ b/crates/apollo_integration_tests/tests/funding_txs_flow_test.rs @@ -3,7 +3,7 @@ use apollo_integration_tests::end_to_end_flow_utils::{ end_to_end_flow, test_single_tx, EndToEndFlowArgs, - TestScenario, + EndToEndTestScenario, }; use apollo_integration_tests::utils::{ACCOUNT_ID_0, UNDEPLOYED_ACCOUNT_ID}; use blockifier::bouncer::BouncerWeights; @@ -25,8 +25,8 @@ async fn funding_txs_flow() { .await } -fn create_test_scenarios() -> TestScenario { - TestScenario { +fn create_test_scenarios() -> EndToEndTestScenario { + EndToEndTestScenario { create_rpc_txs_fn: create_funding_txs, create_l1_to_l2_messages_args_fn: |_| vec![], test_tx_hashes_fn: test_single_tx, diff --git a/crates/apollo_integration_tests/tests/l1_to_l2_message_flow_test.rs b/crates/apollo_integration_tests/tests/l1_to_l2_message_flow_test.rs index 8eeccff928a..b48abdec780 100644 --- a/crates/apollo_integration_tests/tests/l1_to_l2_message_flow_test.rs +++ b/crates/apollo_integration_tests/tests/l1_to_l2_message_flow_test.rs @@ -3,7 +3,7 @@ use apollo_integration_tests::end_to_end_flow_utils::{ end_to_end_flow, test_single_tx, EndToEndFlowArgs, - TestScenario, + EndToEndTestScenario, }; use apollo_integration_tests::utils::create_l1_to_l2_messages_args; use blockifier::bouncer::BouncerWeights; @@ -23,8 +23,8 @@ async fn l1_to_l2_message_flow() { .await } -fn create_test_scenarios() -> TestScenario { - TestScenario { +fn create_test_scenarios() -> EndToEndTestScenario { + EndToEndTestScenario { create_rpc_txs_fn: |_| vec![], create_l1_to_l2_messages_args_fn: |tx_generator| { create_l1_to_l2_messages_args(tx_generator, 1, false) diff --git a/crates/apollo_integration_tests/tests/multiple_account_txs_flow_test.rs b/crates/apollo_integration_tests/tests/multiple_account_txs_flow_test.rs index 51eb5f357f4..6d60f9384b8 100644 --- a/crates/apollo_integration_tests/tests/multiple_account_txs_flow_test.rs +++ b/crates/apollo_integration_tests/tests/multiple_account_txs_flow_test.rs @@ -2,7 +2,7 @@ use apollo_infra_utils::test_utils::TestIdentifier; use apollo_integration_tests::end_to_end_flow_utils::{ end_to_end_flow, EndToEndFlowArgs, - TestScenario, + EndToEndTestScenario, }; use apollo_integration_tests::utils::{ACCOUNT_ID_0, ACCOUNT_ID_1}; use blockifier::bouncer::BouncerWeights; @@ -25,8 +25,8 @@ async fn multiple_account_txs_flow() { .await } -fn create_test_scenarios() -> TestScenario { - TestScenario { +fn create_test_scenarios() -> EndToEndTestScenario { + EndToEndTestScenario { create_rpc_txs_fn: create_multiple_account_txs, create_l1_to_l2_messages_args_fn: |_| vec![], test_tx_hashes_fn: test_multiple_account_txs, diff --git a/crates/apollo_integration_tests/tests/reverted_l1_handler_tx_flow_test.rs b/crates/apollo_integration_tests/tests/reverted_l1_handler_tx_flow_test.rs index 0aaab521f51..f8157e87efe 100644 --- a/crates/apollo_integration_tests/tests/reverted_l1_handler_tx_flow_test.rs +++ b/crates/apollo_integration_tests/tests/reverted_l1_handler_tx_flow_test.rs @@ -3,7 +3,7 @@ use apollo_integration_tests::end_to_end_flow_utils::{ end_to_end_flow, test_single_tx, EndToEndFlowArgs, - TestScenario, + EndToEndTestScenario, }; use apollo_integration_tests::utils::create_l1_to_l2_messages_args; use blockifier::bouncer::BouncerWeights; @@ -24,8 +24,8 @@ async fn reverted_l1_handler_tx_flow() { .await } -fn create_test_scenarios() -> TestScenario { - TestScenario { +fn create_test_scenarios() -> EndToEndTestScenario { + EndToEndTestScenario { create_rpc_txs_fn: |_| vec![], create_l1_to_l2_messages_args_fn: create_l1_to_l2_reverted_message_args, test_tx_hashes_fn: test_single_tx, diff --git a/crates/apollo_integration_tests/tests/test_custom_cairo0_txs.rs b/crates/apollo_integration_tests/tests/test_custom_cairo0_txs.rs index 1f23e7eb7b9..5d52d44d757 100644 --- a/crates/apollo_integration_tests/tests/test_custom_cairo0_txs.rs +++ b/crates/apollo_integration_tests/tests/test_custom_cairo0_txs.rs @@ -3,7 +3,7 @@ use apollo_integration_tests::end_to_end_flow_utils::{ end_to_end_flow, validate_tx_count, EndToEndFlowArgs, - TestScenario, + EndToEndTestScenario, }; use apollo_integration_tests::utils::ACCOUNT_ID_1 as CAIRO0_ACCOUNT_ID; use blockifier_test_utils::cairo_versions::CairoVersion; @@ -33,8 +33,8 @@ async fn custom_cairo0_txs() { .await } -fn create_custom_cairo0_txs_scenario() -> TestScenario { - TestScenario { +fn create_custom_cairo0_txs_scenario() -> EndToEndTestScenario { + EndToEndTestScenario { create_rpc_txs_fn: create_custom_cairo0_test_txs, create_l1_to_l2_messages_args_fn: |_| vec![], test_tx_hashes_fn: |tx_hashes| validate_tx_count(tx_hashes, CUSTOM_CAIRO_0_INVOKE_TX_COUNT), diff --git a/crates/apollo_integration_tests/tests/test_custom_cairo1_txs.rs b/crates/apollo_integration_tests/tests/test_custom_cairo1_txs.rs index b8305b40832..e53b64bd035 100644 --- a/crates/apollo_integration_tests/tests/test_custom_cairo1_txs.rs +++ b/crates/apollo_integration_tests/tests/test_custom_cairo1_txs.rs @@ -3,7 +3,7 @@ use apollo_integration_tests::end_to_end_flow_utils::{ end_to_end_flow, validate_tx_count, EndToEndFlowArgs, - TestScenario, + EndToEndTestScenario, }; use apollo_integration_tests::utils::ACCOUNT_ID_0 as CAIRO1_ACCOUNT_ID; use blockifier::bouncer::BouncerWeights; @@ -39,8 +39,8 @@ async fn custom_cairo1_txs() { .await } -fn create_custom_cairo1_txs_scenario() -> TestScenario { - TestScenario { +fn create_custom_cairo1_txs_scenario() -> EndToEndTestScenario { + EndToEndTestScenario { create_rpc_txs_fn: create_custom_cairo1_test_txs, create_l1_to_l2_messages_args_fn: |_| vec![], test_tx_hashes_fn: |tx_hashes| validate_tx_count(tx_hashes, CUSTOM_INVOKE_TX_COUNT), diff --git a/crates/apollo_integration_tests/tests/test_many.rs b/crates/apollo_integration_tests/tests/test_many.rs index 728848f390d..fae0ce55678 100644 --- a/crates/apollo_integration_tests/tests/test_many.rs +++ b/crates/apollo_integration_tests/tests/test_many.rs @@ -3,7 +3,7 @@ use apollo_integration_tests::end_to_end_flow_utils::{ end_to_end_flow, validate_tx_count, EndToEndFlowArgs, - TestScenario, + EndToEndTestScenario, }; use apollo_integration_tests::utils::{create_invoke_txs, ACCOUNT_ID_1}; use mempool_test_utils::starknet_api_test_utils::MultiAccountTransactionGenerator; @@ -28,8 +28,8 @@ async fn many_txs_fill_at_least_one_block() { .await } -fn create_many_txs_scenario() -> TestScenario { - TestScenario { +fn create_many_txs_scenario() -> EndToEndTestScenario { + EndToEndTestScenario { create_rpc_txs_fn: create_many_invoke_txs, create_l1_to_l2_messages_args_fn: |_| vec![], test_tx_hashes_fn: |tx_hashes| validate_tx_count(tx_hashes, N_TXS),