Skip to content
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
13 changes: 8 additions & 5 deletions crates/apollo_integration_tests/src/end_to_end_flow_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
Expand Down Expand Up @@ -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].
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions crates/apollo_integration_tests/tests/bootstrap_declare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions crates/apollo_integration_tests/tests/declare_tx_flow_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions crates/apollo_integration_tests/tests/test_many.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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),
Expand Down
Loading