Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions iroh/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,12 +893,10 @@ mod tests {
let (ep2, _guard2) =
new_endpoint(&mut rng, |ep| disco_shared.create_discovery(ep.id())).await;

let ep1_wrong_addr = EndpointAddr {
id: ep1.id(),
addrs: [TransportAddr::Ip("240.0.0.1:1000".parse().unwrap())]
.into_iter()
.collect(),
};
let ep1_wrong_addr = EndpointAddr::from_parts(
ep1.id(),
[TransportAddr::Ip("240.0.0.1:1000".parse().unwrap())],
);
let _conn = ep2.connect(ep1_wrong_addr, TEST_ALPN).await?;
Ok(())
}
Expand Down Expand Up @@ -1043,10 +1041,7 @@ mod test_dns_pkarr {
.await?;
println!("resolved {resolved:?}");

let expected_addr = EndpointAddr {
id: endpoint_id,
addrs: relay_url.into_iter().collect(),
};
let expected_addr = EndpointAddr::from_parts(endpoint_id, relay_url);

assert_eq!(resolved.to_endpoint_addr(), expected_addr);
assert_eq!(resolved.user_data(), Some(&user_data));
Expand Down
20 changes: 8 additions & 12 deletions iroh/src/discovery/static_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,10 @@ mod tests {
.await?;

let key = SecretKey::from_bytes(&[0u8; 32]);
let addr = EndpointAddr {
id: key.public(),
addrs: [TransportAddr::Relay("https://example.com".parse()?)]
.into_iter()
.collect(),
};
let addr = EndpointAddr::from_parts(
key.public(),
[TransportAddr::Relay("https://example.com".parse()?)],
);
let user_data = Some("foobar".parse().unwrap());
let endpoint_info = EndpointInfo::from(addr.clone()).with_user_data(user_data.clone());
discovery.add_endpoint_info(endpoint_info.clone());
Expand All @@ -280,12 +278,10 @@ mod tests {
async fn test_provenance() -> Result {
let discovery = StaticProvider::with_provenance("foo");
let key = SecretKey::from_bytes(&[0u8; 32]);
let addr = EndpointAddr {
id: key.public(),
addrs: [TransportAddr::Relay("https://example.com".parse()?)]
.into_iter()
.collect(),
};
let addr = EndpointAddr::from_parts(
key.public(),
[TransportAddr::Relay("https://example.com".parse()?)],
);
discovery.add_endpoint_info(addr);
let mut stream = discovery.resolve(key.public()).unwrap();
let item = stream.next().await.unwrap()?;
Expand Down
4 changes: 2 additions & 2 deletions iroh/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ pub use quinn_proto::{

pub use self::connection::{
Accept, Accepting, AlpnError, AuthenticationError, Connecting, ConnectingError, Connection,
Incoming, IncomingZeroRttConnection, OutgoingZeroRttConnection, RemoteEndpointIdError,
ZeroRttStatus,
ConnectionState, HandshakeCompleted, Incoming, IncomingZeroRtt, IncomingZeroRttConnection,
OutgoingZeroRtt, OutgoingZeroRttConnection, RemoteEndpointIdError, ZeroRttStatus,
};
pub use crate::magicsock::transports::TransportConfig;

Expand Down
Loading
Loading