More accurate dispatch_result: true/false (#1659)

This commit is contained in:
Branislav Kontur
2022-11-22 13:23:48 +01:00
committed by Bastian Köcher
parent 59b36b43bf
commit 56d58d60da
+33 -7
View File
@@ -511,14 +511,40 @@ pub mod target {
};
let xcm_outcome = do_dispatch();
log::trace!(
target: "runtime::bridge-dispatch",
"Incoming message {:?} dispatched with result: {:?}",
message_id,
xcm_outcome,
);
let dispatch_result = match xcm_outcome {
Ok(outcome) => {
log::trace!(
target: "runtime::bridge-dispatch",
"Incoming message {:?} dispatched with result: {:?}",
message_id,
outcome,
);
match outcome.ensure_execution() {
Ok(_weight) => true,
Err(e) => {
log::error!(
target: "runtime::bridge-dispatch",
"Incoming message {:?} was not dispatched, error: {:?}",
message_id,
e,
);
false
},
}
},
Err(e) => {
log::error!(
target: "runtime::bridge-dispatch",
"Incoming message {:?} was not dispatched, codec error: {:?}",
message_id,
e,
);
false
},
};
MessageDispatchResult {
dispatch_result: true,
dispatch_result,
unspent_weight: Weight::zero(),
dispatch_fee_paid_during_dispatch: false,
}