Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update multistream-select to stable futures #1484

Merged
merged 4 commits into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bs58 = "0.3.0"
ed25519-dalek = "1.0.0-pre.3"
either = "1.5"
fnv = "1.0"
futures = { version = "0.3.1", features = ["compat", "io-compat", "executor", "thread-pool"] }
futures = { version = "0.3.1", features = ["executor", "thread-pool"] }
futures-timer = "3"
lazy_static = "1.2"
libsecp256k1 = { version = "0.3.1", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ mod keys_proto {

/// Multi-address re-export.
pub use multiaddr;
pub type Negotiated<T> = futures::compat::Compat01As03<multistream_select::Negotiated<futures::compat::Compat<T>>>;
pub type Negotiated<T> = multistream_select::Negotiated<T>;

mod peer_id;
mod translation;
Expand Down
14 changes: 7 additions & 7 deletions core/src/upgrade/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

use crate::{ConnectedPoint, Negotiated};
use crate::upgrade::{InboundUpgrade, OutboundUpgrade, UpgradeError, ProtocolName};
use futures::{future::Either, prelude::*, compat::Compat, compat::Compat01As03, compat::Future01CompatExt};
use futures::{future::Either, prelude::*};
use log::debug;
use multistream_select::{self, DialerSelectFuture, ListenerSelectFuture};
use std::{iter, mem, pin::Pin, task::Context, task::Poll};
Expand Down Expand Up @@ -48,7 +48,7 @@ where
U: InboundUpgrade<Negotiated<C>>,
{
let iter = up.protocol_info().into_iter().map(NameWrap as fn(_) -> NameWrap<_>);
let future = multistream_select::listener_select_proto(Compat::new(conn), iter).compat();
let future = multistream_select::listener_select_proto(conn, iter);
InboundUpgradeApply {
inner: InboundUpgradeApplyState::Init { future, upgrade: up }
}
Expand All @@ -61,7 +61,7 @@ where
U: OutboundUpgrade<Negotiated<C>>
{
let iter = up.protocol_info().into_iter().map(NameWrap as fn(_) -> NameWrap<_>);
let future = multistream_select::dialer_select_proto(Compat::new(conn), iter, v).compat();
let future = multistream_select::dialer_select_proto(conn, iter, v);
OutboundUpgradeApply {
inner: OutboundUpgradeApplyState::Init { future, upgrade: up }
}
Expand All @@ -82,7 +82,7 @@ where
U: InboundUpgrade<Negotiated<C>>,
{
Init {
future: Compat01As03<ListenerSelectFuture<Compat<C>, NameWrap<U::Info>>>,
future: ListenerSelectFuture<C, NameWrap<U::Info>>,
upgrade: U,
},
Upgrade {
Expand Down Expand Up @@ -117,7 +117,7 @@ where
}
};
self.inner = InboundUpgradeApplyState::Upgrade {
future: Box::pin(upgrade.upgrade_inbound(Compat01As03::new(io), info.0))
future: Box::pin(upgrade.upgrade_inbound(io, info.0))
};
}
InboundUpgradeApplyState::Upgrade { mut future } => {
Expand Down Expand Up @@ -158,7 +158,7 @@ where
U: OutboundUpgrade<Negotiated<C>>
{
Init {
future: Compat01As03<DialerSelectFuture<Compat<C>, NameWrapIter<<U::InfoIter as IntoIterator>::IntoIter>>>,
future: DialerSelectFuture<C, NameWrapIter<<U::InfoIter as IntoIterator>::IntoIter>>,
upgrade: U
},
Upgrade {
Expand Down Expand Up @@ -193,7 +193,7 @@ where
}
};
self.inner = OutboundUpgradeApplyState::Upgrade {
future: Box::pin(upgrade.upgrade_outbound(Compat01As03::new(connection), info.0))
future: Box::pin(upgrade.upgrade_outbound(connection, info.0))
};
}
OutboundUpgradeApplyState::Upgrade { mut future } => {
Expand Down
10 changes: 5 additions & 5 deletions misc/multistream-select/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ edition = "2018"

[dependencies]
bytes = "0.5"
futures = "0.1"
futures = "0.3"
log = "0.4"
pin-project = "0.4.8"
smallvec = "1.0"
tokio-io = "0.1"
unsigned-varint = "0.3"
unsigned-varint = "0.3.2"

[dev-dependencies]
tokio = "0.1"
tokio-tcp = "0.1"
async-std = "1.2"
quickcheck = "0.9.0"
rand = "0.7.2"
rw-stream-sink = "0.2.1"
Loading