mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 21:01:05 +00:00
Improve fees module (#1821)
* remove amount associated * make a new trait to bound some arithmetics to balances or assets: It also remove arithmetic bounds of srml-support::traits::Currency. To update your code then use srml_support::traits::ArithmeticType like: `type Currency: ArithmeticType + Currency<Self::AccountId, Balance=BalanceOf<Self>>; ` with `type BalanceOf<T> = <<T as Trait>::Currency as ArithmeticType>::Type; ` * improve decl_storage when it explicit serde bound: basically don't try to be smarter than rust and just use where clause.
This commit is contained in:
@@ -192,13 +192,10 @@ fn decl_store_extra_genesis(
|
||||
is_trait_needed = true;
|
||||
has_trait_field = true;
|
||||
}
|
||||
for t in ext::get_non_bound_serde_derive_types(type_infos.value_type, &traitinstance) {
|
||||
serde_complete_bound.insert(t);
|
||||
}
|
||||
|
||||
serde_complete_bound.insert(type_infos.value_type);
|
||||
if let DeclStorageTypeInfosKind::Map { key_type, .. } = type_infos.kind {
|
||||
for t in ext::get_non_bound_serde_derive_types(key_type, &traitinstance) {
|
||||
serde_complete_bound.insert(t);
|
||||
}
|
||||
serde_complete_bound.insert(key_type);
|
||||
}
|
||||
let storage_type = type_infos.typ.clone();
|
||||
config_field.extend(match type_infos.kind {
|
||||
@@ -285,9 +282,7 @@ fn decl_store_extra_genesis(
|
||||
has_trait_field = true;
|
||||
}
|
||||
|
||||
for t in ext::get_non_bound_serde_derive_types(extra_type, &traitinstance).into_iter() {
|
||||
serde_complete_bound.insert(t);
|
||||
}
|
||||
serde_complete_bound.insert(extra_type);
|
||||
|
||||
let extrafield = &extra_field.content;
|
||||
genesis_extrafields.extend(quote!{
|
||||
@@ -315,6 +310,7 @@ fn decl_store_extra_genesis(
|
||||
let serde_bug_bound = if !serde_complete_bound.is_empty() {
|
||||
let mut b_ser = String::new();
|
||||
let mut b_dser = String::new();
|
||||
// panic!("{:#?}", serde_complete_bound);
|
||||
serde_complete_bound.into_iter().for_each(|bound| {
|
||||
let stype = quote!(#bound);
|
||||
b_ser.push_str(&format!("{} : {}::serde::Serialize, ", stype, scrate));
|
||||
|
||||
Reference in New Issue
Block a user