pub trait RelayerApi<Block: BlockT, BlockNumber, CNumber, CHash>: Core<Block>where
BlockNumber: Encode + Decode,
CNumber: Encode + Decode,
CHash: Encode + Decode,{
// Provided methods
fn block_messages(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<BlockMessagesWithStorageKey, ApiError> { ... }
fn outbox_message_unsigned(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
msg: CrossDomainMessage<CNumber, CHash, H256>,
) -> Result<Option<Block::Extrinsic>, ApiError> { ... }
fn inbox_response_message_unsigned(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
msg: CrossDomainMessage<CNumber, CHash, H256>,
) -> Result<Option<Block::Extrinsic>, ApiError> { ... }
fn should_relay_outbox_message(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
dst_chain_id: ChainId,
msg_id: MessageId,
) -> Result<bool, ApiError> { ... }
fn should_relay_inbox_message_response(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
dst_chain_id: ChainId,
msg_id: MessageId,
) -> Result<bool, ApiError> { ... }
fn updated_channels(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<BTreeSet<(ChainId, ChannelId)>, ApiError> { ... }
fn channel_storage_key(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
chain_id: ChainId,
channel_id: ChannelId,
) -> Result<Vec<u8>, ApiError> { ... }
}
Expand description
Api useful for relayers to fetch messages and submit transactions.
Provided Methods§
sourcefn block_messages(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<BlockMessagesWithStorageKey, ApiError>
fn block_messages( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<BlockMessagesWithStorageKey, ApiError>
Returns all the outbox and inbox responses to deliver. Storage key is used to generate the storage proof for the message.
sourcefn outbox_message_unsigned(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
msg: CrossDomainMessage<CNumber, CHash, H256>,
) -> Result<Option<Block::Extrinsic>, ApiError>
fn outbox_message_unsigned( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, msg: CrossDomainMessage<CNumber, CHash, H256>, ) -> Result<Option<Block::Extrinsic>, ApiError>
Constructs an outbox message to the dst_chain as an unsigned extrinsic.
sourcefn inbox_response_message_unsigned(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
msg: CrossDomainMessage<CNumber, CHash, H256>,
) -> Result<Option<Block::Extrinsic>, ApiError>
fn inbox_response_message_unsigned( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, msg: CrossDomainMessage<CNumber, CHash, H256>, ) -> Result<Option<Block::Extrinsic>, ApiError>
Constructs an inbox response message to the dst_chain as an unsigned extrinsic.
sourcefn should_relay_outbox_message(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
dst_chain_id: ChainId,
msg_id: MessageId,
) -> Result<bool, ApiError>
fn should_relay_outbox_message( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, dst_chain_id: ChainId, msg_id: MessageId, ) -> Result<bool, ApiError>
Returns true if the outbox message is ready to be relayed to dst_chain.
sourcefn should_relay_inbox_message_response(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
dst_chain_id: ChainId,
msg_id: MessageId,
) -> Result<bool, ApiError>
fn should_relay_inbox_message_response( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, dst_chain_id: ChainId, msg_id: MessageId, ) -> Result<bool, ApiError>
Returns true if the inbox message response is ready to be relayed to dst_chain.