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§
sourcetype Runtime: MessagesConfig<<Self::Msgs as RefundableMessagesLaneId>::Instance> + RelayersConfig
type Runtime: MessagesConfig<<Self::Msgs as RefundableMessagesLaneId>::Instance> + RelayersConfig
This chain runtime.
sourcetype Msgs: RefundableMessagesLaneId
type Msgs: RefundableMessagesLaneId
Messages pallet and lane reference.
sourcetype Refund: RefundCalculator<Balance = <Self::Runtime as RelayersConfig>::Reward>
type Refund: RefundCalculator<Balance = <Self::Runtime as RelayersConfig>::Reward>
Refund amount calculator.
sourcetype Priority: Get<TransactionPriority>
type Priority: Get<TransactionPriority>
Priority boost calculator.
sourcetype Id: StaticStrProvider
type Id: StaticStrProvider
Signed extension unique identifier.
Required Methods§
sourcefn expand_call(
call: &<Self::Runtime as Config>::RuntimeCall
) -> Vec<&<Self::Runtime as Config>::RuntimeCall>
fn expand_call( call: &<Self::Runtime as Config>::RuntimeCall ) -> Vec<&<Self::Runtime as Config>::RuntimeCall>
Unpack batch runtime call.
sourcefn parse_and_check_for_obsolete_call(
call: &<Self::Runtime as Config>::RuntimeCall
) -> Result<Option<CallInfo>, TransactionValidityError>
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.
sourcefn check_obsolete_parsed_call(
call: &<Self::Runtime as Config>::RuntimeCall
) -> Result<&<Self::Runtime as Config>::RuntimeCall, TransactionValidityError>
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.
Provided Methods§
sourcefn 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 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.
sourcefn bundled_messages_for_priority_boost(
call_info: Option<&CallInfo>
) -> Option<MessageNonce>
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.