pub trait OnDemandRelay<SourceChain: Chain, TargetChain: Chain>: Send + Sync {
// Required methods
fn reconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SubstrateError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn require_more_headers<'life0, 'async_trait>(
&'life0 self,
required_header: BlockNumberOf<SourceChain>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn prove_header<'life0, 'async_trait>(
&'life0 self,
required_header: BlockNumberOf<SourceChain>,
) -> Pin<Box<dyn Future<Output = Result<(HeaderIdOf<SourceChain>, Vec<CallOf<TargetChain>>), SubstrateError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
On-demand headers relay that is relaying finalizing headers only when requested.
Required Methods§
Sourcefn reconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SubstrateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SubstrateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reconnect to source and target nodes.
Sourcefn require_more_headers<'life0, 'async_trait>(
&'life0 self,
required_header: BlockNumberOf<SourceChain>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn require_more_headers<'life0, 'async_trait>(
&'life0 self,
required_header: BlockNumberOf<SourceChain>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Ask relay to relay source header with given number to the target chain.
Depending on implementation, on-demand relay may also relay required_header
ancestors
(e.g. if they’re mandatory), or its descendants. The request is considered complete if
the best avbailable header at the target chain has number that is larger than or equal
to the required_header
.
Sourcefn prove_header<'life0, 'async_trait>(
&'life0 self,
required_header: BlockNumberOf<SourceChain>,
) -> Pin<Box<dyn Future<Output = Result<(HeaderIdOf<SourceChain>, Vec<CallOf<TargetChain>>), SubstrateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prove_header<'life0, 'async_trait>(
&'life0 self,
required_header: BlockNumberOf<SourceChain>,
) -> Pin<Box<dyn Future<Output = Result<(HeaderIdOf<SourceChain>, Vec<CallOf<TargetChain>>), SubstrateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Ask relay to prove source required_header
to the TargetChain
.
Returns number of header that is proved (it may be the required_header
or one of its
descendants) and calls for delivering the proof.