Fix clippy lints

This commit is contained in:
Paul Hauner
2019-04-03 16:23:09 +11:00
parent 1d34e2b2a5
commit 1913be0c6f
22 changed files with 76 additions and 105 deletions

View File

@@ -82,8 +82,7 @@ fn run_state_transition_tests_small() {
for block in test_case.blocks.iter() {
while block.slot > state.slot {
let latest_block_header = state.latest_block_header.clone();
let res = per_slot_processing(&mut state, &latest_block_header, &test_case.config)
.unwrap();
per_slot_processing(&mut state, &latest_block_header, &test_case.config).unwrap();
}
if test_case.verify_signatures {
let res = per_block_processing(&mut state, &block, &test_case.config);

View File

@@ -6,8 +6,7 @@ use dirs;
use log::debug;
use rayon::prelude::*;
use std::path::{Path, PathBuf};
//TODO: testing only
use std::time::{Duration, SystemTime};
use std::time::SystemTime;
pub const KEYPAIRS_FILE: &str = "keypairs.raw_keypairs";

View File

@@ -3,7 +3,7 @@ use serde_derive::{Deserialize, Serialize};
use std::fmt;
use std::hash::{Hash, Hasher};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, Eq, Serialize, Deserialize)]
pub struct Keypair {
pub sk: SecretKey,
pub pk: PublicKey,
@@ -22,6 +22,12 @@ impl Keypair {
}
}
impl PartialEq for Keypair {
fn eq(&self, other: &Keypair) -> bool {
self == other
}
}
impl Hash for Keypair {
/// Note: this is distinct from consensus serialization, it will produce a different hash.
///