mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-12-24 06:59:36 -05:00
Bump to libp2p v29
This commit is contained in:
parent
ad006fae6a
commit
2059158dad
@ -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"
|
||||
|
@ -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<SwapTransport> {
|
||||
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<DnsErr<io::Error>, UpgradeError<NoiseError>>,
|
||||
UpgradeError<EitherError<io::Error, io::Error>>,
|
||||
>,
|
||||
>,
|
||||
>;
|
||||
pub type SwapTransport = Boxed<(PeerId, StreamMuxerBox)>;
|
||||
|
Loading…
Reference in New Issue
Block a user