Remove unused imports (#3589)

* Remove unused imports
This commit is contained in:
Quentin Le Sceller 2021-03-08 10:36:16 -05:00 committed by GitHub
parent 35740204a1
commit 45f74c396d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 11 additions and 21 deletions

View file

@ -15,7 +15,6 @@
//! The Committed trait and associated errors. //! The Committed trait and associated errors.
use failure::Fail; use failure::Fail;
use keychain;
use keychain::BlindingFactor; use keychain::BlindingFactor;
use util::secp::key::SecretKey; use util::secp::key::SecretKey;
use util::secp::pedersen::Commitment; use util::secp::pedersen::Commitment;

View file

@ -24,7 +24,6 @@ use crate::core::hash::Hash;
use crate::pow::{Difficulty, Proof, ProofOfWork}; use crate::pow::{Difficulty, Proof, ProofOfWork};
use chrono::prelude::{TimeZone, Utc}; use chrono::prelude::{TimeZone, Utc};
use keychain::BlindingFactor; use keychain::BlindingFactor;
use util;
use util::secp::constants::SINGLE_BULLET_PROOF_SIZE; use util::secp::constants::SINGLE_BULLET_PROOF_SIZE;
use util::secp::pedersen::{Commitment, RangeProof}; use util::secp::pedersen::{Commitment, RangeProof};
use util::secp::Signature; use util::secp::Signature;

View file

@ -17,10 +17,10 @@
//! should be used sparingly. //! should be used sparingly.
use crate::consensus::{ use crate::consensus::{
graph_weight, header_version, HeaderInfo, BASE_EDGE_BITS, BLOCK_TIME_SEC, graph_weight, header_version, HeaderInfo, BASE_EDGE_BITS, BLOCK_TIME_SEC, C32_GRAPH_WEIGHT,
C32_GRAPH_WEIGHT, COINBASE_MATURITY, CUT_THROUGH_HORIZON, DAY_HEIGHT, DEFAULT_MIN_EDGE_BITS, COINBASE_MATURITY, CUT_THROUGH_HORIZON, DAY_HEIGHT, DEFAULT_MIN_EDGE_BITS, DMA_WINDOW,
DMA_WINDOW, GRIN_BASE, INITIAL_DIFFICULTY, KERNEL_WEIGHT, MAX_BLOCK_WEIGHT, GRIN_BASE, INITIAL_DIFFICULTY, KERNEL_WEIGHT, MAX_BLOCK_WEIGHT, OUTPUT_WEIGHT, PROOFSIZE,
OUTPUT_WEIGHT, PROOFSIZE, SECOND_POW_EDGE_BITS, STATE_SYNC_THRESHOLD, SECOND_POW_EDGE_BITS, STATE_SYNC_THRESHOLD,
}; };
use crate::core::block::HeaderVersion; use crate::core::block::HeaderVersion;
use crate::pow::{ use crate::pow::{

View file

@ -27,10 +27,8 @@ extern crate enum_primitive;
extern crate lazy_static; extern crate lazy_static;
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
use serde;
#[macro_use] #[macro_use]
extern crate log; extern crate log;
use failure;
#[macro_use] #[macro_use]
extern crate failure_derive; extern crate failure_derive;
#[macro_use] #[macro_use]

View file

@ -15,7 +15,6 @@
//! libtx specific errors //! libtx specific errors
use crate::core::transaction; use crate::core::transaction;
use failure::{Backtrace, Context, Fail}; use failure::{Backtrace, Context, Fail};
use keychain;
use std::fmt::{self, Display}; use std::fmt::{self, Display};
use util::secp; use util::secp;

View file

@ -53,8 +53,8 @@ pub mod pubkey_serde {
/// Serializes an Option<secp::Signature> to and from hex /// Serializes an Option<secp::Signature> to and from hex
pub mod option_sig_serde { pub mod option_sig_serde {
use crate::serde::{Deserialize, Deserializer, Serializer};
use serde::de::Error; use serde::de::Error;
use serde::{Deserialize, Deserializer, Serializer};
use util::{from_hex, secp, static_secp_instance, ToHex}; use util::{from_hex, secp, static_secp_instance, ToHex};
/// ///
@ -99,8 +99,8 @@ pub mod option_sig_serde {
/// Serializes an Option<secp::SecretKey> to and from hex /// Serializes an Option<secp::SecretKey> to and from hex
pub mod option_seckey_serde { pub mod option_seckey_serde {
use crate::serde::{Deserialize, Deserializer, Serializer};
use serde::de::Error; use serde::de::Error;
use serde::{Deserialize, Deserializer, Serializer};
use util::{from_hex, secp, static_secp_instance, ToHex}; use util::{from_hex, secp, static_secp_instance, ToHex};
/// ///
@ -144,8 +144,8 @@ pub mod option_seckey_serde {
/// Serializes a secp::Signature to and from hex /// Serializes a secp::Signature to and from hex
pub mod sig_serde { pub mod sig_serde {
use crate::serde::{Deserialize, Deserializer, Serializer};
use serde::de::Error; use serde::de::Error;
use serde::{Deserialize, Deserializer, Serializer};
use util::{from_hex, secp, static_secp_instance, ToHex}; use util::{from_hex, secp, static_secp_instance, ToHex};
/// ///
@ -180,8 +180,8 @@ pub mod sig_serde {
/// Serializes an Option<secp::Commitment> to and from hex /// Serializes an Option<secp::Commitment> to and from hex
pub mod option_commitment_serde { pub mod option_commitment_serde {
use crate::serde::{Deserialize, Deserializer, Serializer};
use serde::de::Error; use serde::de::Error;
use serde::{Deserialize, Deserializer, Serializer};
use util::secp::pedersen::Commitment; use util::secp::pedersen::Commitment;
use util::{from_hex, ToHex}; use util::{from_hex, ToHex};

View file

@ -33,8 +33,6 @@ pub use self::types::*;
use crate::core::{Block, BlockHeader}; use crate::core::{Block, BlockHeader};
use crate::genesis; use crate::genesis;
use crate::global; use crate::global;
use chrono;
use num;
#[macro_use] #[macro_use]
mod common; mod common;

View file

@ -15,10 +15,10 @@
//! Common types and traits for cuckoo family of solvers //! Common types and traits for cuckoo family of solvers
use crate::pow::error::Error; use crate::pow::error::Error;
use crate::pow::num::{PrimInt, ToPrimitive};
use crate::pow::siphash::siphash24; use crate::pow::siphash::siphash24;
use blake2::blake2b::blake2b; use blake2::blake2b::blake2b;
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use num::{PrimInt, ToPrimitive};
use std::fmt; use std::fmt;
use std::hash::Hash; use std::hash::Hash;
use std::io::Cursor; use std::io::Cursor;

View file

@ -99,7 +99,7 @@ pub fn to_entropy(mnemonic: &str) -> Result<Vec<u8>, Error> {
let mut hash = [0; 32]; let mut hash = [0; 32];
let mut sha2sum = Sha256::default(); let mut sha2sum = Sha256::default();
sha2sum.input(&entropy.clone()); sha2sum.input(&entropy);
hash.copy_from_slice(sha2sum.result().as_slice()); hash.copy_from_slice(sha2sum.result().as_slice());
let actual = (hash[0] >> (8 - checksum_bits)) & mask; let actual = (hash[0] >> (8 - checksum_bits)) & mask;

View file

@ -14,8 +14,6 @@
//! Build hooks to spit out version+build time info //! Build hooks to spit out version+build time info
use built;
use std::env; use std::env;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::Command; use std::process::Command;

View file

@ -19,7 +19,6 @@ use backtrace::Backtrace;
use std::{panic, thread}; use std::{panic, thread};
use log::{Level, Record}; use log::{Level, Record};
use log4rs;
use log4rs::append::console::ConsoleAppender; use log4rs::append::console::ConsoleAppender;
use log4rs::append::file::FileAppender; use log4rs::append::file::FileAppender;
use log4rs::append::rolling_file::{ use log4rs::append::rolling_file::{