mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-22 20:51:16 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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::{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user