referrerpolicy=no-referrer-when-downgrade

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§

source

type IdProvider: StaticStrProvider

Unique identifier of the signed extension that will use this configuration.

source

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.

source

type BridgeRelayersPalletInstance: 'static

Relayers pallet instance.

source

type BridgeMessagesPalletInstance: 'static

Messages pallet instance.

source

type PriorityBoostPerMessage: Get<TransactionPriority>

Additional priority that is added to base message delivery transaction priority for every additional bundled message.

source

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.

source

type LaneId: Clone + Copy + Decode + Encode + Debug

Lane identifier type.

Required Methods§

source

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.

source

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.

source

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.

Object Safety§

This trait is not object safe.

Implementors§