Add Keccak hasher (#6101)

* fix keccak hasher

* Update hasher.rs

Co-authored-by: Gavin Wood <i@gavwood.com>
This commit is contained in:
satellitex
2020-05-22 02:32:23 +09:00
committed by GitHub
parent aa95c596e6
commit ab9ff537cd
4 changed files with 59 additions and 0 deletions
+10
View File
@@ -300,6 +300,16 @@ pub trait Trie {
fn blake2_256_ordered_root(input: Vec<Vec<u8>>) -> H256 {
Layout::<sp_core::Blake2Hasher>::ordered_trie_root(input)
}
/// A trie root formed from the iterated items.
fn keccak_256_root(input: Vec<(Vec<u8>, Vec<u8>)>) -> H256 {
Layout::<sp_core::KeccakHasher>::trie_root(input)
}
/// A trie root formed from the enumerated items.
fn keccak_256_ordered_root(input: Vec<Vec<u8>>) -> H256 {
Layout::<sp_core::KeccakHasher>::ordered_trie_root(input)
}
}
/// Interface that provides miscellaneous functions for communicating between the runtime and the node.