Compute weight only once. (#5780)

This commit is contained in:
Tomasz Drwięga
2020-04-25 14:01:21 +02:00
committed by GitHub
parent a08bf89662
commit ef1c2d0615
+4 -3
View File
@@ -1433,16 +1433,17 @@ macro_rules! decl_module {
match *self {
$(
$call_type::$fn_name( $( ref $param_name ),* ) => {
let base_weight = $weight;
let weight = <dyn $crate::dispatch::WeighData<( $( & $param, )* )>>::weigh_data(
&$weight,
&base_weight,
($( $param_name, )*)
);
let class = <dyn $crate::dispatch::ClassifyDispatch<( $( & $param, )* )>>::classify_dispatch(
&$weight,
&base_weight,
($( $param_name, )*)
);
let pays_fee = <dyn $crate::dispatch::PaysFee<( $( & $param, )* )>>::pays_fee(
&$weight,
&base_weight,
($( $param_name, )*)
);
$crate::dispatch::DispatchInfo {