Switch consensus crates to new futures (#3146)

* Switch consensus-common to new futures

* Fix tests

* More tests fixing

* Fix Babe tests

* Fix Babe tests
This commit is contained in:
Pierre Krieger
2019-07-25 04:55:50 +02:00
committed by Gavin Wood
parent 3a6a309d84
commit b31dcdf342
21 changed files with 208 additions and 184 deletions
+5 -1
View File
@@ -18,6 +18,7 @@
use std::{self, io::{Read, Write}};
use futures::prelude::*;
use futures03::TryFutureExt as _;
use log::{info, warn};
use runtime_primitives::generic::{SignedBlock, BlockId};
@@ -193,7 +194,10 @@ pub fn import_blocks<F, E, R>(
}
let blocks_before = link.imported_blocks;
queue.poll_actions(&mut link);
let _ = futures03::future::poll_fn(|cx| {
queue.poll_actions(cx, &mut link);
std::task::Poll::Pending::<Result<(), ()>>
}).compat().poll();
if link.imported_blocks / 1000 != blocks_before / 1000 {
info!(
"#{} blocks were imported (#{} left)",