From fb4f8a20a31e7e71e27c059b2a70efb7a4783380 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 37d634f7e0..944f2122a8 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 }