v0.17.18: Update latest substrate (#776)

* update latest substrate polkadot-master

* fix test compilation

* bump version to 0.7.18

* bump impl_version

* update substrate

* Revert "Instantiate environment with asynchronous API (#768)"

This reverts commit a5d9645bf4.

* update substrate

* remove unused parameter type

* bump trie-db version for tests

* fix collator test

* update substrate

* remove unnecessary service changes
This commit is contained in:
André Silva
2020-01-17 18:37:55 +00:00
committed by GitHub
parent b9cc23a6e0
commit 2b081f9edd
24 changed files with 656 additions and 595 deletions
+22 -8
View File
@@ -24,7 +24,9 @@ mod chain_spec;
mod browser;
use chain_spec::ChainSpec;
use futures::{Future, future::{select, Either}, channel::oneshot};
use futures::{
Future, FutureExt, TryFutureExt, future::select, channel::oneshot,
};
#[cfg(feature = "cli")]
use tokio::runtime::Runtime;
use log::info;
@@ -215,22 +217,34 @@ pub fn run_until_exit(
) -> error::Result<()> {
let (exit_send, exit) = oneshot::channel();
let executor = runtime.executor();
let informant = sc_cli::informant::build(&service);
let future = select(exit, informant)
.map(|_| Ok(()))
.compat();
let handle = runtime.spawn(select(exit, informant));
executor.spawn(future);
// we eagerly drop the service so that the internal exit future is fired,
// but we need to keep holding a reference to the global telemetry guard
let _telemetry = service.telemetry();
let service_res = runtime.block_on(select(service, e));
let service_res = {
let service = service
.map_err(|err| error::Error::Service(err));
let select = select(service, e)
.map(|_| Ok(()))
.compat();
runtime.block_on(select)
};
let _ = exit_send.send(());
runtime.block_on(handle);
use futures01::Future;
// TODO [andre]: timeout this future substrate/#1318
let _ = runtime.shutdown_on_idle().wait();
match service_res {
Either::Left((res, _)) => res.map_err(error::Error::Service),
Either::Right((_, _)) => Ok(())
}
service_res
}