mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 04:48:21 +00:00
Add TreeHash trait to all types and structs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use bls_aggregates::{DecodeError as BlsDecodeError, SecretKey as RawSecretKey};
|
||||
use ssz::{decode_ssz_list, Decodable, DecodeError, Encodable, SszStream};
|
||||
use ssz::{decode_ssz_list, Decodable, DecodeError, Encodable, SszStream, TreeHash};
|
||||
|
||||
/// A single BLS signature.
|
||||
///
|
||||
@@ -40,6 +40,12 @@ impl Decodable for SecretKey {
|
||||
}
|
||||
}
|
||||
|
||||
impl TreeHash for SecretKey {
|
||||
fn hash_tree_root(&self) -> Vec<u8> {
|
||||
self.0.as_bytes().clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::super::ssz::ssz_encode;
|
||||
|
||||
Reference in New Issue
Block a user