Trait bp_relayers::ExtensionConfig
source · pub trait ExtensionConfig {
type IdProvider: StaticStrProvider;
type Runtime: Config;
type BridgeRelayersPalletInstance: 'static;
type BridgeMessagesPalletInstance: 'static;
type PriorityBoostPerMessage: Get<TransactionPriority>;
type RemoteGrandpaChainBlockNumber: Clone + Copy + Debug;
type LaneId: Clone + Copy + Decode + Encode + Debug;
// Required methods
fn parse_and_check_for_obsolete_call(
call: &<Self::Runtime as SystemConfig>::RuntimeCall,
) -> Result<Option<ExtensionCallInfo<Self::RemoteGrandpaChainBlockNumber, Self::LaneId>>, TransactionValidityError>;
fn check_obsolete_parsed_call(
call: &<Self::Runtime as SystemConfig>::RuntimeCall,
) -> Result<&<Self::Runtime as SystemConfig>::RuntimeCall, TransactionValidityError>;
fn check_call_result(
call_info: &ExtensionCallInfo<Self::RemoteGrandpaChainBlockNumber, Self::LaneId>,
call_data: &mut ExtensionCallData,
relayer: &<Self::Runtime as SystemConfig>::AccountId,
) -> bool;
}
Expand description
Signed extension configuration.
The single pallet-bridge-relayers
instance may be shared by multiple messages
pallet instances, bridging with different remote networks. We expect every instance
of the messages pallet to add a separate signed extension to runtime. So it must
have a separate configuration.
Required Associated Types§
sourcetype IdProvider: StaticStrProvider
type IdProvider: StaticStrProvider
Unique identifier of the signed extension that will use this configuration.
sourcetype Runtime: Config
type Runtime: Config
Runtime that optionally supports batched calls. We assume that batched call succeeds if and only if all of its nested calls succeed.
sourcetype BridgeRelayersPalletInstance: 'static
type BridgeRelayersPalletInstance: 'static
Relayers pallet instance.
sourcetype BridgeMessagesPalletInstance: 'static
type BridgeMessagesPalletInstance: 'static
Messages pallet instance.
sourcetype PriorityBoostPerMessage: Get<TransactionPriority>
type PriorityBoostPerMessage: Get<TransactionPriority>
Additional priority that is added to base message delivery transaction priority for every additional bundled message.
sourcetype RemoteGrandpaChainBlockNumber: Clone + Copy + Debug
type RemoteGrandpaChainBlockNumber: Clone + Copy + Debug
Block number for the remote GRANDPA chain. Mind that this chain is not necessarily the chain that we are bridging with. If we are bridging with parachain, it must be its parent relay chain. If we are bridging with the GRANDPA chain, it must be it.
Required Methods§
sourcefn parse_and_check_for_obsolete_call(
call: &<Self::Runtime as SystemConfig>::RuntimeCall,
) -> Result<Option<ExtensionCallInfo<Self::RemoteGrandpaChainBlockNumber, Self::LaneId>>, TransactionValidityError>
fn parse_and_check_for_obsolete_call( call: &<Self::Runtime as SystemConfig>::RuntimeCall, ) -> Result<Option<ExtensionCallInfo<Self::RemoteGrandpaChainBlockNumber, Self::LaneId>>, TransactionValidityError>
Given runtime call, check if it is supported by the transaction extension. Additionally, check if call (or any of batched calls) are obsolete.
sourcefn check_obsolete_parsed_call(
call: &<Self::Runtime as SystemConfig>::RuntimeCall,
) -> Result<&<Self::Runtime as SystemConfig>::RuntimeCall, TransactionValidityError>
fn check_obsolete_parsed_call( call: &<Self::Runtime as SystemConfig>::RuntimeCall, ) -> Result<&<Self::Runtime as SystemConfig>::RuntimeCall, TransactionValidityError>
Check if runtime call is already obsolete.
sourcefn check_call_result(
call_info: &ExtensionCallInfo<Self::RemoteGrandpaChainBlockNumber, Self::LaneId>,
call_data: &mut ExtensionCallData,
relayer: &<Self::Runtime as SystemConfig>::AccountId,
) -> bool
fn check_call_result( call_info: &ExtensionCallInfo<Self::RemoteGrandpaChainBlockNumber, Self::LaneId>, call_data: &mut ExtensionCallData, relayer: &<Self::Runtime as SystemConfig>::AccountId, ) -> bool
Given runtime call info, check that this call has been successful and has updated runtime storage accordingly.