Skip to content

Commit e79769f

Browse files
chore: fix imports
1 parent 9b6dea6 commit e79769f

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

ic-agent/src/agent/builder.rs

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
use reqwest::Client;
2-
31
use crate::{
4-
agent::{
5-
agent_config::AgentConfig,
6-
http_transport::{
7-
dynamic_routing::{
8-
dynamic_route_provider::{DynamicRouteProviderBuilder, IC0_SEED_DOMAIN},
9-
node::Node,
10-
snapshot::latency_based_routing::LatencyRoutingSnapshot,
11-
},
12-
route_provider::RouteProvider,
13-
},
14-
Agent, Transport,
15-
},
2+
agent::{agent_config::AgentConfig, Agent, Transport},
163
AgentError, Identity, NonceFactory, NonceGenerator,
174
};
185
use std::sync::Arc;
@@ -29,9 +16,18 @@ impl AgentBuilder {
2916
Agent::new(self.config)
3017
}
3118

32-
/// Set the dynamic transport layer for the [`Agent`], performing continuos discovery of the API boundary nodes and routing traffic via them based on the latencies.
33-
pub async fn with_discovery_transport(self, client: Client) -> Self {
34-
use crate::agent::http_transport::ReqwestTransport;
19+
#[cfg(all(feature = "reqwest", not(target_family = "wasm")))]
20+
/// Set the dynamic transport layer for the [`Agent`], performing continuos discovery of the API boundary nodes and routing traffic via them based on the latencies.
21+
pub async fn with_discovery_transport(self, client: reqwest::Client) -> Self {
22+
use crate::agent::http_transport::{
23+
dynamic_routing::{
24+
dynamic_route_provider::{DynamicRouteProviderBuilder, IC0_SEED_DOMAIN},
25+
node::Node,
26+
snapshot::latency_based_routing::LatencyRoutingSnapshot,
27+
},
28+
route_provider::RouteProvider,
29+
ReqwestTransport,
30+
};
3531

3632
// TODO: This is a temporary solution to get the seed node.
3733
let seed = Node::new(IC0_SEED_DOMAIN).unwrap();

ic-agent/src/agent/http_transport/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ const ICP0_SUB_DOMAIN: &str = ".icp0.io";
3030
const ICP_API_SUB_DOMAIN: &str = ".icp-api.io";
3131
#[allow(dead_code)]
3232
const LOCALHOST_SUB_DOMAIN: &str = ".localhost";
33-
///
34-
#[cfg(not(target_family = "wasm"))]
35-
#[cfg(feature = "reqwest")]
33+
#[cfg(all(feature = "reqwest", not(target_family = "wasm")))]
3634
pub mod dynamic_routing;
3735
pub mod route_provider;

0 commit comments

Comments
 (0)