diff --git a/core/client/db/src/lib.rs b/core/client/db/src/lib.rs index d876296546ed1..483a4c0d8df3e 100644 --- a/core/client/db/src/lib.rs +++ b/core/client/db/src/lib.rs @@ -1122,8 +1122,6 @@ impl client::backend::Backend for Backend whe } fn revert(&self, n: NumberFor) -> Result, client::error::Error> { - use client::blockchain::HeaderBackend; - let mut best = self.blockchain.info()?.best_number; let finalized = self.blockchain.info()?.finalized_number; let revertible = best - finalized; diff --git a/core/client/src/client.rs b/core/client/src/client.rs index 89896fb6ebcde..4a33f3261a7da 100644 --- a/core/client/src/client.rs +++ b/core/client/src/client.rs @@ -675,8 +675,6 @@ impl Client where ) -> error::Result where E: CallExecutor + Send + Sync + Clone, { - use runtime_primitives::traits::Digest; - let ImportBlock { origin, header, diff --git a/core/finality-grandpa/src/environment.rs b/core/finality-grandpa/src/environment.rs index 2912cd5808975..5e099a92c2373 100644 --- a/core/finality-grandpa/src/environment.rs +++ b/core/finality-grandpa/src/environment.rs @@ -34,7 +34,7 @@ use grandpa::{ }; use runtime_primitives::generic::BlockId; use runtime_primitives::traits::{ - As, Block as BlockT, Header as HeaderT, NumberFor, One, Zero, + As, Block as BlockT, Header as HeaderT, NumberFor, One, Zero, BlockNumberToHash, }; use substrate_primitives::{Blake2Hasher, ed25519, H256, Pair}; use substrate_telemetry::{telemetry, CONSENSUS_INFO}; @@ -886,8 +886,6 @@ pub(crate) fn canonical_at_height, RA>( B: Backend, E: CallExecutor + Send + Sync, { - use runtime_primitives::traits::{One, Zero, BlockNumberToHash}; - if height > base.1 { return Ok(None); } diff --git a/core/network/src/consensus_gossip.rs b/core/network/src/consensus_gossip.rs index 745a644a9d052..75e91e664fec5 100644 --- a/core/network/src/consensus_gossip.rs +++ b/core/network/src/consensus_gossip.rs @@ -416,7 +416,6 @@ impl ConsensusGossip { if let Some((topic, keep)) = validation_result { if let Some(ref mut peer) = self.peers.get_mut(&who) { - use std::collections::hash_map::Entry; peer.known_messages.insert(message_hash); if let Entry::Occupied(mut entry) = self.live_message_sinks.entry((engine_id, topic)) { debug!(target: "gossip", "Pushing consensus message to sinks for {}.", topic); diff --git a/core/network/src/message.rs b/core/network/src/message.rs index d0f697b8ab406..6053d12f51d42 100644 --- a/core/network/src/message.rs +++ b/core/network/src/message.rs @@ -66,7 +66,7 @@ pub type BlockResponse = generic::BlockResponse< /// A set of transactions. pub type Transactions = Vec; -/// Bits of block data and associated artifacts to request. +// Bits of block data and associated artifacts to request. bitflags! { /// Node roles bitmask. pub struct BlockAttributes: u8 { diff --git a/core/network/src/test/sync.rs b/core/network/src/test/sync.rs index 94bbc68b945d3..9274722693650 100644 --- a/core/network/src/test/sync.rs +++ b/core/network/src/test/sync.rs @@ -19,8 +19,6 @@ use client::blockchain::HeaderBackend as BlockchainHeaderBackend; use crate::config::Roles; use consensus::BlockOrigin; use std::collections::HashSet; -use std::thread; -use std::time::Duration; use super::*; fn test_ancestor_search_when_common_is(n: usize) { diff --git a/node-template/runtime/src/template.rs b/node-template/runtime/src/template.rs index fd122433daea3..636ee1ac09506 100644 --- a/node-template/runtime/src/template.rs +++ b/node-template/runtime/src/template.rs @@ -19,16 +19,17 @@ pub trait Trait: system::Trait { type Event: From> + Into<::Event>; } -/// This module's storage items. +// This module's storage items. decl_storage! { trait Store for Module as TemplateModule { - // Just a dummy storage item. + // Just a dummy storage item. // Here we are declaring a StorageValue, `Something` as a Option // `get(something)` is the default getter which returns either the stored `u32` or `None` if nothing stored Something get(something): Option; } } +// The module's dispatchable functions. decl_module! { /// The module declaration. pub struct Module for enum Call where origin: T::Origin {