mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 08:51:08 +03:00
parent
35740204a1
commit
45f74c396d
12 changed files with 11 additions and 21 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
||||
///
|
||||
|
@ -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};
|
||||
|
||||
///
|
||||
|
@ -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};
|
||||
|
||||
///
|
||||
|
@ -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};
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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::{
|
||||
|
|
Loading…
Reference in a new issue