From 33ccfe3b65ef5dc896fd9b8d2167300af7a9d749 Mon Sep 17 00:00:00 2001 From: Merope Riddle Date: Tue, 1 Nov 2016 01:44:11 +0000 Subject: [PATCH] core: remove several unused imports --- core/src/core/hash.rs | 2 +- core/src/core/mod.rs | 13 +++---------- core/src/core/transaction.rs | 1 - core/src/pow/cuckoo.rs | 1 - core/src/pow/mod.rs | 8 +++----- 5 files changed, 7 insertions(+), 18 deletions(-) diff --git a/core/src/core/hash.rs b/core/src/core/hash.rs index 543b6ddfa..770a45ae0 100644 --- a/core/src/core/hash.rs +++ b/core/src/core/hash.rs @@ -17,7 +17,7 @@ //! Primary hash function used in the protocol //! -use byteorder::{ByteOrder, WriteBytesExt, BigEndian}; +use byteorder::{ByteOrder, BigEndian}; use std::fmt; use tiny_keccak::Keccak; diff --git a/core/src/core/mod.rs b/core/src/core/mod.rs index d1472eed7..af5f7368c 100644 --- a/core/src/core/mod.rs +++ b/core/src/core/mod.rs @@ -18,25 +18,18 @@ pub mod block; pub mod hash; pub mod transaction; #[allow(dead_code)] -#[macro_use] pub use self::block::{Block, BlockHeader}; pub use self::transaction::{Transaction, Input, Output, TxProof}; use self::hash::{Hash, Hashed, ZERO_HASH}; -use ser::{Writeable, Writer, Error, ser_vec}; - -use time; +use ser::{Writeable, Writer, Error}; use std::fmt; use std::cmp::Ordering; -use secp; -use secp::{Secp256k1, Signature, Message}; -use secp::key::SecretKey; +use secp::{self, Secp256k1}; use secp::pedersen::*; -use tiny_keccak::Keccak; - /// The block subsidy amount pub const REWARD: u64 = 1_000_000_000; @@ -198,7 +191,7 @@ impl MerkleRow { #[cfg(test)] mod test { use super::*; - use super::hash::{Hash, Hashed, ZERO_HASH}; + use core::hash::ZERO_HASH; use secp; use secp::Secp256k1; use secp::key::SecretKey; diff --git a/core/src/core/transaction.rs b/core/src/core/transaction.rs index d1d6bcc02..33c715dbd 100644 --- a/core/src/core/transaction.rs +++ b/core/src/core/transaction.rs @@ -378,7 +378,6 @@ mod test { use secp::{self, Secp256k1}; use secp::key::SecretKey; - use rand::Rng; use rand::os::OsRng; fn new_secp() -> Secp256k1 { diff --git a/core/src/pow/cuckoo.rs b/core/src/pow/cuckoo.rs index 6d0a4615c..544aef68b 100644 --- a/core/src/pow/cuckoo.rs +++ b/core/src/pow/cuckoo.rs @@ -19,7 +19,6 @@ use std::collections::HashSet; use std::cmp; -use std::fmt; use crypto::digest::Digest; use crypto::sha2::Sha256; diff --git a/core/src/pow/mod.rs b/core/src/pow/mod.rs index 7047c10c6..d2069721f 100644 --- a/core/src/pow/mod.rs +++ b/core/src/pow/mod.rs @@ -27,12 +27,12 @@ mod cuckoo; use time; -use core::{Block, BlockHeader, Proof, PROOFSIZE}; +use core::{Block, Proof, PROOFSIZE}; use core::hash::{Hash, Hashed}; use pow::cuckoo::{Cuckoo, Miner, Error}; use ser; -use ser::{Writeable, Writer, ser_vec}; +use ser::{Writeable, Writer}; /// Default Cuckoo Cycle size shift used is 28. We may decide to increase it. /// when difficuty increases. @@ -169,9 +169,7 @@ fn pow_size(b: &Block, target: Proof, sizeshift: u32) -> Result<(Proof, u64), Er #[cfg(test)] mod test { use super::*; - use core::{BlockHeader, Proof}; - use core::hash::Hash; - use std::time::Instant; + use core::Proof; use genesis; #[test]