Fix head not hashed (#3680)

* fix head not hashed

* bump version
This commit is contained in:
thiolliere
2019-09-24 17:46:41 +02:00
committed by Bastian Köcher
parent 7611c08679
commit 1835c3f9a1
5 changed files with 20 additions and 11 deletions
@@ -257,14 +257,14 @@ impl<'a, I: Iterator<Item=syn::Meta>> Impls<'a, I> {
};
// make sure to use different prefix for head and elements.
let final_head_key = if let Some(instance) = instance {
let head_key = if let Some(instance) = instance {
let const_name = Ident::new(
&format!("{}{}", HEAD_KEY_FOR, name.to_string()), proc_macro2::Span::call_site()
);
quote!{ #instance::#const_name.as_bytes() }
} else {
let final_head_key = format!("head of {}", prefix);
quote!{ #final_head_key.as_bytes() }
let head_key = format!("head of {}", prefix);
quote!{ #head_key.as_bytes() }
};
let DeclStorageTypeInfos { typ, value_type, is_option, .. } = type_infos;
@@ -308,8 +308,8 @@ impl<'a, I: Iterator<Item=syn::Meta>> Impls<'a, I> {
#final_prefix
}
fn final_head_key() -> &'static [u8] {
#final_head_key
fn head_key() -> &'static [u8] {
#head_key
}
fn from_optional_value_to_query(v: Option<#typ>) -> Self::Query {