Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(starknet_integration_tests): pass relevant ports to mempool p2p config gen fn #2967

Merged
merged 1 commit into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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