diff --git a/examples/tests/node_config_override.rs b/examples/tests/node_config_override.rs index 805e65a..85f9db2 100644 --- a/examples/tests/node_config_override.rs +++ b/examples/tests/node_config_override.rs @@ -37,9 +37,10 @@ async fn manual_cluster_api_port_override() -> Result<()> { .create_patch(move |mut config| { println!("overriding API port to {api_port}"); - let current_addr = config.http.backend_settings.address; + let current_addr = config.user.http.backend_settings.address; - config.http.backend_settings.address = SocketAddr::new(current_addr.ip(), api_port); + config.user.http.backend_settings.address = + SocketAddr::new(current_addr.ip(), api_port); Ok(config) }), @@ -73,9 +74,10 @@ async fn scenario_builder_api_port_override() -> Result<()> { .node_config_patch_with(0, move |mut config| { println!("overriding API port to {api_port}"); - let current_addr = config.http.backend_settings.address; + let current_addr = config.user.http.backend_settings.address; - config.http.backend_settings.address = SocketAddr::new(current_addr.ip(), api_port); + config.user.http.backend_settings.address = + SocketAddr::new(current_addr.ip(), api_port); Ok(config) }) diff --git a/testing-framework/core/src/nodes/node.rs b/testing-framework/core/src/nodes/node.rs index 4e1c4d1..837e4ea 100644 --- a/testing-framework/core/src/nodes/node.rs +++ b/testing-framework/core/src/nodes/node.rs @@ -37,9 +37,9 @@ pub struct Node { } pub fn apply_node_config_patches<'a>( - mut config: Config, + mut config: RunConfig, patches: impl IntoIterator, -) -> Result { +) -> Result { for patch in patches { config = patch(config)?; } @@ -47,9 +47,9 @@ pub fn apply_node_config_patches<'a>( } pub fn apply_node_config_patch( - config: Config, + config: RunConfig, patch: &NodeConfigPatch, -) -> Result { +) -> Result { apply_node_config_patches(config, [patch]) } diff --git a/testing-framework/core/src/scenario/capabilities.rs b/testing-framework/core/src/scenario/capabilities.rs index 1c05590..1dda452 100644 --- a/testing-framework/core/src/scenario/capabilities.rs +++ b/testing-framework/core/src/scenario/capabilities.rs @@ -56,7 +56,10 @@ impl Default for StartNodeOptions { impl StartNodeOptions { pub fn create_patch(mut self, f: F) -> Self where - F: Fn(nomos_node::Config) -> Result + Send + Sync + 'static, + F: Fn(nomos_node::config::RunConfig) -> Result + + Send + + Sync + + 'static, { self.config_patch = Some(Arc::new(f)); self diff --git a/testing-framework/core/src/scenario/definition.rs b/testing-framework/core/src/scenario/definition.rs index dceb3c9..ded9307 100644 --- a/testing-framework/core/src/scenario/definition.rs +++ b/testing-framework/core/src/scenario/definition.rs @@ -1,6 +1,6 @@ use std::{num::NonZeroUsize, sync::Arc, time::Duration}; -use nomos_node::Config as NodeConfig; +use nomos_node::config::RunConfig; use thiserror::Error; use tracing::{debug, info}; @@ -314,7 +314,7 @@ impl TopologyConfigurator { #[must_use] pub fn node_config_patch_with(mut self, index: usize, f: F) -> Self where - F: Fn(NodeConfig) -> Result + Send + Sync + 'static, + F: Fn(RunConfig) -> Result + Send + Sync + 'static, { self.builder.topology = self .builder diff --git a/testing-framework/core/src/topology/config.rs b/testing-framework/core/src/topology/config.rs index 69e9bc3..9a57720 100644 --- a/testing-framework/core/src/topology/config.rs +++ b/testing-framework/core/src/topology/config.rs @@ -4,7 +4,7 @@ use nomos_core::{ mantle::GenesisTx as _, sdp::{Locator, ServiceType}, }; -use nomos_node::Config as NodeConfig; +use nomos_node::config::RunConfig; use testing_framework_config::topology::{ configs::{ api::{ApiConfigError, create_api_configs}, @@ -31,7 +31,7 @@ use crate::{ }; /// Per-node config patch applied after the default node config is generated. -pub type NodeConfigPatch = Arc Result + Send + Sync>; +pub type NodeConfigPatch = Arc Result + Send + Sync>; #[derive(Debug, Error)] pub enum TopologyBuildError { diff --git a/testing-framework/deployers/local/src/node_control/mod.rs b/testing-framework/deployers/local/src/node_control/mod.rs index 5cd4bcc..b3978a4 100644 --- a/testing-framework/deployers/local/src/node_control/mod.rs +++ b/testing-framework/deployers/local/src/node_control/mod.rs @@ -3,7 +3,7 @@ use std::{ sync::Mutex, }; -use nomos_node::config::RunConfig as NodeConfig; +use nomos_node::config::RunConfig; use testing_framework_config::topology::configs::{consensus, time}; use testing_framework_core::{ nodes::{ @@ -266,7 +266,7 @@ impl LocalDynamicNodes { &self, node_name: &str, network_port: u16, - config: NodeConfig, + config: RunConfig, ) -> Result { let node = Node::spawn(config, node_name) .await @@ -290,7 +290,7 @@ fn build_node_config( general_config: testing_framework_config::topology::configs::GeneralConfig, descriptor_patch: Option<&testing_framework_core::topology::config::NodeConfigPatch>, options_patch: Option<&testing_framework_core::topology::config::NodeConfigPatch>, -) -> Result { +) -> Result { let mut config = create_node_config(general_config); config = apply_patch_if_needed(config, descriptor_patch)?; config = apply_patch_if_needed(config, options_patch)?; @@ -299,9 +299,9 @@ fn build_node_config( } fn apply_patch_if_needed( - config: NodeConfig, + config: RunConfig, patch: Option<&testing_framework_core::topology::config::NodeConfigPatch>, -) -> Result { +) -> Result { let Some(patch) = patch else { return Ok(config); };