From fd03f4e95054251cd4841e297aed4f138cca33af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 29 Jan 2020 21:37:26 +0100 Subject: [PATCH] Fix warnings. (#4768) --- substrate/bin/node-template/src/cli.rs | 4 +++- substrate/bin/node-template/src/service.rs | 1 - substrate/bin/node/cli/src/cli.rs | 4 +++- substrate/client/finality-grandpa/src/lib.rs | 9 --------- substrate/client/network/test/src/lib.rs | 2 +- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/substrate/bin/node-template/src/cli.rs b/substrate/bin/node-template/src/cli.rs index fcfd330816..8408f17379 100644 --- a/substrate/bin/node-template/src/cli.rs +++ b/substrate/bin/node-template/src/cli.rs @@ -90,7 +90,9 @@ where let _ = exit_send.send(()); - runtime.block_on(handle); + if let Err(e) = runtime.block_on(handle) { + log::error!("Error running node: {:?}", e); + } match service_res { Either::Left((res, _)) => res.map_err(error::Error::Service), diff --git a/substrate/bin/node-template/src/service.rs b/substrate/bin/node-template/src/service.rs index a396a5301c..bdaff5ad09 100644 --- a/substrate/bin/node-template/src/service.rs +++ b/substrate/bin/node-template/src/service.rs @@ -11,7 +11,6 @@ use sc_executor::native_executor_instance; pub use sc_executor::NativeExecutor; use sp_consensus_aura::sr25519::{AuthorityPair as AuraPair}; use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider}; -use futures::{FutureExt, compat::Future01CompatExt}; // Our native executor instance. native_executor_instance!( diff --git a/substrate/bin/node/cli/src/cli.rs b/substrate/bin/node/cli/src/cli.rs index 2c68789e38..2a3d60a794 100644 --- a/substrate/bin/node/cli/src/cli.rs +++ b/substrate/bin/node/cli/src/cli.rs @@ -200,7 +200,9 @@ where let _ = exit_send.send(()); - runtime.block_on(handle); + if let Err(e) = runtime.block_on(handle) { + log::error!("Error running node: {:?}", e); + } match service_res { Either::Left((res, _)) => res.map_err(error::Error::Service), diff --git a/substrate/client/finality-grandpa/src/lib.rs b/substrate/client/finality-grandpa/src/lib.rs index a86a97c0da..afca0ed48b 100644 --- a/substrate/client/finality-grandpa/src/lib.rs +++ b/substrate/client/finality-grandpa/src/lib.rs @@ -171,15 +171,6 @@ type CommunicationInH = finality_grandpa::voter::CommunicationIn< AuthorityId, >; -/// A global communication sink for commits. Not exposed publicly, used -/// internally to simplify types in the communication layer. -type CommunicationOut = finality_grandpa::voter::CommunicationOut< - ::Hash, - NumberFor, - AuthoritySignature, - AuthorityId, ->; - /// Global communication sink for commits with the hash type not being derived /// from the block, useful for forcing the hash to some type (e.g. `H256`) when /// the compiler can't do the inference. diff --git a/substrate/client/network/test/src/lib.rs b/substrate/client/network/test/src/lib.rs index 1e14ec7bb0..22e340a2a8 100644 --- a/substrate/client/network/test/src/lib.rs +++ b/substrate/client/network/test/src/lib.rs @@ -392,7 +392,7 @@ impl TransactionPool for EmptyTransactionPool { fn on_broadcasted(&self, _: HashMap>) {} - fn transaction(&self, h: &Hash) -> Option { None } + fn transaction(&self, _h: &Hash) -> Option { None } } pub trait SpecializationFactory {