mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 05:11:02 +00:00
Reintroduce msg dispatch status reporting (#2027)
* Use an actual Result inside MessageDispatchResult We need this in order to distinguish between Ok and Err * Revert #1660 * Fixes + simplifications * Implement review suggestions
This commit is contained in:
committed by
Bastian Köcher
parent
4d29753f73
commit
3b968a2aba
@@ -90,7 +90,7 @@ pub trait MessageDispatch<AccountId> {
|
||||
type DispatchPayload: Decode;
|
||||
|
||||
/// Fine-grained result of single message dispatch (for better diagnostic purposes)
|
||||
type DispatchLevelResult: Clone + sp_std::fmt::Debug + Eq;
|
||||
type DispatchError: Clone + sp_std::fmt::Debug + Eq;
|
||||
|
||||
/// Estimate dispatch weight.
|
||||
///
|
||||
@@ -109,7 +109,7 @@ pub trait MessageDispatch<AccountId> {
|
||||
fn dispatch(
|
||||
relayer_account: &AccountId,
|
||||
message: DispatchMessage<Self::DispatchPayload>,
|
||||
) -> MessageDispatchResult<Self::DispatchLevelResult>;
|
||||
) -> MessageDispatchResult<Self::DispatchError>;
|
||||
}
|
||||
|
||||
/// Manages payments that are happening at the target chain during message delivery transaction.
|
||||
@@ -190,7 +190,7 @@ impl<MessagesProof, DispatchPayload: Decode, AccountId> MessageDispatch<AccountI
|
||||
for ForbidInboundMessages<MessagesProof, DispatchPayload>
|
||||
{
|
||||
type DispatchPayload = DispatchPayload;
|
||||
type DispatchLevelResult = ();
|
||||
type DispatchError = ();
|
||||
|
||||
fn dispatch_weight(_message: &mut DispatchMessage<Self::DispatchPayload>) -> Weight {
|
||||
Weight::MAX
|
||||
@@ -199,7 +199,7 @@ impl<MessagesProof, DispatchPayload: Decode, AccountId> MessageDispatch<AccountI
|
||||
fn dispatch(
|
||||
_: &AccountId,
|
||||
_: DispatchMessage<Self::DispatchPayload>,
|
||||
) -> MessageDispatchResult<Self::DispatchLevelResult> {
|
||||
MessageDispatchResult { unspent_weight: Weight::zero(), dispatch_level_result: () }
|
||||
) -> MessageDispatchResult<Self::DispatchError> {
|
||||
MessageDispatchResult { unspent_weight: Weight::zero(), dispatch_result: Err(()) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user