diff --git a/swap/Cargo.toml b/swap/Cargo.toml index 7bfb32ea..5efe6e57 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -15,8 +15,8 @@ bitcoin = { version = "0.23", features = ["rand", "use-serde"] } # TODO: Upgrade bitcoin-harness = { git = "https://github.com/coblox/bitcoin-harness-rs", rev = "d402b36d3d6406150e3bfb71492ff4a0a7cb290e" } derivative = "2" futures = { version = "0.3", default-features = false } -libp2p = { version = "0.28", default-features = false, features = ["tcp-tokio", "yamux", "mplex", "dns", "noise", "request-response"] } -libp2p-tokio-socks5 = "0.3" +libp2p = { version = "0.29", default-features = false, features = ["tcp-tokio", "yamux", "mplex", "dns", "noise", "request-response"] } +libp2p-tokio-socks5 = "0.4" log = { version = "0.4", features = ["serde"] } monero = "0.9" rand = "0.7" diff --git a/swap/src/network/transport.rs b/swap/src/network/transport.rs index 60d9b3ce..22392fd2 100644 --- a/swap/src/network/transport.rs +++ b/swap/src/network/transport.rs @@ -1,20 +1,18 @@ use anyhow::Result; use libp2p::{ core::{ - either::EitherError, identity, muxing::StreamMuxerBox, - transport::{boxed::Boxed, timeout::TransportTimeoutError}, + transport::Boxed, upgrade::{SelectUpgrade, Version}, - Transport, UpgradeError, + Transport, }, - dns::{DnsConfig, DnsErr}, + dns::DnsConfig, mplex::MplexConfig, - noise::{self, NoiseConfig, NoiseError, X25519Spec}, + noise::{self, NoiseConfig, X25519Spec}, tcp::TokioTcpConfig, yamux, PeerId, }; -use std::{io, time::Duration}; /// Builds a libp2p transport with the following features: /// - TcpConnection @@ -36,18 +34,9 @@ pub fn build(id_keys: identity::Keypair) -> Result { MplexConfig::new(), )) .map(|(peer, muxer), _| (peer, StreamMuxerBox::new(muxer))) - .timeout(Duration::from_secs(20)) .boxed(); Ok(transport) } -pub type SwapTransport = Boxed< - (PeerId, StreamMuxerBox), - TransportTimeoutError< - EitherError< - EitherError, UpgradeError>, - UpgradeError>, - >, - >, ->; +pub type SwapTransport = Boxed<(PeerId, StreamMuxerBox)>;