Implement CachedTreeHash for TreeHashVector

This commit is contained in:
Paul Hauner
2019-04-26 11:15:17 +10:00
parent f1d8224d89
commit 15f81c0907
7 changed files with 215 additions and 149 deletions

View File

@@ -56,11 +56,11 @@ impl TreeHash for [u8; 4] {
}
fn tree_hash_packed_encoding(&self) -> Vec<u8> {
panic!("bytesN should never be packed.")
unreachable!("bytesN should never be packed.")
}
fn tree_hash_packing_factor() -> usize {
panic!("bytesN should never be packed.")
unreachable!("bytesN should never be packed.")
}
fn tree_hash_root(&self) -> Vec<u8> {

View File

@@ -49,6 +49,7 @@ macro_rules! tree_hash_ssz_encoding_as_vector {
}
};
}
#[macro_export]
macro_rules! tree_hash_ssz_encoding_as_list {
($type: ident) => {