Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused imports #3589

Merged
merged 2 commits into from
Mar 8, 2021
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
1 change: 0 additions & 1 deletion core/src/core/committed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//! The Committed trait and associated errors.

use failure::Fail;
use keychain;
use keychain::BlindingFactor;
use util::secp::key::SecretKey;
use util::secp::pedersen::Commitment;
Expand Down
1 change: 0 additions & 1 deletion core/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use crate::core::hash::Hash;
use crate::pow::{Difficulty, Proof, ProofOfWork};
use chrono::prelude::{TimeZone, Utc};
use keychain::BlindingFactor;
use util;
use util::secp::constants::SINGLE_BULLET_PROOF_SIZE;
use util::secp::pedersen::{Commitment, RangeProof};
use util::secp::Signature;
Expand Down
8 changes: 4 additions & 4 deletions core/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
//! should be used sparingly.

use crate::consensus::{
graph_weight, header_version, HeaderInfo, BASE_EDGE_BITS, BLOCK_TIME_SEC,
C32_GRAPH_WEIGHT, COINBASE_MATURITY, CUT_THROUGH_HORIZON, DAY_HEIGHT, DEFAULT_MIN_EDGE_BITS,
DMA_WINDOW, GRIN_BASE, INITIAL_DIFFICULTY, KERNEL_WEIGHT, MAX_BLOCK_WEIGHT,
OUTPUT_WEIGHT, PROOFSIZE, SECOND_POW_EDGE_BITS, STATE_SYNC_THRESHOLD,
graph_weight, header_version, HeaderInfo, BASE_EDGE_BITS, BLOCK_TIME_SEC, C32_GRAPH_WEIGHT,
COINBASE_MATURITY, CUT_THROUGH_HORIZON, DAY_HEIGHT, DEFAULT_MIN_EDGE_BITS, DMA_WINDOW,
GRIN_BASE, INITIAL_DIFFICULTY, KERNEL_WEIGHT, MAX_BLOCK_WEIGHT, OUTPUT_WEIGHT, PROOFSIZE,
SECOND_POW_EDGE_BITS, STATE_SYNC_THRESHOLD,
};
use crate::core::block::HeaderVersion;
use crate::pow::{
Expand Down
2 changes: 0 additions & 2 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ extern crate enum_primitive;
extern crate lazy_static;
#[macro_use]
extern crate serde_derive;
use serde;
#[macro_use]
extern crate log;
use failure;
#[macro_use]
extern crate failure_derive;
#[macro_use]
Expand Down
1 change: 0 additions & 1 deletion core/src/libtx/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//! libtx specific errors
use crate::core::transaction;
use failure::{Backtrace, Context, Fail};
use keychain;
use std::fmt::{self, Display};
use util::secp;

Expand Down
8 changes: 4 additions & 4 deletions core/src/libtx/secp_ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ pub mod pubkey_serde {

/// Serializes an Option<secp::Signature> to and from hex
pub mod option_sig_serde {
use crate::serde::{Deserialize, Deserializer, Serializer};
use serde::de::Error;
use serde::{Deserialize, Deserializer, Serializer};
use util::{from_hex, secp, static_secp_instance, ToHex};

///
Expand Down Expand Up @@ -99,8 +99,8 @@ pub mod option_sig_serde {

/// Serializes an Option<secp::SecretKey> to and from hex
pub mod option_seckey_serde {
use crate::serde::{Deserialize, Deserializer, Serializer};
use serde::de::Error;
use serde::{Deserialize, Deserializer, Serializer};
use util::{from_hex, secp, static_secp_instance, ToHex};

///
Expand Down Expand Up @@ -144,8 +144,8 @@ pub mod option_seckey_serde {

/// Serializes a secp::Signature to and from hex
pub mod sig_serde {
use crate::serde::{Deserialize, Deserializer, Serializer};
use serde::de::Error;
use serde::{Deserialize, Deserializer, Serializer};
use util::{from_hex, secp, static_secp_instance, ToHex};

///
Expand Down Expand Up @@ -180,8 +180,8 @@ pub mod sig_serde {

/// Serializes an Option<secp::Commitment> to and from hex
pub mod option_commitment_serde {
use crate::serde::{Deserialize, Deserializer, Serializer};
use serde::de::Error;
use serde::{Deserialize, Deserializer, Serializer};
use util::secp::pedersen::Commitment;
use util::{from_hex, ToHex};

Expand Down
2 changes: 1 addition & 1 deletion core/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ macro_rules! tee {
($thing:ident, $thing_expr:expr) => {{
$thing_expr;
$thing
}};
}};
}

/// Eliminate some of the boilerplate of deserialization (package ser) by
Expand Down
2 changes: 0 additions & 2 deletions core/src/pow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ pub use self::types::*;
use crate::core::{Block, BlockHeader};
use crate::genesis;
use crate::global;
use chrono;
use num;

#[macro_use]
mod common;
Expand Down
2 changes: 1 addition & 1 deletion core/src/pow/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
//! Common types and traits for cuckoo family of solvers

use crate::pow::error::Error;
use crate::pow::num::{PrimInt, ToPrimitive};
use crate::pow::siphash::siphash24;
use blake2::blake2b::blake2b;
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use num::{PrimInt, ToPrimitive};
use std::fmt;
use std::hash::Hash;
use std::io::Cursor;
Expand Down
2 changes: 1 addition & 1 deletion keychain/src/mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub fn to_entropy(mnemonic: &str) -> Result<Vec<u8>, Error> {

let mut hash = [0; 32];
let mut sha2sum = Sha256::default();
sha2sum.input(&entropy.clone());
sha2sum.input(&entropy);
hash.copy_from_slice(sha2sum.result().as_slice());

let actual = (hash[0] >> (8 - checksum_bits)) & mask;
Expand Down
2 changes: 0 additions & 2 deletions src/build/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

//! Build hooks to spit out version+build time info

use built;

use std::env;
use std::path::{Path, PathBuf};
use std::process::Command;
Expand Down
1 change: 0 additions & 1 deletion util/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use backtrace::Backtrace;
use std::{panic, thread};

use log::{Level, Record};
use log4rs;
use log4rs::append::console::ConsoleAppender;
use log4rs::append::file::FileAppender;
use log4rs::append::rolling_file::{
Expand Down