Remove unused imports/ doc comments. (#2276)

* Remove unused imports/ doc comments

* Better doc for node template.
This commit is contained in:
Kian Peymani
2019-04-14 12:42:45 +02:00
committed by Bastian Köcher
parent 29e9273579
commit dcb1cafe2a
7 changed files with 5 additions and 13 deletions
-2
View File
@@ -1122,8 +1122,6 @@ impl<Block> client::backend::Backend<Block, Blake2Hasher> for Backend<Block> whe
} }
fn revert(&self, n: NumberFor<Block>) -> Result<NumberFor<Block>, client::error::Error> { fn revert(&self, n: NumberFor<Block>) -> Result<NumberFor<Block>, client::error::Error> {
use client::blockchain::HeaderBackend;
let mut best = self.blockchain.info()?.best_number; let mut best = self.blockchain.info()?.best_number;
let finalized = self.blockchain.info()?.finalized_number; let finalized = self.blockchain.info()?.finalized_number;
let revertible = best - finalized; let revertible = best - finalized;
-2
View File
@@ -675,8 +675,6 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
) -> error::Result<ImportResult> where ) -> error::Result<ImportResult> where
E: CallExecutor<Block, Blake2Hasher> + Send + Sync + Clone, E: CallExecutor<Block, Blake2Hasher> + Send + Sync + Clone,
{ {
use runtime_primitives::traits::Digest;
let ImportBlock { let ImportBlock {
origin, origin,
header, header,
@@ -34,7 +34,7 @@ use grandpa::{
}; };
use runtime_primitives::generic::BlockId; use runtime_primitives::generic::BlockId;
use runtime_primitives::traits::{ 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_primitives::{Blake2Hasher, ed25519, H256, Pair};
use substrate_telemetry::{telemetry, CONSENSUS_INFO}; use substrate_telemetry::{telemetry, CONSENSUS_INFO};
@@ -886,8 +886,6 @@ pub(crate) fn canonical_at_height<B, E, Block: BlockT<Hash=H256>, RA>(
B: Backend<Block, Blake2Hasher>, B: Backend<Block, Blake2Hasher>,
E: CallExecutor<Block, Blake2Hasher> + Send + Sync, E: CallExecutor<Block, Blake2Hasher> + Send + Sync,
{ {
use runtime_primitives::traits::{One, Zero, BlockNumberToHash};
if height > base.1 { if height > base.1 {
return Ok(None); return Ok(None);
} }
@@ -416,7 +416,6 @@ impl<B: BlockT> ConsensusGossip<B> {
if let Some((topic, keep)) = validation_result { if let Some((topic, keep)) = validation_result {
if let Some(ref mut peer) = self.peers.get_mut(&who) { if let Some(ref mut peer) = self.peers.get_mut(&who) {
use std::collections::hash_map::Entry;
peer.known_messages.insert(message_hash); peer.known_messages.insert(message_hash);
if let Entry::Occupied(mut entry) = self.live_message_sinks.entry((engine_id, topic)) { if let Entry::Occupied(mut entry) = self.live_message_sinks.entry((engine_id, topic)) {
debug!(target: "gossip", "Pushing consensus message to sinks for {}.", topic); debug!(target: "gossip", "Pushing consensus message to sinks for {}.", topic);
+1 -1
View File
@@ -66,7 +66,7 @@ pub type BlockResponse<B> = generic::BlockResponse<
/// A set of transactions. /// A set of transactions.
pub type Transactions<E> = Vec<E>; pub type Transactions<E> = Vec<E>;
/// Bits of block data and associated artifacts to request. // Bits of block data and associated artifacts to request.
bitflags! { bitflags! {
/// Node roles bitmask. /// Node roles bitmask.
pub struct BlockAttributes: u8 { pub struct BlockAttributes: u8 {
-2
View File
@@ -19,8 +19,6 @@ use client::blockchain::HeaderBackend as BlockchainHeaderBackend;
use crate::config::Roles; use crate::config::Roles;
use consensus::BlockOrigin; use consensus::BlockOrigin;
use std::collections::HashSet; use std::collections::HashSet;
use std::thread;
use std::time::Duration;
use super::*; use super::*;
fn test_ancestor_search_when_common_is(n: usize) { fn test_ancestor_search_when_common_is(n: usize) {
@@ -19,7 +19,7 @@ pub trait Trait: system::Trait {
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>; type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
} }
/// This module's storage items. // This module's storage items.
decl_storage! { decl_storage! {
trait Store for Module<T: Trait> as TemplateModule { trait Store for Module<T: Trait> as TemplateModule {
// Just a dummy storage item. // Just a dummy storage item.
@@ -29,6 +29,7 @@ decl_storage! {
} }
} }
// The module's dispatchable functions.
decl_module! { decl_module! {
/// The module declaration. /// The module declaration.
pub struct Module<T: Trait> for enum Call where origin: T::Origin { pub struct Module<T: Trait> for enum Call where origin: T::Origin {