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:
Pierre Krieger
2019-07-11 16:58:30 +02:00
committed by Bastian Köcher
parent f5e921281e
commit bf2551a854
28 changed files with 249 additions and 112 deletions
+2
View File
@@ -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(()))
);