pub trait TargetClient<P: MessageLane>: RelayClient {
type BatchTransaction: BatchTransaction<SourceHeaderIdOf<P>> + Clone;
type TransactionTracker: TransactionTracker<HeaderId = TargetHeaderIdOf<P>>;
// Required methods
fn state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<TargetClientState<P>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn latest_received_nonce<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, MessageNonce), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn latest_confirmed_received_nonce<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, MessageNonce), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn unrewarded_relayers_state<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, UnrewardedRelayersState), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn prove_messages_receiving<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, P::MessagesReceivingProof), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn submit_messages_proof<'life0, 'async_trait>(
&'life0 self,
maybe_batch_tx: Option<Self::BatchTransaction>,
generated_at_header: SourceHeaderIdOf<P>,
nonces: RangeInclusive<MessageNonce>,
proof: P::MessagesProof,
) -> Pin<Box<dyn Future<Output = Result<NoncesSubmitArtifacts<Self::TransactionTracker>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn require_source_header_on_target<'life0, 'async_trait>(
&'life0 self,
id: SourceHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::BatchTransaction>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Target client trait.
Required Associated Types§
sourcetype BatchTransaction: BatchTransaction<SourceHeaderIdOf<P>> + Clone
type BatchTransaction: BatchTransaction<SourceHeaderIdOf<P>> + Clone
Type of batch transaction that submits finality and messages proof.
sourcetype TransactionTracker: TransactionTracker<HeaderId = TargetHeaderIdOf<P>>
type TransactionTracker: TransactionTracker<HeaderId = TargetHeaderIdOf<P>>
Transaction tracker to track submitted transactions.
Required Methods§
sourcefn state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<TargetClientState<P>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<TargetClientState<P>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns state of the client.
sourcefn latest_received_nonce<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, MessageNonce), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn latest_received_nonce<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, MessageNonce), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get nonce of latest received message.
sourcefn latest_confirmed_received_nonce<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, MessageNonce), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn latest_confirmed_received_nonce<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, MessageNonce), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get nonce of the latest confirmed message.
sourcefn unrewarded_relayers_state<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, UnrewardedRelayersState), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unrewarded_relayers_state<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, UnrewardedRelayersState), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get state of unrewarded relayers set at the inbound lane.
sourcefn prove_messages_receiving<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, P::MessagesReceivingProof), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prove_messages_receiving<'life0, 'async_trait>(
&'life0 self,
id: TargetHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<(TargetHeaderIdOf<P>, P::MessagesReceivingProof), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prove messages receiving at given block.
sourcefn submit_messages_proof<'life0, 'async_trait>(
&'life0 self,
maybe_batch_tx: Option<Self::BatchTransaction>,
generated_at_header: SourceHeaderIdOf<P>,
nonces: RangeInclusive<MessageNonce>,
proof: P::MessagesProof,
) -> Pin<Box<dyn Future<Output = Result<NoncesSubmitArtifacts<Self::TransactionTracker>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_messages_proof<'life0, 'async_trait>(
&'life0 self,
maybe_batch_tx: Option<Self::BatchTransaction>,
generated_at_header: SourceHeaderIdOf<P>,
nonces: RangeInclusive<MessageNonce>,
proof: P::MessagesProof,
) -> Pin<Box<dyn Future<Output = Result<NoncesSubmitArtifacts<Self::TransactionTracker>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit messages proof.
sourcefn require_source_header_on_target<'life0, 'async_trait>(
&'life0 self,
id: SourceHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::BatchTransaction>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn require_source_header_on_target<'life0, 'async_trait>(
&'life0 self,
id: SourceHeaderIdOf<P>,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::BatchTransaction>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
We need given finalized source header on target to continue synchronization.
The client may return Some(_)
, which means that nothing has happened yet and
the caller must generate and append messages proof to the batch transaction
to actually send it (along with required header) to the node.
If function has returned None
, it means that the caller now must wait for the
appearance of the source header id
at the target client.