mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-02-17 19:53:05 +00:00
Update configs after main repo merge
This commit is contained in:
parent
32b82325f5
commit
0a25bc6533
@ -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)
|
||||
})
|
||||
|
||||
@ -37,9 +37,9 @@ pub struct Node {
|
||||
}
|
||||
|
||||
pub fn apply_node_config_patches<'a>(
|
||||
mut config: Config,
|
||||
mut config: RunConfig,
|
||||
patches: impl IntoIterator<Item = &'a NodeConfigPatch>,
|
||||
) -> Result<Config, DynError> {
|
||||
) -> Result<RunConfig, DynError> {
|
||||
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<Config, DynError> {
|
||||
) -> Result<RunConfig, DynError> {
|
||||
apply_node_config_patches(config, [patch])
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,10 @@ impl Default for StartNodeOptions {
|
||||
impl StartNodeOptions {
|
||||
pub fn create_patch<F>(mut self, f: F) -> Self
|
||||
where
|
||||
F: Fn(nomos_node::Config) -> Result<nomos_node::Config, DynError> + Send + Sync + 'static,
|
||||
F: Fn(nomos_node::config::RunConfig) -> Result<nomos_node::config::RunConfig, DynError>
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
{
|
||||
self.config_patch = Some(Arc::new(f));
|
||||
self
|
||||
|
||||
@ -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<Caps> TopologyConfigurator<Caps> {
|
||||
#[must_use]
|
||||
pub fn node_config_patch_with<F>(mut self, index: usize, f: F) -> Self
|
||||
where
|
||||
F: Fn(NodeConfig) -> Result<NodeConfig, DynError> + Send + Sync + 'static,
|
||||
F: Fn(RunConfig) -> Result<RunConfig, DynError> + Send + Sync + 'static,
|
||||
{
|
||||
self.builder.topology = self
|
||||
.builder
|
||||
|
||||
@ -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<dyn Fn(NodeConfig) -> Result<NodeConfig, DynError> + Send + Sync>;
|
||||
pub type NodeConfigPatch = Arc<dyn Fn(RunConfig) -> Result<RunConfig, DynError> + Send + Sync>;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum TopologyBuildError {
|
||||
|
||||
@ -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<ApiClient, LocalDynamicError> {
|
||||
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<NodeConfig, LocalDynamicError> {
|
||||
) -> Result<RunConfig, LocalDynamicError> {
|
||||
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<NodeConfig, LocalDynamicError> {
|
||||
) -> Result<RunConfig, LocalDynamicError> {
|
||||
let Some(patch) = patch else {
|
||||
return Ok(config);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user