Update some dependenices; Remove some useless dependencies (#1387)

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
Qinxuan Chen
2020-01-10 21:03:59 +08:00
committed by Pierre Krieger
parent 655609dfe0
commit af464e18c5
18 changed files with 18 additions and 49 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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<Keypair, DecodingError> {
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<PublicKey, DecodingError> {
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<SecretKey, DecodingError> {
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))
}

View File

@ -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<multihash::Multihash> 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 {

View File

@ -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"

View File

@ -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 {

View File

@ -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"

View File

@ -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]

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -24,4 +24,3 @@ void = "1.0.2"
env_logger = "0.7.1"
quickcheck = "0.9.0"
rand = "0.7"
futures-timer = "2.0"

View File

@ -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"

View File

@ -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"