Skip to content

Commit

Permalink
Fix a few minor issues from rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
liamsi committed Dec 10, 2019
1 parent f17e9c3 commit 42130c6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
6 changes: 1 addition & 5 deletions tendermint/src/block/header.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
//! Block headers
use crate::merkle::simple_hash_from_byte_vectors;
use crate::serializers;
use crate::{account, amino_types, block, chain, lite, Hash, Time};
use amino_types::{message::AminoMessage, BlockId, ConsensusVersion, TimeMsg};
use serde::{de::Error as _, Deserialize, Deserializer, Serialize};
use std::str::FromStr;

use {
crate::serializers,
serde::{Deserialize, Serialize},
};

/// Block `Header` values contain metadata about the block and about the
/// consensus, as well as commitments to the data in the current block, the
/// previous block, and the results returned by the application.
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/block/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub const PREFIX_LENGTH: usize = 10;
/// as well as the number of parts in the block.
///
/// <https://github.com/tendermint/tendermint/blob/master/docs/spec/blockchain/blockchain.md#blockid>
#[derive(Serialize, Deserialize, Clone, Debug, Hash, Eq, PartialEq, PartialOrd, Ord, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, Hash, Eq, PartialEq, PartialOrd, Ord)]
pub struct Id {
/// The block's main hash is the Merkle root of all the fields in the
/// block header.
Expand Down
6 changes: 0 additions & 6 deletions tendermint/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ pub enum Hash {
Sha256([u8; SHA256_HASH_SIZE]),
}

impl Default for Hash {
fn default() -> Hash {
Hash::Null
}
}

impl Hash {
#[allow(clippy::new_ret_no_self)]
/// Create a new `Hash` with the given algorithm type
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl lite::ValidatorSet for Set {
.iter()
.map(|validator| validator.hash_bytes())
.collect();
Hash::Sha256(merkle::simple_hash_from_byte_slices(validator_bytes))
Hash::Sha256(merkle::simple_hash_from_byte_vectors(validator_bytes))
}

fn total_power(&self) -> u64 {
Expand Down

0 comments on commit 42130c6

Please sign in to comment.