From b12e2cbe4cf1afb2ea1aafdd8d04a2c8ee3cf396 Mon Sep 17 00:00:00 2001 From: Itay Tsabary Date: Wed, 18 Dec 2024 20:42:54 +0200 Subject: [PATCH] chore(starknet_integration_tests): use available ports for state sync commit-id:7d577cc9 --- crates/starknet_integration_tests/src/utils.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/starknet_integration_tests/src/utils.rs b/crates/starknet_integration_tests/src/utils.rs index 37d634f7e07..944f2122a80 100644 --- a/crates/starknet_integration_tests/src/utils.rs +++ b/crates/starknet_integration_tests/src/utils.rs @@ -69,7 +69,8 @@ pub async fn create_config( let rpc_state_reader_config = test_rpc_state_reader_config(rpc_server_addr); let monitoring_endpoint_config = MonitoringEndpointConfig { port: available_ports.get_next_port(), ..Default::default() }; - let state_sync_config = create_state_sync_config(state_sync_storage_config, sequencer_index); + let state_sync_config = + create_state_sync_config(state_sync_storage_config, available_ports.get_next_port()); ( SequencerNodeConfig { @@ -277,12 +278,12 @@ fn set_validator_id(consensus_manager_config: &mut ConsensusManagerConfig, seque .unwrap(); } -pub fn create_state_sync_config( +fn create_state_sync_config( state_sync_storage_config: StorageConfig, - sequencer_index: usize, + port: u16, ) -> StateSyncConfig { let mut config = StateSyncConfig { storage_config: state_sync_storage_config, ..Default::default() }; - config.network_config.tcp_port += u16::try_from(sequencer_index).unwrap(); + config.network_config.tcp_port = port; config }