Skip to content

Commit

Permalink
respect feature flag in builder.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Sep 23, 2024
1 parent d8454d2 commit adc41db
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions ic-agent/src/agent/builder.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
use url::Url;

use crate::{
agent::{
agent_config::AgentConfig,
route_provider::dynamic_routing::{
dynamic_route_provider::{DynamicRouteProviderBuilder, IC0_SEED_DOMAIN},
node::Node,
snapshot::latency_based_routing::LatencyRoutingSnapshot,
},
Agent,
},
agent::{agent_config::AgentConfig, Agent},
AgentError, Identity, NonceFactory, NonceGenerator,
};
use reqwest::Client;
use std::sync::Arc;

use super::route_provider::RouteProvider;
Expand All @@ -29,8 +20,14 @@ impl AgentBuilder {
Agent::new(self.config)
}

/// 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.
pub async fn with_discovery_transport(self, client: Client) -> Self {
/// Set the dynamic transport layer for the [`Agent`], performing continuous discovery of the API boundary nodes and routing traffic via them based on latency.
#[cfg(feature = "_internal_dynamic-routing")]
pub async fn with_discovery_transport(self, client: reqwest::Client) -> Self {
use crate::agent::route_provider::dynamic_routing::{
dynamic_route_provider::{DynamicRouteProviderBuilder, IC0_SEED_DOMAIN},
node::Node,
snapshot::latency_based_routing::LatencyRoutingSnapshot,
};
// TODO: This is a temporary solution to get the seed node.
let seed = Node::new(IC0_SEED_DOMAIN).unwrap();

Expand Down

0 comments on commit adc41db

Please sign in to comment.