Make use of StorageHasher and HasherKind (#2836)

* Make use of StorageHasher and HasherKind.

* Use Storagehasher hasher function for key2 of double map.

* Refactor to reuse hasher from implementation.

* Bump up since there is srml changes.

* Update metadata version.
This commit is contained in:
kaichao
2019-06-12 03:34:10 +08:00
committed by Bastian Köcher
parent c1654ecd23
commit cae324598f
8 changed files with 33 additions and 22 deletions
@@ -636,8 +636,10 @@ impl<'a, I: Iterator<Item=syn::Meta>> Impls<'a, I> {
}
fn key_for(k1: &#k1ty, k2: &#k2ty) -> Vec<u8> {
use #scrate::storage::hashed::generator::StorageHasher;
let mut key = #as_double_map::prefix_for(k1);
key.extend(&#scrate::Hashable::#k2_hasher(k2));
#scrate::codec::Encode::using_encoded(k2, |e| key.extend(&#scrate::#k2_hasher::hash(e)));
key
}