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 -1
View File
@@ -20,6 +20,7 @@ use ansi_term::Colour;
use std::fmt;
use std::time;
use futures::{Future, Stream};
use futures03::{StreamExt as _, TryStreamExt as _};
use service::{Service, Components};
use tokio::runtime::TaskExecutor;
use network::SyncState;
@@ -81,7 +82,7 @@ where C: Components {
Some((info.chain.best_number, info.chain.best_hash))
};
let display_block_import = client.import_notification_stream().for_each(move |n| {
let display_block_import = client.import_notification_stream().map(|v| Ok::<_, ()>(v)).compat().for_each(move |n| {
// detect and log reorganizations.
if let Some((ref last_num, ref last_hash)) = last {
if n.header.parent_hash() != last_hash {