mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 16:55:43 +00:00
Makes storage hashers optional in dev mode (#13815)
* Initial changes * Adds UI test for error when _ is used without dev_mode * Minor * ".git/.scripts/commands/fmt/fmt.sh" * Adds test to verify hasher --------- Co-authored-by: command-bot <>
This commit is contained in:
@@ -269,6 +269,19 @@ pub fn process_generics(def: &mut Def) -> syn::Result<Vec<ResultOnEmptyStructMet
|
||||
Metadata::DoubleMap { .. } => (5, 6, 7),
|
||||
};
|
||||
|
||||
if storage_def.use_default_hasher {
|
||||
let hasher_indices: Vec<usize> = match storage_def.metadata {
|
||||
Metadata::Map { .. } | Metadata::CountedMap { .. } => vec![1],
|
||||
Metadata::DoubleMap { .. } => vec![1, 3],
|
||||
_ => vec![],
|
||||
};
|
||||
for hasher_idx in hasher_indices {
|
||||
args.args[hasher_idx] = syn::GenericArgument::Type(
|
||||
syn::parse_quote!(#frame_support::Blake2_128Concat),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if query_idx < args.args.len() {
|
||||
if let syn::GenericArgument::Type(query_kind) = args.args.index_mut(query_idx) {
|
||||
set_result_query_type_parameter(query_kind)?;
|
||||
|
||||
Reference in New Issue
Block a user