Skip to content

Commit

Permalink
refactor(starknet_integration_tests): move await_execution to monitor…
Browse files Browse the repository at this point in the history
…ing utils

commit-id:8de22fb7
  • Loading branch information
nadin-Starkware committed Feb 3, 2025
1 parent 9207ab2 commit 602b783
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 10 additions & 0 deletions crates/starknet_integration_tests/src/monitoring_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,13 @@ pub async fn await_batcher_block(
.await
.ok_or(())
}

pub async fn await_execution(
monitoring_client: &MonitoringClient,
expected_block_number: BlockNumber,
) {
info!("Awaiting until {expected_block_number} blocks have been created.");
await_batcher_block(5000, expected_block_number, 50, monitoring_client)
.await
.expect("Block number should have been reached.");
}
12 changes: 2 additions & 10 deletions crates/starknet_integration_tests/src/sequencer_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use tokio::task::JoinHandle;
use tracing::info;

use crate::integration_test_setup::{ExecutableSetup, NodeExecutionId};
use crate::monitoring_utils::await_batcher_block;
use crate::monitoring_utils::await_execution;
use crate::utils::{
create_chain_info,
create_consensus_manager_configs_from_network_configs,
Expand Down Expand Up @@ -278,15 +278,7 @@ impl IntegrationTestManager {
}

pub async fn await_execution(&self, expected_block_number: BlockNumber) {
info!("Awaiting until {expected_block_number} blocks have been created.");
await_batcher_block(
5000,
expected_block_number,
50,
self.running_batcher_monitoring_client(),
)
.await
.expect("Block number should have been reached.");
await_execution(self.running_batcher_monitoring_client(), expected_block_number).await;
}

pub async fn verify_results(&self, expected_n_batched_tx: usize) {
Expand Down

0 comments on commit 602b783

Please sign in to comment.