Skip to content

Commit 53c2e7e

Browse files
committed
test the piecewise api provider against local nym api
1 parent 4a2ca8d commit 53c2e7e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

common/client-core/src/client/topology_control/smart_api_provider.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,33 @@ impl PiecewiseTopologyProvider for NymApiPiecewiseProvider {
198198
self.get_layer_assignments_inner().await
199199
}
200200
}
201+
202+
// // Test requires running a local instance of the nym-api binary, for example using:
203+
// // `RUST_LOG="info" ./target/debug/nym-api run --nyxd-validator "https://rpc.nymtech.net"`
204+
205+
// #[cfg(test)]
206+
// mod test {
207+
// use std::time::Duration;
208+
209+
// use super::*;
210+
// use nym_bin_common::logging::setup_tracing_logger;
211+
212+
// #[tokio::test]
213+
// async fn local_api_provider_test() {
214+
// setup_tracing_logger();
215+
// let mut provider = NymApiTopologyProvider::new(
216+
// Config::default(),
217+
// vec!["http://localhost:8000"
218+
// .parse()
219+
// .expect("failed to parse api url")],
220+
// None,
221+
// None,
222+
// );
223+
224+
// for _ in 0..180 {
225+
// let topo = provider.get_new_topology().await;
226+
// assert!(topo.is_some());
227+
// tokio::time::sleep(Duration::from_secs(30)).await;
228+
// }
229+
// }
230+
// }

0 commit comments

Comments
 (0)