Skip to content

Commit

Permalink
chore(starknet_integration_tests): pass tx_generator as mut ref
Browse files Browse the repository at this point in the history
commit-id:aeeae6b7
  • Loading branch information
nadin-Starkware committed Jan 15, 2025
1 parent 53b06ea commit a00727a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ async fn main() {
);

// Creates a multi-account transaction generator for integration test
let tx_generator = create_integration_test_tx_generator();
let mut tx_generator = create_integration_test_tx_generator();

// Run end to end integration test.
end_to_end_integration(tx_generator).await;
end_to_end_integration(&mut tx_generator).await;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use tracing::info;

use crate::sequencer_manager::{get_sequencer_setup_configs, SequencerSetupManager};

pub async fn end_to_end_integration(tx_generator: MultiAccountTransactionGenerator) {
pub async fn end_to_end_integration(tx_generator: &mut MultiAccountTransactionGenerator) {
const EXPECTED_BLOCK_NUMBER: BlockNumber = BlockNumber(15);
const N_TXS: usize = 50;
const SENDER_ACCOUNT: AccountId = 0;
Expand All @@ -15,7 +15,7 @@ pub async fn end_to_end_integration(tx_generator: MultiAccountTransactionGenerat
get_node_executable_path();

// Get the sequencer configurations.
let sequencers_setup = get_sequencer_setup_configs(&tx_generator).await;
let sequencers_setup = get_sequencer_setup_configs(tx_generator).await;

// Run the sequencers.
// TODO(Nadin, Tsabary): Refactor to separate the construction of SequencerManager from its
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet_integration_tests/src/sequencer_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl SequencerSetupManager {

pub async fn run_integration_test_simulator(
&self,
tx_generator: MultiAccountTransactionGenerator,
tx_generator: &mut MultiAccountTransactionGenerator,
n_txs: usize,
sender_account: AccountId,
) {
Expand Down
4 changes: 2 additions & 2 deletions crates/starknet_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ fn fund_new_account(
}

fn create_account_txs(
mut tx_generator: MultiAccountTransactionGenerator,
tx_generator: &mut MultiAccountTransactionGenerator,
account_id: AccountId,
n_txs: usize,
) -> Vec<RpcTransaction> {
Expand Down Expand Up @@ -278,7 +278,7 @@ pub fn test_tx_hashes_for_integration_test(tx_hashes: &[TransactionHash]) -> Vec

/// Returns a list of the transaction hashes, in the order they are expected to be in the mempool.
pub async fn send_account_txs<'a, Fut>(
tx_generator: MultiAccountTransactionGenerator,
tx_generator: &mut MultiAccountTransactionGenerator,
account_id: AccountId,
n_txs: usize,
send_rpc_tx_fn: &'a mut dyn FnMut(RpcTransaction) -> Fut,
Expand Down

0 comments on commit a00727a

Please sign in to comment.