Improve PaysFee trait and dispatch info logic in utility module (#4606)

* pass target to PaysFee trait and allow batch call to be free if all its calls are free

* bump version

* fix error
This commit is contained in:
Xiliang Chen
2020-01-13 20:48:34 +13:00
committed by Gavin Wood
parent af4ddd2dff
commit 507909c3be
6 changed files with 39 additions and 29 deletions
+6 -4
View File
@@ -1312,8 +1312,9 @@ macro_rules! decl_module {
&$weight,
($( $param_name, )*)
);
let pays_fee = <dyn $crate::dispatch::PaysFee>::pays_fee(
&$weight
let pays_fee = <dyn $crate::dispatch::PaysFee<( $( & $param, )* )>>::pays_fee(
&$weight,
($( $param_name, )*)
);
return $crate::dispatch::DispatchInfo { weight, class, pays_fee };
}
@@ -1331,8 +1332,9 @@ macro_rules! decl_module {
&$crate::dispatch::SimpleDispatchInfo::default(),
()
);
let pays_fee = <dyn $crate::dispatch::PaysFee>::pays_fee(
&$crate::dispatch::SimpleDispatchInfo::default()
let pays_fee = <dyn $crate::dispatch::PaysFee<_>>::pays_fee(
&$crate::dispatch::SimpleDispatchInfo::default(),
()
);
$crate::dispatch::DispatchInfo { weight, class, pays_fee }