From 23133a8fa01d4665c458f98c43cb828e89908fb5 Mon Sep 17 00:00:00 2001 From: nadin-Starkware Date: Sun, 12 Jan 2025 16:18:38 +0200 Subject: [PATCH] refactor(starknet_integration_tests): refactor create_state_sync_config to create multi configs commit-id:da683768 --- .../starknet_integration_tests/src/utils.rs | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/crates/starknet_integration_tests/src/utils.rs b/crates/starknet_integration_tests/src/utils.rs index ae6c1c0157..4266bfbe12 100644 --- a/crates/starknet_integration_tests/src/utils.rs +++ b/crates/starknet_integration_tests/src/utils.rs @@ -89,8 +89,10 @@ pub async fn create_node_config( create_http_server_config(available_ports.get_next_local_host_socket()); let monitoring_endpoint_config = MonitoringEndpointConfig { port: available_ports.get_next_port(), ..Default::default() }; + // TODO(Nadin): get a single state_sync_config as an argument. let state_sync_config = - create_state_sync_config(state_sync_storage_config, available_ports.get_next_port()); + create_state_sync_configs(state_sync_storage_config, available_ports.get_next_ports(1)) + .remove(0); ( SequencerNodeConfig { @@ -328,12 +330,16 @@ fn set_validator_id( validator_id } -pub fn create_state_sync_config( +pub fn create_state_sync_configs( state_sync_storage_config: StorageConfig, - port: u16, -) -> StateSyncConfig { - let mut config = - StateSyncConfig { storage_config: state_sync_storage_config, ..Default::default() }; - config.network_config.tcp_port = port; - config + ports: Vec, +) -> Vec { + create_connected_network_configs(ports) + .into_iter() + .map(|network_config| StateSyncConfig { + storage_config: state_sync_storage_config.clone(), + network_config, + ..Default::default() + }) + .collect() }