Update the service to std futures (#4447)

* Switch service to futures03

* Fix tests

* Fix service test and cli

* Re-add Executor trait to SpawnTaskHandle

* Fix node-service

* Update babe

* Fix browser node

* Update aura

* Revert back to tokio-executor to fix runtime panic

* Add todo item

* Fix service tests again

* Timeout test futures

* Fix tests

* nits

* Fix service test

* Remove zstd patch

* Re-add futures01 to aura and babe tests as a dev-dep

* Change failing test to tee

* Fix node

* Upgrade tokio

* fix society

* Start switching grandpa to stable futures

* Revert "Start switching grandpa to stable futures"

This reverts commit 9c1976346237637effc07c13f7d0403daf5e71cf.

* Fix utils

* Revert substrate service test

* Revert gitlab

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Ashley
2020-01-14 15:43:45 +01:00
committed by GitHub
parent 972be34e38
commit 3219be2508
24 changed files with 246 additions and 312 deletions
+3 -4
View File
@@ -17,7 +17,7 @@
//! Console informant. Prints sync progress and block events. Runs on the calling thread.
use sc_client_api::BlockchainEvents;
use futures::{StreamExt, TryStreamExt, FutureExt, future, compat::Stream01CompatExt};
use futures::prelude::*;
use log::{info, warn, trace};
use sp_runtime::traits::Header;
use sc_service::AbstractService;
@@ -33,8 +33,7 @@ pub fn build(service: &impl AbstractService) -> impl futures::Future<Output = ()
let display_notifications = service
.network_status(Duration::from_millis(5000))
.compat()
.try_for_each(move |(net_status, _)| {
.for_each(move |(net_status, _)| {
let info = client.usage_info();
if let Some(ref usage) = info.usage {
trace!(target: "usage", "Usage statistics: {}", usage);
@@ -42,7 +41,7 @@ pub fn build(service: &impl AbstractService) -> impl futures::Future<Output = ()
trace!(target: "usage", "Usage statistics not displayed as backend does not provide it")
}
display.display(&info, net_status);
future::ok(())
future::ready(())
});
let client = service.client();