Fix warnings: unused

This commit is contained in:
adria0
2020-07-29 10:57:15 +02:00
committed by Artem Vorotnikov
parent 0cd972326c
commit cacbf256fe
23 changed files with 21 additions and 55 deletions

View File

@@ -21,7 +21,7 @@ use std::{
io::{BufRead, BufReader},
str::{from_utf8, FromStr},
sync::{
atomic::{AtomicBool, AtomicI64, AtomicUsize, Ordering as AtomicOrdering},
atomic::{AtomicBool, AtomicI64, Ordering as AtomicOrdering},
Arc, Weak,
},
time::{Duration, Instant},
@@ -75,7 +75,7 @@ use engines::{
};
use error::{
BlockError, CallError, Error as EthcoreError, ErrorKind as EthcoreErrorKind, EthcoreResult,
ExecutionError, ImportError, ImportErrorKind, QueueError, QueueErrorKind,
ExecutionError, ImportErrorKind,
};
use executive::{contract_address, Executed, Executive, TransactOptions};
use factory::{Factories, VmFactory};
@@ -3196,10 +3196,7 @@ impl IoChannelQueue {
mod tests {
use blockchain::{BlockProvider, ExtrasInsert};
use spec::Spec;
use test_helpers::{
generate_dummy_client, generate_dummy_client_with_data,
generate_dummy_client_with_spec_and_data, get_good_dummy_block_hash,
};
use test_helpers::generate_dummy_client_with_spec_and_data;
#[test]
fn should_not_cache_details_before_commit() {

View File

@@ -18,7 +18,6 @@
use std::{
collections::{BTreeMap, HashMap},
mem,
sync::{
atomic::{AtomicBool, AtomicUsize, Ordering as AtomicOrder},
Arc,
@@ -624,7 +623,7 @@ impl ImportBlock for TestBlockChainClient {
let mut difficulty = self.difficulty.write();
*difficulty = *difficulty + header.difficulty().clone();
}
mem::replace(&mut *self.last_hash.write(), h.clone());
*self.last_hash.write() = h.clone();
self.blocks.write().insert(h.clone(), unverified.bytes);
self.numbers.write().insert(number, h.clone());
let mut parent_hash = header.parent_hash().clone();

View File

@@ -67,7 +67,6 @@ use std::{
use super::signer::EngineSigner;
use block::ExecutedBlock;
use bytes::Bytes;
use client::{traits::ForceUpdateSealing, BlockId, EngineClient};
use engines::{
clique::util::{extract_signers, recover_creator},

View File

@@ -61,7 +61,6 @@ extern crate ansi_term;
extern crate byteorder;
extern crate common_types as types;
extern crate crossbeam_utils;
extern crate eip_152;
extern crate ethabi;
extern crate ethash;
extern crate ethcore_blockchain as blockchain;
@@ -81,7 +80,6 @@ extern crate journaldb;
extern crate keccak_hash as hash;
extern crate keccak_hasher;
extern crate kvdb;
extern crate kvdb_memorydb;
extern crate len_caching_lock;
extern crate lru_cache;
extern crate memory_cache;
@@ -121,9 +119,6 @@ extern crate kvdb_rocksdb;
extern crate rlp_compress;
#[cfg(any(test, feature = "tempdir"))]
extern crate tempdir;
#[cfg(test)]
#[macro_use]
extern crate hex_literal;
#[macro_use]
extern crate ethabi_derive;

View File

@@ -1990,7 +1990,6 @@ mod tests {
use ethcore_miner::gas_price_calibrator::{GasPriceCalibrator, GasPriceCalibratorOptions};
use fetch::Client as FetchClient;
use parity_runtime::Executor;
use std::time::Duration;
// Don't really care about any of these settings since
// the gas pricer is never actually going to be used

View File

@@ -163,7 +163,6 @@ pub fn restore(
reader: &dyn SnapshotReader,
genesis: &[u8],
) -> Result<(), ::error::Error> {
use snappy;
use std::sync::atomic::AtomicBool;
let flag = AtomicBool::new(true);

View File

@@ -206,7 +206,7 @@ fn keep_ancient_blocks() {
)
.unwrap();
let manifest = ::snapshot::ManifestData {
let manifest = ManifestData {
version: 2,
state_hashes,
state_root,

View File

@@ -901,8 +901,6 @@ impl Spec {
/// initialize genesis epoch data, using in-memory database for
/// constructor.
pub fn genesis_epoch_data(&self) -> Result<Vec<u8>, String> {
use journaldb;
use kvdb_memorydb;
use types::transaction::{Action, Transaction};
let genesis = self.genesis_header();

View File

@@ -33,7 +33,7 @@ use hash::keccak;
use io::IoChannel;
use miner::{Miner, MinerService, PendingOrdering};
use rustc_hex::ToHex;
use spec::{self, Spec};
use spec::Spec;
use state::{self, CleanupMode, State, StateInfo};
use tempdir::TempDir;
use test_helpers::{