Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Remove unused imports/ doc comments. #2276

Merged
merged 2 commits into from
Apr 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions core/client/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
use client::blockchain::HeaderBackend;

let mut best = self.blockchain.info()?.best_number;
let finalized = self.blockchain.info()?.finalized_number;
let revertible = best - finalized;
Expand Down
2 changes: 0 additions & 2 deletions core/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,8 +675,6 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
) -> error::Result<ImportResult> where
E: CallExecutor<Block, Blake2Hasher> + Send + Sync + Clone,
{
use runtime_primitives::traits::Digest;

let ImportBlock {
origin,
header,
Expand Down
4 changes: 1 addition & 3 deletions core/finality-grandpa/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -886,8 +886,6 @@ pub(crate) fn canonical_at_height<B, E, Block: BlockT<Hash=H256>, RA>(
B: Backend<Block, Blake2Hasher>,
E: CallExecutor<Block, Blake2Hasher> + Send + Sync,
{
use runtime_primitives::traits::{One, Zero, BlockNumberToHash};

if height > base.1 {
return Ok(None);
}
Expand Down
1 change: 0 additions & 1 deletion core/network/src/consensus_gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ impl<B: BlockT> ConsensusGossip<B> {

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);
Expand Down
2 changes: 1 addition & 1 deletion core/network/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub type BlockResponse<B> = generic::BlockResponse<
/// A set of transactions.
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! {
/// Node roles bitmask.
pub struct BlockAttributes: u8 {
Expand Down
2 changes: 0 additions & 2 deletions core/network/src/test/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions node-template/runtime/src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ pub trait Trait: system::Trait {
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
}

/// This module's storage items.
// This module's storage items.
decl_storage! {
trait Store for Module<T: Trait> as TemplateModule {
// Just a dummy storage item.
// Just a dummy storage item.
// Here we are declaring a StorageValue, `Something` as a Option<u32>
// `get(something)` is the default getter which returns either the stored `u32` or `None` if nothing stored
Something get(something): Option<u32>;
}
}

// The module's dispatchable functions.
decl_module! {
/// The module declaration.
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
Expand Down