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
@@ -214,7 +214,13 @@ enum HasherKind {
impl From<&SetHasher> for HasherKind {
fn from(set_hasher: &SetHasher) -> Self {
match set_hasher.inner.content {
(&set_hasher.inner.content).into()
}
}
impl From<&Hasher> for HasherKind {
fn from(hasher: &Hasher) -> Self {
match hasher {
Hasher::Blake2_256(_) => HasherKind::Blake2_256,
Hasher::Blake2_128(_) => HasherKind::Blake2_128,
Hasher::Twox256(_) => HasherKind::Twox256,
@@ -223,6 +229,7 @@ impl From<&SetHasher> for HasherKind {
}
}
}
impl HasherKind {
fn into_storage_hasher_struct(&self) -> TokenStream2 {
match self {