From e7d88c3c28100e1eb08d80937de6a0208d8d9df2 Mon Sep 17 00:00:00 2001 From: jmwample Date: Tue, 11 Mar 2025 08:22:19 -0600 Subject: [PATCH] test the piecewise api provider against local nym api --- .../topology_control/smart_api_provider.rs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/common/client-core/src/client/topology_control/smart_api_provider.rs b/common/client-core/src/client/topology_control/smart_api_provider.rs index a71161cfe7..d75bfc9bf7 100644 --- a/common/client-core/src/client/topology_control/smart_api_provider.rs +++ b/common/client-core/src/client/topology_control/smart_api_provider.rs @@ -198,3 +198,33 @@ impl PiecewiseTopologyProvider for NymApiPiecewiseProvider { self.get_layer_assignments_inner().await } } + +// // Test requires running a local instance of the nym-api binary, for example using: +// // `RUST_LOG="info" ./target/debug/nym-api run --nyxd-validator "https://rpc.nymtech.net"` + +// #[cfg(test)] +// mod test { +// use std::time::Duration; + +// use super::*; +// use nym_bin_common::logging::setup_tracing_logger; + +// #[tokio::test] +// async fn local_api_provider_test() { +// setup_tracing_logger(); +// let mut provider = NymApiTopologyProvider::new( +// Config::default(), +// vec!["http://localhost:8000" +// .parse() +// .expect("failed to parse api url")], +// None, +// None, +// ); + +// for _ in 0..180 { +// let topo = provider.get_new_topology().await; +// assert!(topo.is_some()); +// tokio::time::sleep(Duration::from_secs(30)).await; +// } +// } +// }