Upgrade from futures-preview to futures 0.3.1, and remove futures 0.1 where currently possible (#4083)

* Migrate node and node-template

* Migrate srml

* Simple changes

* Add async-std for interval

* Fix test-runtime warning

* Small changes

* move futures01 in core/rpc to dev-deps

* Change wasm CI builds

* Switch to async-std 1.0.1

* Remove async-std dep of network

* Add modified lockfile

* Fix node cli browser build

* Remove authority-discovery async-std dep

* Add Send + Sync to interval dyn stream
This commit is contained in:
Ashley
2019-11-22 13:06:23 +01:00
committed by Gavin Wood
parent 795701608c
commit 1735683cc9
57 changed files with 240 additions and 224 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ client-api = { package = "substrate-client-api", path = "../api" }
client = { package = "substrate-client", path = "../" }
sr-api = { path = "../../primitives/sr-api" }
codec = { package = "parity-scale-codec", version = "1.0.0" }
futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] }
futures = { version = "0.3.1", features = ["compat"] }
jsonrpc-pubsub = "14.0.3"
log = "0.4.8"
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
@@ -29,7 +29,7 @@ parking_lot = { version = "0.9.0" }
[dev-dependencies]
assert_matches = "1.3.0"
futures = "0.1.29"
futures01 = { package = "futures", version = "0.1.29" }
network = { package = "substrate-network", path = "../network" }
rustc-hex = "2.0.1"
sr-io = { path = "../../primitives/sr-io" }
+1 -1
View File
@@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
codec = { package = "parity-scale-codec", version = "1.0.0" }
derive_more = "0.15.0"
futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] }
futures = { version = "0.3.1", features = ["compat"] }
jsonrpc-core = "14.0.3"
jsonrpc-core-client = "14.0.3"
jsonrpc-derive = "14.0.3"
+1 -1
View File
@@ -15,7 +15,7 @@
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use jsonrpc_core::futures::prelude::*;
use futures03::{channel::oneshot, compat::Compat};
use futures::{channel::oneshot, compat::Compat};
/// Wraps around `oneshot::Receiver` and adjusts the error type to produce an internal error if the
/// sender gets dropped.
+2 -2
View File
@@ -20,7 +20,7 @@
mod tests;
use std::{sync::Arc, convert::TryInto};
use futures03::future::{FutureExt, TryFutureExt};
use futures::future::{FutureExt, TryFutureExt};
use log::warn;
use client::Client;
@@ -30,7 +30,7 @@ use rpc::futures::{
Sink, Future,
future::result,
};
use futures03::{StreamExt as _, compat::Compat, future::ready};
use futures::{StreamExt as _, compat::Compat, future::ready};
use api::Subscriptions;
use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId};
use codec::{Encode, Decode};
@@ -17,7 +17,7 @@
//! Blockchain API backend for light nodes.
use std::sync::Arc;
use futures03::{future::ready, FutureExt, TryFutureExt};
use futures::{future::ready, FutureExt, TryFutureExt};
use rpc::futures::future::{result, Future, Either};
use api::Subscriptions;
+1 -1
View File
@@ -23,7 +23,7 @@ mod chain_light;
mod tests;
use std::sync::Arc;
use futures03::{future, StreamExt as _, TryStreamExt as _};
use futures::{future, StreamExt, TryStreamExt};
use log::warn;
use rpc::{
Result as RpcResult,
+1 -1
View File
@@ -19,7 +19,7 @@
use std::collections::{BTreeMap, HashMap};
use std::sync::Arc;
use std::ops::Range;
use futures03::{future, StreamExt as _, TryStreamExt as _};
use futures::{future, StreamExt as _, TryStreamExt as _};
use log::warn;
use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId};
use rpc::{
@@ -21,7 +21,7 @@ use std::{
collections::{HashSet, HashMap, hash_map::Entry},
};
use codec::Decode;
use futures03::{
use futures::{
future::{ready, Either},
channel::oneshot::{channel, Sender},
FutureExt, TryFutureExt,
@@ -753,7 +753,7 @@ mod tests {
#[test]
fn maybe_share_remote_request_shares_request() {
type UnreachableFuture = futures03::future::Ready<Result<u32, Error>>;
type UnreachableFuture = futures::future::Ready<Result<u32, Error>>;
let shared_requests = SimpleSubscriptions::default();
+1 -1
View File
@@ -20,7 +20,7 @@ use self::error::Error;
use std::sync::Arc;
use assert_matches::assert_matches;
use futures::stream::Stream;
use futures01::stream::Stream;
use primitives::storage::well_known_keys;
use sr_io::hashing::blake2_256;
use test_client::{
+1 -1
View File
@@ -19,7 +19,7 @@
#[cfg(test)]
mod tests;
use futures03::{channel::{mpsc, oneshot}, compat::Compat};
use futures::{channel::{mpsc, oneshot}, compat::Compat};
use api::Receiver;
use sr_primitives::traits::{self, Header as HeaderT};
use self::error::Result;
+3 -3
View File
@@ -20,7 +20,7 @@ use network::{self, PeerId};
use network::config::Roles;
use test_client::runtime::Block;
use assert_matches::assert_matches;
use futures03::{prelude::*, channel::mpsc};
use futures::{prelude::*, channel::mpsc};
use std::thread;
struct Status {
@@ -46,7 +46,7 @@ fn api<T: Into<Option<Status>>>(sync: T) -> System<Block> {
let should_have_peers = !status.is_dev;
let (tx, rx) = mpsc::unbounded();
thread::spawn(move || {
futures03::executor::block_on(rx.for_each(move |request| {
futures::executor::block_on(rx.for_each(move |request| {
match request {
Request::Health(sender) => {
let _ = sender.send(Health {
@@ -231,4 +231,4 @@ fn system_node_roles() {
wait_receiver(api(None).system_node_roles()),
vec![NodeRole::Authority]
);
}
}