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
+7 -6
View File
@@ -113,8 +113,8 @@ macro_rules! new_full_start {
macro_rules! new_full {
($config:expr, $with_startup_data: expr) => {{
use futures::{
stream::StreamExt,
future::{FutureExt, TryFutureExt},
prelude::*,
compat::Future01CompatExt
};
use sc_network::Event;
@@ -191,9 +191,8 @@ macro_rules! new_full {
service.keystore(),
dht_event_stream,
);
let future01_authority_discovery = authority_discovery.map(|x| Ok(x)).compat();
service.spawn_task(future01_authority_discovery);
service.spawn_task(authority_discovery);
}
// if the node isn't actively participating in consensus then it doesn't
@@ -223,7 +222,7 @@ macro_rules! new_full {
service.network(),
service.on_exit(),
service.spawn_task_handle(),
)?);
)?.compat().map(drop));
},
(true, false) => {
// start the full GRANDPA voter
@@ -239,7 +238,9 @@ macro_rules! new_full {
};
// the GRANDPA voter task is considered infallible, i.e.
// if it fails we take down the service with it.
service.spawn_essential_task(grandpa::run_grandpa_voter(grandpa_config)?);
service.spawn_essential_task(
grandpa::run_grandpa_voter(grandpa_config)?.compat().map(drop)
);
},
(_, true) => {
grandpa::setup_disabled_grandpa(