refund extra weight in receive_messages_delivery_proof call (#2031)

This commit is contained in:
Svyatoslav Nikolsky
2023-04-12 09:52:55 +03:00
committed by Bastian Köcher
parent f7380490c0
commit 9e48162df2
4 changed files with 104 additions and 43 deletions
@@ -98,12 +98,14 @@ pub trait DeliveryConfirmationPayments<AccountId> {
///
/// The implementation may also choose to pay reward to the `confirmation_relayer`, which is
/// a relayer that has submitted delivery confirmation transaction.
///
/// Returns number of actually rewarded relayers.
fn pay_reward(
lane_id: LaneId,
messages_relayers: VecDeque<UnrewardedRelayer<AccountId>>,
confirmation_relayer: &AccountId,
received_range: &RangeInclusive<MessageNonce>,
);
) -> MessageNonce;
}
impl<AccountId> DeliveryConfirmationPayments<AccountId> for () {
@@ -114,8 +116,9 @@ impl<AccountId> DeliveryConfirmationPayments<AccountId> for () {
_messages_relayers: VecDeque<UnrewardedRelayer<AccountId>>,
_confirmation_relayer: &AccountId,
_received_range: &RangeInclusive<MessageNonce>,
) {
) -> MessageNonce {
// this implementation is not rewarding relayers at all
0
}
}
@@ -202,6 +205,7 @@ impl<AccountId> DeliveryConfirmationPayments<AccountId> for ForbidOutboundMessag
_messages_relayers: VecDeque<UnrewardedRelayer<AccountId>>,
_confirmation_relayer: &AccountId,
_received_range: &RangeInclusive<MessageNonce>,
) {
) -> MessageNonce {
0
}
}