weights v1.5: iteration 2 (#1613)

This commit is contained in:
Svyatoslav Nikolsky
2022-10-21 13:43:07 +03:00
committed by Bastian Köcher
parent 829b23c7cf
commit e97bb57564
15 changed files with 81 additions and 70 deletions
+10 -5
View File
@@ -407,7 +407,7 @@ pub mod source {
let delivery_transaction = BridgedChain::<B>::estimate_delivery_transaction(
&payload.encode(),
true,
Weight::from_ref_time(0),
Weight::zero(),
);
let delivery_transaction_fee = BridgedChain::<B>::transaction_payment(delivery_transaction);
@@ -733,7 +733,7 @@ pub mod target {
payload.weight = Some(weight);
weight
},
_ => Weight::from_ref_time(0),
_ => Weight::zero(),
}
}
@@ -762,17 +762,22 @@ pub mod target {
location,
xcm,
hash,
weight_limit.unwrap_or(Weight::from_ref_time(0)).ref_time(),
weight_limit.unwrap_or_else(Weight::zero).ref_time(),
weight_credit.ref_time(),
);
Ok(xcm_outcome)
};
let xcm_outcome = do_dispatch();
log::trace!(target: "runtime::bridge-dispatch", "Incoming message {:?} dispatched with result: {:?}", message_id, xcm_outcome);
log::trace!(
target: "runtime::bridge-dispatch",
"Incoming message {:?} dispatched with result: {:?}",
message_id,
xcm_outcome,
);
MessageDispatchResult {
dispatch_result: true,
unspent_weight: Weight::from_ref_time(0),
unspent_weight: Weight::zero(),
dispatch_fee_paid_during_dispatch: false,
}
}