mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 16:51:03 +00:00
Switch the client to new futures (#3103)
* Switch the client to new futures * No need for compat in the client * Fix client tests * Address review
This commit is contained in:
committed by
Bastian Köcher
parent
f5e921281e
commit
bf2551a854
@@ -25,6 +25,7 @@ parking_lot = "0.8.0"
|
||||
log = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
futures03 = { package = "futures-preview", version = "0.3.0-alpha.17", features = ["compat"] }
|
||||
keyring = { package = "substrate-keyring", path = "../../keyring" }
|
||||
substrate-executor = { path = "../../executor" }
|
||||
network = { package = "substrate-network", path = "../../network", features = ["test-helpers"]}
|
||||
|
||||
@@ -709,6 +709,7 @@ pub fn import_queue<B, C, P>(
|
||||
mod tests {
|
||||
use super::*;
|
||||
use futures::{Async, stream::Stream as _};
|
||||
use futures03::{StreamExt as _, TryStreamExt as _};
|
||||
use consensus_common::NoNetwork as DummyOracle;
|
||||
use network::test::*;
|
||||
use network::test::{Block as TestBlock, PeersClient, PeersFullClient};
|
||||
@@ -838,6 +839,7 @@ mod tests {
|
||||
let environ = Arc::new(DummyFactory(client.clone()));
|
||||
import_notifications.push(
|
||||
client.import_notification_stream()
|
||||
.map(|v| Ok::<_, ()>(v)).compat()
|
||||
.take_while(|n| Ok(!(n.origin != BlockOrigin::Own && n.header.number() < &5)))
|
||||
.for_each(move |_| Ok(()))
|
||||
);
|
||||
|
||||
@@ -28,6 +28,7 @@ rand = "0.6.5"
|
||||
merlin = "1.0.3"
|
||||
|
||||
[dev-dependencies]
|
||||
futures03 = { package = "futures-preview", version = "0.3.0-alpha.17", features = ["compat"] }
|
||||
keyring = { package = "substrate-keyring", path = "../../keyring" }
|
||||
substrate-executor = { path = "../../executor" }
|
||||
network = { package = "substrate-network", path = "../../network", features = ["test-helpers"]}
|
||||
|
||||
@@ -878,6 +878,7 @@ mod tests {
|
||||
use client::BlockchainEvents;
|
||||
use test_client;
|
||||
use futures::{Async, stream::Stream as _};
|
||||
use futures03::{StreamExt as _, TryStreamExt as _};
|
||||
use log::debug;
|
||||
use std::time::Duration;
|
||||
type Item = generic::DigestItem<Hash>;
|
||||
@@ -1005,6 +1006,7 @@ mod tests {
|
||||
let environ = Arc::new(DummyFactory(client.clone()));
|
||||
import_notifications.push(
|
||||
client.import_notification_stream()
|
||||
.map(|v| Ok::<_, ()>(v)).compat()
|
||||
.take_while(|n| Ok(!(n.origin != BlockOrigin::Own && n.header.number() < &5)))
|
||||
.for_each(move |_| Ok(()))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user