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:
Svyatoslav Nikolsky authored and Bastian Köcher committed 2024-04-10 10:28:37 +02:00
1 parent dee8d6df94
commit 9414c0d6fe
3 files changed
+53 -17

No files matched your search

@@ -41,6 +41,9 @@ pub trait MessageDispatch<MessageId> {
///
/// `id` is a short unique identifier of the message.
///
/// Returns post-dispatch (actual) message weight.
fn dispatch(bridge: InstanceId, id: MessageId, message: Self::Message);
/// If message is `Ok`, then it should be dispatched. If it is `Err`, then it's just
/// a sign that some other component has rejected the message even before it has
/// reached `dispatch` method (right now this may only be caused if we fail to decode
/// the whole message).
fn dispatch(bridge: InstanceId, id: MessageId, message: Result<Self::Message, ()>);
}