Skip to content

Commit

Permalink
fix: also fix URL in PkarrResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Frando committed Jul 5, 2024
1 parent 2fcb091 commit 2ae9f46
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions iroh-net/src/discovery/pkarr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,15 @@ impl PkarrResolver {
}
}

/// Create a config that resolves using the n0 dns server through [`N0_DNS_PKARR_RELAY`].
/// Create a pkarr resolver which uses the [`N0_DNS_PKARR_RELAY_PROD`] pkarr relay and in testing
/// uses [`N0_DNS_PKARR_RELAY_STAGING`].
pub fn n0_dns() -> Self {
let pkarr_relay: Url = N0_DNS_PKARR_RELAY_PROD.parse().expect("url is valid");
#[cfg(not(any(test, feature = "test-utils")))]
let pkarr_relay = N0_DNS_PKARR_RELAY_PROD;
#[cfg(any(test, feature = "test-utils"))]
let pkarr_relay = N0_DNS_PKARR_RELAY_STAGING;

let pkarr_relay: Url = pkarr_relay.parse().expect("url is valid");
Self::new(pkarr_relay)
}
}
Expand Down

0 comments on commit 2ae9f46

Please sign in to comment.