diff --git a/protocols/dcutr/CHANGELOG.md b/protocols/dcutr/CHANGELOG.md index 8f98e3257d6..dabd0ffbd49 100644 --- a/protocols/dcutr/CHANGELOG.md +++ b/protocols/dcutr/CHANGELOG.md @@ -4,6 +4,10 @@ - Update to `libp2p-swarm` `v0.40.0`. +- Fix WASM compilation. See [PR 2991]. + +[PR 2991]: https://github.com/libp2p/rust-libp2p/pull/2991/ + # 0.6.0 - Update to `libp2p-swarm` `v0.39.0`. diff --git a/protocols/dcutr/src/protocol/outbound.rs b/protocols/dcutr/src/protocol/outbound.rs index dc55aa414d9..a0ea8449fe4 100644 --- a/protocols/dcutr/src/protocol/outbound.rs +++ b/protocols/dcutr/src/protocol/outbound.rs @@ -22,11 +22,11 @@ use crate::message_proto::{hole_punch, HolePunch}; use asynchronous_codec::Framed; use futures::{future::BoxFuture, prelude::*}; use futures_timer::Delay; +use instant::Instant; use libp2p_core::{multiaddr::Protocol, upgrade, Multiaddr}; use libp2p_swarm::NegotiatedSubstream; use std::convert::TryFrom; use std::iter; -use std::time::Instant; use thiserror::Error; pub struct Upgrade { diff --git a/protocols/relay/CHANGELOG.md b/protocols/relay/CHANGELOG.md index 9937fffec0e..9c4df7c9c3e 100644 --- a/protocols/relay/CHANGELOG.md +++ b/protocols/relay/CHANGELOG.md @@ -4,6 +4,10 @@ - Update to `libp2p-swarm` `v0.40.0`. +- Fix WASM compilation. See [PR 2991]. + +[PR 2991]: https://github.com/libp2p/rust-libp2p/pull/2991/ + # 0.12.0 - Update to `libp2p-swarm` `v0.39.0`. diff --git a/protocols/relay/src/v2/protocol/inbound_hop.rs b/protocols/relay/src/v2/protocol/inbound_hop.rs index 893ae916e1c..2a6cf01c565 100644 --- a/protocols/relay/src/v2/protocol/inbound_hop.rs +++ b/protocols/relay/src/v2/protocol/inbound_hop.rs @@ -23,11 +23,11 @@ use crate::v2::protocol::{HOP_PROTOCOL_NAME, MAX_MESSAGE_SIZE}; use asynchronous_codec::{Framed, FramedParts}; use bytes::Bytes; use futures::{future::BoxFuture, prelude::*}; +use instant::{Duration, SystemTime}; use libp2p_core::{upgrade, Multiaddr, PeerId}; use libp2p_swarm::NegotiatedSubstream; use std::convert::TryInto; use std::iter; -use std::time::{Duration, SystemTime, UNIX_EPOCH}; use thiserror::Error; pub struct Upgrade { @@ -142,7 +142,7 @@ impl ReservationReq { reservation: Some(Reservation { addrs: addrs.into_iter().map(|a| a.to_vec()).collect(), expire: (SystemTime::now() + self.reservation_duration) - .duration_since(UNIX_EPOCH) + .duration_since(SystemTime::UNIX_EPOCH) .unwrap() .as_secs(), voucher: None, diff --git a/protocols/relay/src/v2/protocol/outbound_hop.rs b/protocols/relay/src/v2/protocol/outbound_hop.rs index 9a20a1aa000..c8381df31a5 100644 --- a/protocols/relay/src/v2/protocol/outbound_hop.rs +++ b/protocols/relay/src/v2/protocol/outbound_hop.rs @@ -24,11 +24,11 @@ use asynchronous_codec::{Framed, FramedParts}; use bytes::Bytes; use futures::{future::BoxFuture, prelude::*}; use futures_timer::Delay; +use instant::{Duration, SystemTime}; use libp2p_core::{upgrade, Multiaddr, PeerId}; use libp2p_swarm::NegotiatedSubstream; use std::convert::TryFrom; use std::iter; -use std::time::{Duration, SystemTime, UNIX_EPOCH}; use thiserror::Error; pub enum Upgrade { @@ -134,7 +134,7 @@ impl upgrade::OutboundUpgrade for Upgrade { .expire .checked_sub( SystemTime::now() - .duration_since(UNIX_EPOCH) + .duration_since(SystemTime::UNIX_EPOCH) .unwrap() .as_secs(), )