From 867716ebe94c745cabe69b3f5ceab6f71e62bd92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sat, 30 Sep 2023 19:13:42 +0200 Subject: [PATCH] Re-export geo topology types --- sdk/rust/nym-sdk/examples/geo_topology_provider.rs | 8 ++------ sdk/rust/nym-sdk/src/mixnet.rs | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/sdk/rust/nym-sdk/examples/geo_topology_provider.rs b/sdk/rust/nym-sdk/examples/geo_topology_provider.rs index 1d0756be4a4..e57de3f1ada 100644 --- a/sdk/rust/nym-sdk/examples/geo_topology_provider.rs +++ b/sdk/rust/nym-sdk/examples/geo_topology_provider.rs @@ -1,10 +1,6 @@ // Copyright 2023 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use nym_client_core::client::topology_control::geo_aware_provider::{ - CountryGroup, GeoAwareTopologyProvider, -}; -use nym_client_core::config::GroupBy; use nym_sdk::mixnet; use nym_sdk::mixnet::MixnetMessageSender; @@ -15,13 +11,13 @@ async fn main() { let nym_api = "https://validator.nymtech.net/api/".parse().unwrap(); // We can group on something which is to a first approximation a continent. - let group_by = GroupBy::CountryGroup(CountryGroup::Europe); + let group_by = mixnet::GroupBy::CountryGroup(mixnet::CountryGroup::Europe); // ... or on a nym-address. This means we use the geo location of the gateway that the // nym-address is connected to. //let group_by = GroupBy::NymAddress("id.enc@gateway".parse().unwrap()); - let geo_topology_provider = GeoAwareTopologyProvider::new( + let geo_topology_provider = mixnet::GeoAwareTopologyProvider::new( vec![nym_api], // We filter on the version of the mixnodes. Be prepared to manually update // this to keep this example working, as we can't (currently) fetch to current diff --git a/sdk/rust/nym-sdk/src/mixnet.rs b/sdk/rust/nym-sdk/src/mixnet.rs index 88a8604d6b6..9dc4dd9681a 100644 --- a/sdk/rust/nym-sdk/src/mixnet.rs +++ b/sdk/rust/nym-sdk/src/mixnet.rs @@ -54,8 +54,9 @@ pub use nym_client_core::{ fs_backend::Backend as ReplyStorage, CombinedReplyStorage, Empty as EmptyReplyStorage, ReplyStorageBackend, }, + topology_control::geo_aware_provider::{CountryGroup, GeoAwareTopologyProvider}, }, - config::GatewayEndpointConfig, + config::{GatewayEndpointConfig, GroupBy}, }; pub use nym_credential_storage::{ ephemeral_storage::EphemeralStorage as EphemeralCredentialStorage, models::CoconutCredential,