diff --git a/Cargo.toml b/Cargo.toml index c0f52fc5..1e1917d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ libp2p-swarm = { version = "0.4.0-alpha.1", path = "swarm" } libp2p-uds = { version = "0.14.0-alpha.1", path = "transports/uds" } libp2p-wasm-ext = { version = "0.7.0-alpha.1", path = "transports/wasm-ext" } libp2p-yamux = { version = "0.14.0-alpha.1", path = "muxers/yamux" } -parking_lot = "0.9.0" +parking_lot = "0.10.0" smallvec = "1.0" wasm-timer = "0.2.4" diff --git a/core/Cargo.toml b/core/Cargo.toml index 1182120a..3bfb7522 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -12,9 +12,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] asn1_der = "0.6.1" bs58 = "0.3.0" -bytes = "0.5" ed25519-dalek = "1.0.0-pre.3" -failure = "0.1" fnv = "1.0" futures = { version = "0.3.1", features = ["compat", "io-compat", "executor", "thread-pool"] } futures-timer = "2" @@ -24,14 +22,14 @@ log = "0.4" multiaddr = { package = "parity-multiaddr", version = "0.7.0", path = "../misc/multiaddr" } multihash = { package = "parity-multihash", version = "0.2.1", path = "../misc/multihash" } multistream-select = { version = "0.7.0", path = "../misc/multistream-select" } -parking_lot = "0.9.0" +parking_lot = "0.10.0" pin-project = "0.4.6" protobuf = "=2.8.1" # note: see https://github.com/libp2p/rust-libp2p/issues/1363 -quick-error = "1.2" rand = "0.7" rw-stream-sink = { version = "0.2.0", path = "../misc/rw-stream-sink" } sha2 = "0.8.0" smallvec = "1.0" +thiserror = "1.0" unsigned-varint = "0.3" void = "1" zeroize = "1" diff --git a/core/src/identity/ed25519.rs b/core/src/identity/ed25519.rs index 17b1dc27..f68e5d03 100644 --- a/core/src/identity/ed25519.rs +++ b/core/src/identity/ed25519.rs @@ -21,7 +21,6 @@ //! Ed25519 keys. use ed25519_dalek as ed25519; -use failure::Fail; use rand::RngCore; use super::error::DecodingError; use zeroize::Zeroize; @@ -48,7 +47,7 @@ impl Keypair { pub fn decode(kp: &mut [u8]) -> Result { ed25519::Keypair::from_bytes(kp) .map(|k| { kp.zeroize(); Keypair(k) }) - .map_err(|e| DecodingError::new("Ed25519 keypair").source(e.compat())) + .map_err(|e| DecodingError::new("Ed25519 keypair").source(e)) } /// Sign a message using the private key of this keypair. @@ -120,7 +119,7 @@ impl PublicKey { /// Decode a public key from a byte array as produced by `encode`. pub fn decode(k: &[u8]) -> Result { ed25519::PublicKey::from_bytes(k) - .map_err(|e| DecodingError::new("Ed25519 public key").source(e.compat())) + .map_err(|e| DecodingError::new("Ed25519 public key").source(e)) .map(PublicKey) } } @@ -164,7 +163,7 @@ impl SecretKey { pub fn from_bytes(mut sk_bytes: impl AsMut<[u8]>) -> Result { let sk_bytes = sk_bytes.as_mut(); let secret = ed25519::SecretKey::from_bytes(&*sk_bytes) - .map_err(|e| DecodingError::new("Ed25519 secret key").source(e.compat()))?; + .map_err(|e| DecodingError::new("Ed25519 secret key").source(e))?; sk_bytes.zeroize(); Ok(SecretKey(secret)) } diff --git a/core/src/peer_id.rs b/core/src/peer_id.rs index ae659238..cb1ef39a 100644 --- a/core/src/peer_id.rs +++ b/core/src/peer_id.rs @@ -20,7 +20,7 @@ use crate::PublicKey; use bs58; -use quick_error::quick_error; +use thiserror::Error; use multihash; use std::{convert::TryFrom, fmt, str::FromStr}; @@ -218,18 +218,12 @@ impl Into for PeerId { } } -quick_error! { - #[derive(Debug)] - pub enum ParseError { - B58(e: bs58::decode::Error) { - display("base-58 decode error: {}", e) - cause(e) - from() - } - MultiHash { - display("decoding multihash failed") - } - } +#[derive(Debug, Error)] +pub enum ParseError { + #[error("base-58 decode error: {0}")] + B58(#[from] bs58::decode::Error), + #[error("decoding multihash failed")] + MultiHash, } impl FromStr for PeerId { diff --git a/misc/mdns/Cargo.toml b/misc/mdns/Cargo.toml index 43ee8e13..2e6a32c7 100644 --- a/misc/mdns/Cargo.toml +++ b/misc/mdns/Cargo.toml @@ -19,9 +19,8 @@ lazy_static = "1.2" libp2p-core = { version = "0.14.0-alpha.1", path = "../../core" } libp2p-swarm = { version = "0.4.0-alpha.1", path = "../../swarm" } log = "0.4" -multiaddr = { package = "parity-multiaddr", version = "0.7.0", path = "../multiaddr" } net2 = "0.2" -rand = "0.6" +rand = "0.7" smallvec = "1.0" void = "1.0" wasm-timer = "0.2.4" diff --git a/misc/mdns/src/service.rs b/misc/mdns/src/service.rs index 790855ec..8620c93e 100644 --- a/misc/mdns/src/service.rs +++ b/misc/mdns/src/service.rs @@ -23,8 +23,7 @@ use async_std::net::UdpSocket; use dns_parser::{Packet, RData}; use either::Either::{Left, Right}; use futures::{future, prelude::*}; -use libp2p_core::{Multiaddr, PeerId}; -use multiaddr::Protocol; +use libp2p_core::{multiaddr::{Multiaddr, Protocol}, PeerId}; use std::{fmt, io, net::Ipv4Addr, net::SocketAddr, str, time::{Duration, Instant}}; use wasm_timer::Interval; use lazy_static::lazy_static; @@ -550,11 +549,10 @@ impl fmt::Debug for MdnsPeer { #[cfg(test)] mod tests { use futures::executor::block_on; - use libp2p_core::PeerId; + use libp2p_core::{PeerId, multiaddr::multihash::*}; use std::{io::{Error, ErrorKind}, time::Duration}; use wasm_timer::ext::TryFutureExt; use crate::service::{MdnsPacket, MdnsService}; - use multiaddr::multihash::*; fn discover(peer_id: PeerId) { block_on(async { diff --git a/misc/multiaddr/Cargo.toml b/misc/multiaddr/Cargo.toml index a69d88a6..8b75d1da 100644 --- a/misc/multiaddr/Cargo.toml +++ b/misc/multiaddr/Cargo.toml @@ -22,8 +22,6 @@ url = { version = "2.1.0", default-features = false } [dev-dependencies] bincode = "1" -bs58 = "0.3.0" -data-encoding = "2" quickcheck = "0.9.0" rand = "0.7.2" serde_json = "1.0" diff --git a/muxers/mplex/Cargo.toml b/muxers/mplex/Cargo.toml index 0cbec20f..09ef4767 100644 --- a/muxers/mplex/Cargo.toml +++ b/muxers/mplex/Cargo.toml @@ -16,7 +16,7 @@ futures = "0.3.1" futures_codec = "0.3.4" libp2p-core = { version = "0.14.0-alpha.1", path = "../../core" } log = "0.4" -parking_lot = "0.9" +parking_lot = "0.10" unsigned-varint = { version = "0.3", features = ["futures-codec"] } [dev-dependencies] diff --git a/muxers/yamux/Cargo.toml b/muxers/yamux/Cargo.toml index b382e0d1..a536710c 100644 --- a/muxers/yamux/Cargo.toml +++ b/muxers/yamux/Cargo.toml @@ -13,6 +13,6 @@ categories = ["network-programming", "asynchronous"] futures = "0.3.1" libp2p-core = { version = "0.14.0-alpha.1", path = "../../core" } log = "0.4.8" -parking_lot = "0.9" +parking_lot = "0.10" thiserror = "1.0" yamux = "0.4" diff --git a/protocols/deflate/Cargo.toml b/protocols/deflate/Cargo.toml index abbb8ea0..257c4263 100644 --- a/protocols/deflate/Cargo.toml +++ b/protocols/deflate/Cargo.toml @@ -16,7 +16,6 @@ flate2 = "1.0" [dev-dependencies] async-std = "1.0" -env_logger = "0.7.1" libp2p-tcp = { version = "0.14.0-alpha.1", path = "../../transports/tcp" } rand = "0.7" quickcheck = "0.9" diff --git a/protocols/floodsub/Cargo.toml b/protocols/floodsub/Cargo.toml index e099f7b8..15b66877 100644 --- a/protocols/floodsub/Cargo.toml +++ b/protocols/floodsub/Cargo.toml @@ -11,7 +11,6 @@ categories = ["network-programming", "asynchronous"] [dependencies] bs58 = "0.3.0" -bytes = "0.5" cuckoofilter = "0.3.2" fnv = "1.0" futures = "0.3.1" diff --git a/protocols/identify/Cargo.toml b/protocols/identify/Cargo.toml index 53e75615..2594c8a6 100644 --- a/protocols/identify/Cargo.toml +++ b/protocols/identify/Cargo.toml @@ -10,21 +10,16 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -bytes = "0.5" -futures_codec = "0.3.4" futures = "0.3.1" libp2p-core = { version = "0.14.0-alpha.1", path = "../../core" } libp2p-swarm = { version = "0.4.0-alpha.1", path = "../../swarm" } log = "0.4.1" -multiaddr = { package = "parity-multiaddr", version = "0.7.0", path = "../../misc/multiaddr" } protobuf = "=2.8.1" # note: see https://github.com/libp2p/rust-libp2p/issues/1363 smallvec = "1.0" wasm-timer = "0.2" -unsigned-varint = { version = "0.3", features = ["futures-codec"] } [dev-dependencies] async-std = "1.0" libp2p-mplex = { version = "0.14.0-alpha.1", path = "../../muxers/mplex" } libp2p-secio = { version = "0.14.0-alpha.1", path = "../../protocols/secio" } libp2p-tcp = { version = "0.14.0-alpha.1", path = "../../transports/tcp" } -rand = "0.6" diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index 24bc8839..27c99a6f 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -19,7 +19,6 @@ futures = "0.3.1" log = "0.4" libp2p-core = { version = "0.14.0-alpha.1", path = "../../core" } libp2p-swarm = { version = "0.4.0-alpha.1", path = "../../swarm" } -multiaddr = { package = "parity-multiaddr", version = "0.7.0", path = "../../misc/multiaddr" } multihash = { package = "parity-multihash", version = "0.2.1", path = "../../misc/multihash" } protobuf = "=2.8.1" # note: see https://github.com/libp2p/rust-libp2p/issues/1363 rand = "0.7.2" @@ -32,7 +31,5 @@ void = "1.0" [dev-dependencies] libp2p-secio = { version = "0.14.0-alpha.1", path = "../secio" } -libp2p-tcp = { version = "0.14.0-alpha.1", path = "../../transports/tcp" } libp2p-yamux = { version = "0.14.0-alpha.1", path = "../../muxers/yamux" } quickcheck = "0.9.0" -rand = "0.7.2" diff --git a/protocols/noise/Cargo.toml b/protocols/noise/Cargo.toml index 84c862b9..68fdaed1 100644 --- a/protocols/noise/Cargo.toml +++ b/protocols/noise/Cargo.toml @@ -8,7 +8,6 @@ repository = "https://github.com/libp2p/rust-libp2p" edition = "2018" [dependencies] -bytes = "0.5" curve25519-dalek = "1" futures = "0.3.1" lazy_static = "1.2" @@ -25,5 +24,4 @@ zeroize = "1" env_logger = "0.7.1" libp2p-tcp = { version = "0.14.0-alpha.1", path = "../../transports/tcp" } quickcheck = "0.9.0" -tokio = "0.1" sodiumoxide = "^0.2.5" diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index 026ba309..61eae9df 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -10,12 +10,10 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -bytes = "0.5" futures = "0.3.1" libp2p-core = { version = "0.14.0-alpha.1", path = "../../core" } libp2p-swarm = { version = "0.4.0-alpha.1", path = "../../swarm" } log = "0.4.1" -multiaddr = { package = "parity-multiaddr", version = "0.7.0", path = "../../misc/multiaddr" } rand = "0.7.2" void = "1.0" wasm-timer = "0.2" diff --git a/protocols/plaintext/Cargo.toml b/protocols/plaintext/Cargo.toml index 6e4bba75..38d60407 100644 --- a/protocols/plaintext/Cargo.toml +++ b/protocols/plaintext/Cargo.toml @@ -24,4 +24,3 @@ void = "1.0.2" env_logger = "0.7.1" quickcheck = "0.9.0" rand = "0.7" -futures-timer = "2.0" diff --git a/protocols/secio/Cargo.toml b/protocols/secio/Cargo.toml index 8e7cdfab..82222431 100644 --- a/protocols/secio/Cargo.toml +++ b/protocols/secio/Cargo.toml @@ -28,7 +28,6 @@ twofish = "0.2.0" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] ring = { version = "0.16.9", features = ["alloc"], default-features = false } -untrusted = "0.7.0" [target.'cfg(target_arch = "wasm32")'.dependencies] js-sys = "0.3.10" diff --git a/transports/tcp/Cargo.toml b/transports/tcp/Cargo.toml index 77a7a887..a9e2a2aa 100644 --- a/transports/tcp/Cargo.toml +++ b/transports/tcp/Cargo.toml @@ -11,7 +11,6 @@ categories = ["network-programming", "asynchronous"] [dependencies] async-std = "1.0" -bytes = "0.5" futures = "0.3.1" futures-timer = "2.0" get_if_addrs = "0.5.3"