Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Frando committed Jun 29, 2023
1 parent 6d83ceb commit ff41242
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
3 changes: 1 addition & 2 deletions iroh-net/src/hp/magicsock/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2442,12 +2442,11 @@ pub(crate) mod tests {

use super::*;
use crate::{
MagicEndpoint,
hp::{
derp::{DerpNode, DerpRegion, UseIpv4, UseIpv6},
stun,
},
tls,
tls, MagicEndpoint,
};

fn make_transmit(destination: SocketAddr) -> quinn_udp::Transmit {
Expand Down
2 changes: 1 addition & 1 deletion iroh-net/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![recursion_limit = "256"]

pub mod defaults;
pub mod magic_endpoint;
pub mod hp;
pub mod magic_endpoint;
pub mod net;
pub mod tls;
pub mod util;
Expand Down
5 changes: 2 additions & 3 deletions iroh-net/src/magic_endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,7 @@ impl MagicEndpoint {
alpn: &[u8],
known_addrs: &[SocketAddr],
) -> anyhow::Result<quinn::Connection> {
if !known_addrs.is_empty() {
self.add_known_addrs(peer_id, known_addrs).await?;
}
self.add_known_addrs(peer_id, known_addrs).await?;

let node_key: hp::key::node::PublicKey = peer_id.into();
let addr = self
Expand Down Expand Up @@ -336,6 +334,7 @@ impl MagicEndpoint {
netmap.peers.push(peer);
netmap.clone()
};

self.conn.set_network_map(netmap).await?;
Ok(())
}
Expand Down
3 changes: 2 additions & 1 deletion iroh/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ pub fn create_quinn_client(
keylog: bool,
) -> Result<quinn::Endpoint> {
let keypair = iroh_net::tls::Keypair::generate();
let tls_client_config = iroh_net::tls::make_client_config(&keypair, None, alpn_protocols, keylog)?;
let tls_client_config =
iroh_net::tls::make_client_config(&keypair, None, alpn_protocols, keylog)?;
let mut client_config = quinn::ClientConfig::new(Arc::new(tls_client_config));
let mut endpoint = quinn::Endpoint::client(bind_addr)?;
let mut transport_config = quinn::TransportConfig::default();
Expand Down
2 changes: 1 addition & 1 deletion iroh/src/commands/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ use clap::Subcommand;
use indicatif::{HumanBytes, MultiProgress, ProgressBar};
use iroh_bytes::tokio_util::ProgressWriter;
use iroh_net::{
MagicEndpoint,
hp::{
self,
derp::{DerpMap, UseIpv4, UseIpv6},
key::node::SecretKey,
},
tls::{Keypair, PeerId, PublicKey},
MagicEndpoint,
};
use postcard::experimental::max_size::MaxSize;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion iroh/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ use iroh_bytes::{
util::{Hash, Progress},
};
use iroh_net::{
MagicEndpoint,
hp::{cfg::Endpoint, derp::DerpMap},
tls::{self, Keypair, PeerId},
MagicEndpoint,
};
use quic_rpc::server::RpcChannel;
use quic_rpc::transport::flume::FlumeConnection;
Expand Down
3 changes: 2 additions & 1 deletion iroh/tests/provide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ async fn test_run_fsm() {
let addrs = node.local_endpoint_addresses().await.unwrap();
let peer_id = node.peer_id();
tokio::time::timeout(Duration::from_secs(10), async move {
let connection = MagicEndpoint::dial_peer(peer_id, &iroh_bytes::P2P_ALPN, &addrs, None, true).await?;
let connection =
MagicEndpoint::dial_peer(peer_id, &iroh_bytes::P2P_ALPN, &addrs, None, true).await?;
let request = GetRequest::all(hash).into();
let stream = get::run_connection(connection, request);
let (collection, children, _) = aggregate_get_response(stream).await?;
Expand Down

0 comments on commit ff41242

Please sign in to comment.