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 authored and Gavin Wood committed 2019-07-25 10:55:50 +08:00
1 parent 3a6a309d84
commit b31dcdf342
21 files changed
+208 -184

No files matched your search

+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)",