referrerpolicy=no-referrer-when-downgrade
substrate_relay_helper::cli::relay_headers_and_messages

Trait Full2WayBridgeBase

Source
pub trait Full2WayBridgeBase:
    Sized
    + Send
    + Sync {
    type Params;
    type Left: ChainWithTransactions + ChainWithRuntimeVersion;
    type Right: ChainWithTransactions + ChainWithRuntimeVersion;

    // Required methods
    fn common(&self) -> &Full2WayBridgeCommonParams<Self::Left, Self::Right>;
    fn mut_common(
        &mut self,
    ) -> &mut Full2WayBridgeCommonParams<Self::Left, Self::Right>;
    fn start_on_demand_headers_relayers<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(Arc<dyn OnDemandRelay<Self::Left, Self::Right>>, Arc<dyn OnDemandRelay<Self::Right, Self::Left>>)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Base portion of the bidirectional complex relay.

This main purpose of extracting this trait is that in different relays the implementation of start_on_demand_headers_relayers method will be different. But the number of implementations is limited to relay <> relay, parachain <> relay and parachain <> parachain. This trait allows us to reuse these implementations in different bridges.

Required Associated Types§

Source

type Params

The CLI params for the bridge.

Source

type Left: ChainWithTransactions + ChainWithRuntimeVersion

The left relay chain.

Source

type Right: ChainWithTransactions + ChainWithRuntimeVersion

The right destination chain (it can be a relay or a parachain).

Required Methods§

Source

fn common(&self) -> &Full2WayBridgeCommonParams<Self::Left, Self::Right>

Reference to common relay parameters.

Source

fn mut_common( &mut self, ) -> &mut Full2WayBridgeCommonParams<Self::Left, Self::Right>

Mutable reference to common relay parameters.

Source

fn start_on_demand_headers_relayers<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(Arc<dyn OnDemandRelay<Self::Left, Self::Right>>, Arc<dyn OnDemandRelay<Self::Right, Self::Left>>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start on-demand headers relays.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Left: Chain<Hash = ParaHash> + ChainWithTransactions + ChainWithRuntimeVersion + Parachain, Right: Chain<Hash = ParaHash> + ChainWithTransactions + ChainWithRuntimeVersion + Parachain, LeftRelay: Chain<BlockNumber = RelayBlockNumber, Hash = RelayBlockHash, Hasher = RelayBlockHasher> + ChainWithRuntimeVersion, RightRelay: Chain<BlockNumber = RelayBlockNumber, Hash = RelayBlockHash, Hasher = RelayBlockHasher> + ChainWithRuntimeVersion, L2R: CliBridgeBase<Source = Left, Target = Right> + MessagesCliBridge + ParachainToRelayHeadersCliBridge<SourceRelay = LeftRelay>, R2L: CliBridgeBase<Source = Right, Target = Left> + MessagesCliBridge + ParachainToRelayHeadersCliBridge<SourceRelay = RightRelay>> Full2WayBridgeBase for ParachainToParachainBridge<L2R, R2L>
where AccountIdOf<Left>: From<<AccountKeyPairOf<Left> as Pair>::Public>, AccountIdOf<Right>: From<<AccountKeyPairOf<Right> as Pair>::Public>,

Source§

impl<Left: ChainWithTransactions + ChainWithRuntimeVersion, Right: Chain<Hash = ParaHash> + ChainWithTransactions + ChainWithRuntimeVersion + Parachain, RightRelay: Chain<BlockNumber = RelayBlockNumber, Hash = RelayBlockHash, Hasher = RelayBlockHasher> + ChainWithRuntimeVersion, L2R: CliBridgeBase<Source = Left, Target = Right> + MessagesCliBridge + RelayToRelayHeadersCliBridge, R2L: CliBridgeBase<Source = Right, Target = Left> + MessagesCliBridge + ParachainToRelayHeadersCliBridge<SourceRelay = RightRelay>> Full2WayBridgeBase for RelayToParachainBridge<L2R, R2L>
where AccountIdOf<Left>: From<<AccountKeyPairOf<Left> as Pair>::Public>, AccountIdOf<Right>: From<<AccountKeyPairOf<Right> as Pair>::Public>,

Source§

type Params = RelayToParachainBridge<L2R, R2L>

Source§

type Left = Left

Source§

type Right = Right

Source§

impl<Left: ChainWithTransactions + ChainWithRuntimeVersion, Right: ChainWithTransactions + ChainWithRuntimeVersion, L2R: CliBridgeBase<Source = Left, Target = Right> + MessagesCliBridge + RelayToRelayHeadersCliBridge, R2L: CliBridgeBase<Source = Right, Target = Left> + MessagesCliBridge + RelayToRelayHeadersCliBridge> Full2WayBridgeBase for RelayToRelayBridge<L2R, R2L>
where AccountIdOf<Left>: From<<AccountKeyPairOf<Left> as Pair>::Public>, AccountIdOf<Right>: From<<AccountKeyPairOf<Right> as Pair>::Public>,

Source§

type Params = RelayToRelayBridge<L2R, R2L>

Source§

type Left = Left

Source§

type Right = Right