pub trait RefundSignedExtension: 'static + Clone + Codec + Debug + Default + Eq + PartialEq + Send + Sync + TypeInfo {
    type Runtime: MessagesConfig<<Self::Msgs as RefundableMessagesLaneId>::Instance> + RelayersConfig;
    type Msgs: RefundableMessagesLaneId;
    type Refund: RefundCalculator<Balance = <Self::Runtime as RelayersConfig>::Reward>;
    type Priority: Get<TransactionPriority>;
    type Id: StaticStrProvider;

    // Required methods
    fn expand_call(
        call: &<Self::Runtime as Config>::RuntimeCall
    ) -> Vec<&<Self::Runtime as Config>::RuntimeCall>;
    fn parse_and_check_for_obsolete_call(
        call: &<Self::Runtime as Config>::RuntimeCall
    ) -> Result<Option<CallInfo>, TransactionValidityError>;
    fn check_obsolete_parsed_call(
        call: &<Self::Runtime as Config>::RuntimeCall
    ) -> Result<&<Self::Runtime as Config>::RuntimeCall, TransactionValidityError>;
    fn additional_call_result_check(
        relayer: &<Self::Runtime as Config>::AccountId,
        call_info: &CallInfo,
        extra_weight: &mut Weight,
        extra_size: &mut u32
    ) -> bool;

    // Provided methods
    fn analyze_call_result(
        pre: Option<Option<PreDispatchData<<Self::Runtime as Config>::AccountId>>>,
        info: &DispatchInfo,
        post_info: &PostDispatchInfo,
        len: usize,
        result: &DispatchResult
    ) -> RelayerAccountAction<<Self::Runtime as Config>::AccountId, <Self::Runtime as RelayersConfig>::Reward> { ... }
    fn bundled_messages_for_priority_boost(
        call_info: Option<&CallInfo>
    ) -> Option<MessageNonce> { ... }
}
Expand description

Everything common among our refund signed extensions.

Required Associated Types§

source

type Runtime: MessagesConfig<<Self::Msgs as RefundableMessagesLaneId>::Instance> + RelayersConfig

This chain runtime.

source

type Msgs: RefundableMessagesLaneId

Messages pallet and lane reference.

source

type Refund: RefundCalculator<Balance = <Self::Runtime as RelayersConfig>::Reward>

Refund amount calculator.

source

type Priority: Get<TransactionPriority>

Priority boost calculator.

source

type Id: StaticStrProvider

Signed extension unique identifier.

Required Methods§

source

fn expand_call( call: &<Self::Runtime as Config>::RuntimeCall ) -> Vec<&<Self::Runtime as Config>::RuntimeCall>

Unpack batch runtime call.

source

fn parse_and_check_for_obsolete_call( call: &<Self::Runtime as Config>::RuntimeCall ) -> Result<Option<CallInfo>, TransactionValidityError>

Given runtime call, check if it has supported format. Additionally, check if any of (optionally batched) calls are obsolete and we shall reject the transaction.

source

fn check_obsolete_parsed_call( call: &<Self::Runtime as Config>::RuntimeCall ) -> Result<&<Self::Runtime as Config>::RuntimeCall, TransactionValidityError>

Check if parsed call is already obsolete.

source

fn additional_call_result_check( relayer: &<Self::Runtime as Config>::AccountId, call_info: &CallInfo, extra_weight: &mut Weight, extra_size: &mut u32 ) -> bool

Called from post-dispatch and shall perform additional checks (apart from messages transaction success) of given call result.

Provided Methods§

source

fn analyze_call_result( pre: Option<Option<PreDispatchData<<Self::Runtime as Config>::AccountId>>>, info: &DispatchInfo, post_info: &PostDispatchInfo, len: usize, result: &DispatchResult ) -> RelayerAccountAction<<Self::Runtime as Config>::AccountId, <Self::Runtime as RelayersConfig>::Reward>

Given post-dispatch information, analyze the outcome of relayer call and return actions that need to be performed on relayer account.

source

fn bundled_messages_for_priority_boost( call_info: Option<&CallInfo> ) -> Option<MessageNonce>

Returns number of bundled messages Some(_), if the given call info is a:

  • message delivery transaction;

  • with reasonable bundled messages that may be accepted by the messages pallet.

This function is used to check whether the transaction priority should be virtually boosted. The relayer registration (we only boost priority for registered relayer transactions) must be checked outside.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Runtime, GrandpaInstance, Msgs, Refund, Priority, Id> RefundSignedExtension for RefundBridgedGrandpaMessages<Runtime, GrandpaInstance, Msgs, Refund, Priority, Id>
where Self: 'static + Send + Sync, Runtime: UtilityConfig<RuntimeCall = <Runtime as Config>::RuntimeCall> + BoundedBridgeGrandpaConfig<GrandpaInstance> + MessagesConfig<Msgs::Instance> + RelayersConfig, GrandpaInstance: 'static, Msgs: RefundableMessagesLaneId, Refund: RefundCalculator<Balance = Runtime::Reward>, Priority: Get<TransactionPriority>, Id: StaticStrProvider, <Runtime as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<CallableCallFor<Pallet<Runtime>, Runtime>> + GrandpaCallSubType<Runtime, GrandpaInstance> + MessagesCallSubType<Runtime, Msgs::Instance>,

§

type Runtime = Runtime

§

type Msgs = Msgs

§

type Refund = Refund

§

type Priority = Priority

§

type Id = Id

source§

impl<Runtime, Msgs, Refund, Priority, Id> RefundSignedExtension for RefundBridgedMessages<Runtime, Msgs, Refund, Priority, Id>
where Self: 'static + Send + Sync, Runtime: MessagesConfig<Msgs::Instance> + RelayersConfig, Msgs: RefundableMessagesLaneId, Refund: RefundCalculator<Balance = Runtime::Reward>, Priority: Get<TransactionPriority>, Id: StaticStrProvider, <Runtime as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + MessagesCallSubType<Runtime, Msgs::Instance>,

§

type Runtime = Runtime

§

type Msgs = Msgs

§

type Refund = Refund

§

type Priority = Priority

§

type Id = Id

source§

impl<Runtime, Para, Msgs, Refund, Priority, Id> RefundSignedExtension for RefundBridgedParachainMessages<Runtime, Para, Msgs, Refund, Priority, Id>
where Self: 'static + Send + Sync, RefundBridgedGrandpaMessages<Runtime, Runtime::BridgesGrandpaPalletInstance, Msgs, Refund, Priority, Id>: 'static + Send + Sync, Runtime: UtilityConfig<RuntimeCall = <Runtime as Config>::RuntimeCall> + BoundedBridgeGrandpaConfig<Runtime::BridgesGrandpaPalletInstance> + ParachainsConfig<Para::Instance> + MessagesConfig<Msgs::Instance> + RelayersConfig, Para: RefundableParachainId, Msgs: RefundableMessagesLaneId, Refund: RefundCalculator<Balance = Runtime::Reward>, Priority: Get<TransactionPriority>, Id: StaticStrProvider, <Runtime as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<CallableCallFor<Pallet<Runtime>, Runtime>> + GrandpaCallSubType<Runtime, Runtime::BridgesGrandpaPalletInstance> + ParachainsCallSubType<Runtime, Para::Instance> + MessagesCallSubType<Runtime, Msgs::Instance>,

§

type Runtime = Runtime

§

type Msgs = Msgs

§

type Refund = Refund

§

type Priority = Priority

§

type Id = Id