mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 07:31:02 +00:00
Emit dispatch message when whole message (payload) has invalid encoding (#664)
* emit dispatch message when whole message (payload) has invalid encoding * DispatchMessage::dispatch accepts Result
This commit is contained in:
committed by
Bastian Köcher
parent
dee8d6df94
commit
9414c0d6fe
@@ -381,7 +381,9 @@ pub mod target {
|
||||
for FromBridgedChainMessageDispatch<B, ThisRuntime, ThisCallDispatchInstance>
|
||||
where
|
||||
ThisCallDispatchInstance: frame_support::traits::Instance,
|
||||
ThisRuntime: pallet_bridge_call_dispatch::Config<ThisCallDispatchInstance>,
|
||||
ThisRuntime: pallet_bridge_call_dispatch::Config<ThisCallDispatchInstance, MessageId = (LaneId, MessageNonce)>,
|
||||
<ThisRuntime as pallet_bridge_call_dispatch::Config<ThisCallDispatchInstance>>::Event:
|
||||
From<pallet_bridge_call_dispatch::RawEvent<(LaneId, MessageNonce), ThisCallDispatchInstance>>,
|
||||
pallet_bridge_call_dispatch::Module<ThisRuntime, ThisCallDispatchInstance>:
|
||||
bp_message_dispatch::MessageDispatch<
|
||||
(LaneId, MessageNonce),
|
||||
@@ -402,13 +404,12 @@ pub mod target {
|
||||
}
|
||||
|
||||
fn dispatch(message: DispatchMessage<Self::DispatchPayload, BalanceOf<BridgedChain<B>>>) {
|
||||
if let Ok(payload) = message.data.payload {
|
||||
pallet_bridge_call_dispatch::Module::<ThisRuntime, ThisCallDispatchInstance>::dispatch(
|
||||
B::INSTANCE,
|
||||
(message.key.lane_id, message.key.nonce),
|
||||
payload.0,
|
||||
);
|
||||
}
|
||||
let message_id = (message.key.lane_id, message.key.nonce);
|
||||
pallet_bridge_call_dispatch::Module::<ThisRuntime, ThisCallDispatchInstance>::dispatch(
|
||||
B::INSTANCE,
|
||||
message_id,
|
||||
message.data.payload.map_err(drop).map(|payload| payload.0),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user