mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 19:51:02 +00:00
Add OnMessageAccepted callback (#1134)
* Add `OnMessageAccepted` config type * Update actual weight * Add unit test * Update weight * Remove old comment & update wrong test data * Make ci happy * Add lane_id param * update test case * Make log info more readable * Use saturating_sub * Update docs
This commit is contained in:
@@ -173,6 +173,18 @@ impl OnDeliveryConfirmed for Tuple {
|
||||
}
|
||||
}
|
||||
|
||||
/// Handler for messages have been accepted
|
||||
pub trait OnMessageAccepted {
|
||||
/// Called when a message has been accepted by message pallet.
|
||||
fn on_messages_accepted(lane: &LaneId, message: &MessageNonce) -> Weight;
|
||||
}
|
||||
|
||||
impl OnMessageAccepted for () {
|
||||
fn on_messages_accepted(_lane: &LaneId, _message: &MessageNonce) -> Weight {
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
/// Structure that may be used in place of `TargetHeaderChain`, `LaneMessageVerifier` and
|
||||
/// `MessageDeliveryAndDispatchPayment` on chains, where outbound messages are forbidden.
|
||||
pub struct ForbidOutboundMessages;
|
||||
|
||||
Reference in New Issue
Block a user