diff --git a/crates/starknet_integration_tests/src/flow_test_setup.rs b/crates/starknet_integration_tests/src/flow_test_setup.rs index 6137fed859..dbd7d3a2f4 100644 --- a/crates/starknet_integration_tests/src/flow_test_setup.rs +++ b/crates/starknet_integration_tests/src/flow_test_setup.rs @@ -59,11 +59,8 @@ impl FlowTestSetup { let [sequencer_0_consensus_manager_config, sequencer_1_consensus_manager_config]: [ConsensusManagerConfig; 2] = consensus_manager_configs.try_into().unwrap(); - let mempool_p2p_configs = create_mempool_p2p_configs( - SEQUENCER_INDICES.len(), - chain_info.chain_id.clone(), - &mut available_ports, - ); + let ports = available_ports.get_next_ports(SEQUENCER_INDICES.len()); + let mempool_p2p_configs = create_mempool_p2p_configs(chain_info.chain_id.clone(), ports); let [sequencer_0_mempool_p2p_config, sequencer_1_mempool_p2p_config]: [MempoolP2pConfig; 2] = mempool_p2p_configs.try_into().unwrap(); diff --git a/crates/starknet_integration_tests/src/integration_test_setup.rs b/crates/starknet_integration_tests/src/integration_test_setup.rs index 8ba4ae906a..4b750f62d2 100644 --- a/crates/starknet_integration_tests/src/integration_test_setup.rs +++ b/crates/starknet_integration_tests/src/integration_test_setup.rs @@ -53,11 +53,10 @@ impl IntegrationTestSetup { let (mut consensus_manager_configs, consensus_proposals_channels) = create_consensus_manager_configs_and_channels(n_sequencers, &mut available_ports); - let mut mempool_p2p_configs = create_mempool_p2p_configs( - n_sequencers, - chain_info.chain_id.clone(), - &mut available_ports, - ); + + let ports = available_ports.get_next_ports(n_sequencers); + let mut mempool_p2p_configs = + create_mempool_p2p_configs(chain_info.chain_id.clone(), ports); let mut sequencers = vec![]; for (sequencer_id, component_config) in component_configs.iter().enumerate() { diff --git a/crates/starknet_integration_tests/src/utils.rs b/crates/starknet_integration_tests/src/utils.rs index 1632b96601..69bf14a083 100644 --- a/crates/starknet_integration_tests/src/utils.rs +++ b/crates/starknet_integration_tests/src/utils.rs @@ -141,12 +141,7 @@ pub fn test_rpc_state_reader_config(rpc_server_addr: SocketAddr) -> RpcStateRead RpcStateReaderConfig::from_url(format!("http://{rpc_server_addr:?}/rpc/{RPC_SPEC_VERSION}")) } -pub fn create_mempool_p2p_configs( - n_mempools: usize, - chain_id: ChainId, - available_ports: &mut AvailablePorts, -) -> Vec { - let ports = available_ports.get_next_ports(n_mempools); +pub fn create_mempool_p2p_configs(chain_id: ChainId, ports: Vec) -> Vec { create_connected_network_configs(ports) .into_iter() .map(|mut network_config| {