optimize double map first key hash (#2451)

* fix double map encoding it is now encoded as specified in the doc
This commit is contained in:
thiolliere
2019-05-06 08:44:36 +02:00
committed by GitHub
parent 5a820db7f5
commit b0c21da94f
6 changed files with 89 additions and 16 deletions
@@ -621,9 +621,11 @@ impl<'a, I: Iterator<Item=syn::Meta>> Impls<'a, I> {
type Query = #value_type;
fn prefix_for(k1: &#k1ty) -> Vec<u8> {
use #scrate::storage::hashed::generator::StorageHasher;
let mut key = #as_double_map::prefix().to_vec();
#scrate::codec::Encode::encode_to(k1, &mut key);
#scrate::Hashable::#hasher(&key).to_vec()
#scrate::#hasher::hash(&key[..]).to_vec()
}
fn prefix() -> &'static [u8] {