Added generic DispatchLevelResult to the MessageDispatchResult (#1670)

* Added generic DispatchLevelResult to the MessageDispatchResult

* Removed unnecessery `Clone + Decode + sp_std::fmt::Debug + Eq` + clippy
This commit is contained in:
Branislav Kontur
2022-11-30 16:44:30 +01:00
committed by Bastian Köcher
parent b99267764c
commit 02ef3a1a25
10 changed files with 46 additions and 17 deletions
+3 -1
View File
@@ -449,6 +449,7 @@ pub mod target {
WeightCredit: Get<Weight>,
{
type DispatchPayload = FromBridgedChainMessagePayload<CallOf<ThisChain<B>>>;
type DispatchLevelResult = ();
fn dispatch_weight(
message: &mut DispatchMessage<Self::DispatchPayload>,
@@ -482,7 +483,7 @@ pub mod target {
fn dispatch(
_relayer_account: &AccountIdOf<ThisChain<B>>,
message: DispatchMessage<Self::DispatchPayload>,
) -> MessageDispatchResult {
) -> MessageDispatchResult<Self::DispatchLevelResult> {
let message_id = (message.key.lane_id, message.key.nonce);
let do_dispatch = move || -> sp_std::result::Result<Outcome, codec::Error> {
let FromBridgedChainMessagePayload { xcm: (location, xcm), weight: weight_limit } =
@@ -544,6 +545,7 @@ pub mod target {
MessageDispatchResult {
unspent_weight: Weight::zero(),
dispatch_fee_paid_during_dispatch: false,
dispatch_level_result: (),
}
}
}