Update types to new tree_hash crate

This commit is contained in:
Paul Hauner
2019-04-16 14:14:38 +10:00
parent 3eaa06d758
commit b8c4c3308a
70 changed files with 284 additions and 234 deletions

View File

@@ -3,10 +3,11 @@ use bls_aggregates::PublicKey as RawPublicKey;
use serde::de::{Deserialize, Deserializer};
use serde::ser::{Serialize, Serializer};
use serde_hex::{encode as hex_encode, HexVisitor};
use ssz::{decode, hash, ssz_encode, Decodable, DecodeError, Encodable, SszStream, TreeHash};
use ssz::{decode, ssz_encode, Decodable, DecodeError, Encodable, SszStream};
use std::default;
use std::fmt;
use std::hash::{Hash, Hasher};
use tree_hash::impl_tree_hash_for_ssz_bytes;
/// A single BLS signature.
///
@@ -104,11 +105,7 @@ impl<'de> Deserialize<'de> for PublicKey {
}
}
impl TreeHash for PublicKey {
fn hash_tree_root(&self) -> Vec<u8> {
hash(&self.0.as_bytes())
}
}
impl_tree_hash_for_ssz_bytes!(PublicKey);
impl PartialEq for PublicKey {
fn eq(&self, other: &PublicKey) -> bool {