Trait sp_messenger::RelayerApi

source ·
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§

source

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.

source

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.

source

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.

source

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.

source

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.

source

fn updated_channels( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<BTreeSet<(ChainId, ChannelId)>, ApiError>

Returns the list of channels updated in the given block.

source

fn channel_storage_key( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, chain_id: ChainId, channel_id: ChannelId, ) -> Result<Vec<u8>, ApiError>

Returns storage key for channels for given chain and channel id.

Trait Implementations§

source§

impl<Block: BlockT, BlockNumber, CNumber, CHash> RuntimeApiInfo for dyn RelayerApi<Block, BlockNumber, CNumber, CHash>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 2u32

The version of the runtime api.

Implementors§