Add Keccak hasher (#6101)

* fix keccak hasher

* Update hasher.rs

Co-authored-by: Gavin Wood <i@gavwood.com>
This commit is contained in:
satellitexandGavin Wood authored and GitHub committed 2020-05-21 19:32:23 +02:00
1 parent aa95c596e6
commit ab9ff537cd
4 files changed
+59

No files matched your search

+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.