Fix issues with old state information

This commit is contained in:
Paul Hauner
2019-01-25 16:47:24 +11:00
parent 5ef02688d5
commit 138fcd6275
12 changed files with 188 additions and 171 deletions

View File

@@ -1,5 +1,4 @@
extern crate tiny_keccak;
use ssz::{ssz_encode, Encodable as SszEncodable};
use tiny_keccak::Keccak;
pub fn canonical_hash(input: &[u8]) -> Vec<u8> {
@@ -10,6 +9,10 @@ pub fn canonical_hash(input: &[u8]) -> Vec<u8> {
result
}
pub fn hash_tree_root<T: SszEncodable>(input: &T) -> Vec<u8> {
canonical_hash(&ssz_encode(input))
}
#[cfg(test)]
mod tests {
use super::*;