Skip to content

Commit

Permalink
chore(starknet_integration_tests): pass relevant ports to mempool p2p…
Browse files Browse the repository at this point in the history
… config gen fn (#2967)

commit-id:e3100dbe
  • Loading branch information
Itay-Tsabary-Starkware authored Dec 29, 2024
1 parent 89b1b80 commit 09b5654
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
7 changes: 2 additions & 5 deletions crates/starknet_integration_tests/src/flow_test_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,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() {
Expand Down
7 changes: 1 addition & 6 deletions crates/starknet_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,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<MempoolP2pConfig> {
let ports = available_ports.get_next_ports(n_mempools);
pub fn create_mempool_p2p_configs(chain_id: ChainId, ports: Vec<u16>) -> Vec<MempoolP2pConfig> {
create_connected_network_configs(ports)
.into_iter()
.map(|mut network_config| {
Expand Down

0 comments on commit 09b5654

Please sign in to comment.