Skip to content

Commit 7939fe8

Browse files
refactor(starknet_integration_tests): rename SequencerSetupManager (#3462)
* refactor(starknet_integration_tests): rename SequencerSetup commit-id:87c8d1a8 * refactor(starknet_integration_tests): rename SequencerSetupManager commit-id:50b87cd4
1 parent 48f23ca commit 7939fe8

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

crates/starknet_integration_tests/src/end_to_end_integration.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use starknet_api::block::BlockNumber;
33
use starknet_sequencer_node::test_utils::node_runner::get_node_executable_path;
44
use tracing::info;
55

6-
use crate::sequencer_manager::{get_sequencer_setup_configs, SequencerSetupManager};
6+
use crate::sequencer_manager::{get_sequencer_setup_configs, IntegrationTestManager};
77

88
pub async fn end_to_end_integration(tx_generator: MultiAccountTransactionGenerator) {
99
const EXPECTED_BLOCK_NUMBER: BlockNumber = BlockNumber(15);
@@ -20,16 +20,18 @@ pub async fn end_to_end_integration(tx_generator: MultiAccountTransactionGenerat
2020
// Run the sequencers.
2121
// TODO(Nadin, Tsabary): Refactor to separate the construction of SequencerManager from its
2222
// invocation. Consider using the builder pattern.
23-
let sequencer_manager = SequencerSetupManager::run(sequencers_setup).await;
23+
let integration_test_manager = IntegrationTestManager::run(sequencers_setup).await;
2424

2525
// Run the integration test simulator.
26-
sequencer_manager.run_integration_test_simulator(tx_generator, N_TXS, SENDER_ACCOUNT).await;
26+
integration_test_manager
27+
.run_integration_test_simulator(tx_generator, N_TXS, SENDER_ACCOUNT)
28+
.await;
2729

28-
sequencer_manager.await_execution(EXPECTED_BLOCK_NUMBER).await;
30+
integration_test_manager.await_execution(EXPECTED_BLOCK_NUMBER).await;
2931

3032
info!("Shutting down nodes.");
31-
sequencer_manager.shutdown_nodes();
33+
integration_test_manager.shutdown_nodes();
3234

3335
// Verify the results.
34-
sequencer_manager.verify_results(sender_address, N_TXS).await;
36+
integration_test_manager.verify_results(sender_address, N_TXS).await;
3537
}

crates/starknet_integration_tests/src/integration_test_setup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl From<SequencerExecutionId> for NodeRunner {
4747
}
4848
}
4949

50-
pub struct SequencerSetup {
50+
pub struct ExecutableSetup {
5151
// Sequencer test identifier.
5252
pub sequencer_execution_id: SequencerExecutionId,
5353
// Client for adding transactions to the sequencer node.
@@ -73,7 +73,7 @@ pub struct SequencerSetup {
7373

7474
// TODO(Tsabary/ Nadin): reduce number of args.
7575
#[allow(clippy::too_many_arguments)]
76-
impl SequencerSetup {
76+
impl ExecutableSetup {
7777
#[instrument(skip(accounts, chain_info, consensus_manager_config), level = "debug")]
7878
pub async fn new(
7979
accounts: Vec<AccountTransactionGenerator>,

crates/starknet_integration_tests/src/sequencer_manager.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use starknet_types_core::felt::Felt;
3131
use tokio::task::JoinHandle;
3232
use tracing::info;
3333

34-
use crate::integration_test_setup::{SequencerExecutionId, SequencerSetup};
34+
use crate::integration_test_setup::{ExecutableSetup, SequencerExecutionId};
3535
use crate::utils::{
3636
create_chain_info,
3737
create_consensus_manager_configs_from_network_configs,
@@ -64,13 +64,13 @@ impl ComposedComponentConfigs {
6464
}
6565
}
6666

67-
pub struct SequencerSetupManager {
68-
pub sequencers: Vec<SequencerSetup>,
67+
pub struct IntegrationTestManager {
68+
pub sequencers: Vec<ExecutableSetup>,
6969
pub sequencer_run_handles: Vec<JoinHandle<()>>,
7070
}
7171

72-
impl SequencerSetupManager {
73-
pub async fn run(sequencers: Vec<SequencerSetup>) -> Self {
72+
impl IntegrationTestManager {
73+
pub async fn run(sequencers: Vec<ExecutableSetup>) -> Self {
7474
info!("Running sequencers.");
7575
let sequencer_run_handles = sequencers
7676
.iter()
@@ -192,7 +192,7 @@ async fn await_block(
192192

193193
pub(crate) async fn get_sequencer_setup_configs(
194194
tx_generator: &MultiAccountTransactionGenerator,
195-
) -> Vec<SequencerSetup> {
195+
) -> Vec<ExecutableSetup> {
196196
let test_unique_id = TestIdentifier::EndToEndIntegrationTest;
197197

198198
// TODO(Nadin): Assign a dedicated set of available ports to each sequencer.
@@ -224,7 +224,7 @@ pub(crate) async fn get_sequencer_setup_configs(
224224
);
225225

226226
// TODO(Nadin): define the test storage here and pass it to the create_state_sync_configs and to
227-
// the SequencerSetup
227+
// the ExecutableSetup
228228
let state_sync_configs = create_state_sync_configs(
229229
StorageConfig::default(),
230230
available_ports.get_next_ports(n_distributed_sequencers),
@@ -275,7 +275,7 @@ pub(crate) async fn get_sequencer_setup_configs(
275275
)| {
276276
let chain_info = chain_info.clone();
277277
async move {
278-
SequencerSetup::new(
278+
ExecutableSetup::new(
279279
accounts.to_vec(),
280280
sequencer_execution_id,
281281
chain_info,

0 commit comments

Comments
 (0)