mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 13:21:01 +00:00
DeliveryConfirmationPayments trait for paying relayer rewards at the source chain (#1653)
* DeliveryConfirmationPayments * ref proper PR in TODO
This commit is contained in:
committed by
Bastian Köcher
parent
7014046485
commit
aeeb53343e
@@ -125,6 +125,37 @@ impl<SenderOrigin, AccountId> MessageDeliveryAndDispatchPayment<SenderOrigin, Ac
|
||||
}
|
||||
}
|
||||
|
||||
/// Manages payments that are happening at the source chain during delivery confirmation
|
||||
/// transaction.
|
||||
pub trait DeliveryConfirmationPayments<AccountId> {
|
||||
/// Error type.
|
||||
type Error: Debug + Into<&'static str>;
|
||||
|
||||
/// Pay rewards for delivering messages to the given relayers.
|
||||
///
|
||||
/// The implementation may also choose to pay reward to the `confirmation_relayer`, which is
|
||||
/// a relayer that has submitted delivery confirmation transaction.
|
||||
fn pay_reward(
|
||||
lane_id: LaneId,
|
||||
messages_relayers: VecDeque<UnrewardedRelayer<AccountId>>,
|
||||
confirmation_relayer: &AccountId,
|
||||
received_range: &RangeInclusive<MessageNonce>,
|
||||
);
|
||||
}
|
||||
|
||||
impl<AccountId> DeliveryConfirmationPayments<AccountId> for () {
|
||||
type Error = &'static str;
|
||||
|
||||
fn pay_reward(
|
||||
_lane_id: LaneId,
|
||||
_messages_relayers: VecDeque<UnrewardedRelayer<AccountId>>,
|
||||
_confirmation_relayer: &AccountId,
|
||||
_received_range: &RangeInclusive<MessageNonce>,
|
||||
) {
|
||||
// this implementation is not rewarding relayers at all
|
||||
}
|
||||
}
|
||||
|
||||
/// Send message artifacts.
|
||||
#[derive(Eq, RuntimeDebug, PartialEq)]
|
||||
pub struct SendMessageArtifacts {
|
||||
|
||||
Reference in New Issue
Block a user