pub trait OnchainStateApi<Block: BlockT, AccountId, Balance>: Core<Block>where
AccountId: Encode + Decode,
Balance: Encode + Decode,{
// Provided methods
fn free_balance(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
account_id: AccountId,
) -> Result<Balance, ApiError> { ... }
fn get_open_channel_for_chain(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
dst_chain_id: ChainId,
) -> Result<Option<ChannelId>, ApiError> { ... }
fn verify_proof_and_extract_leaf(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
proof: ConsensusChainMmrLeafProof<NumberFor<Block>, Block::Hash, H256>,
) -> Result<Option<MmrLeaf<NumberFor<Block>, Block::Hash>>, ApiError> { ... }
}
Expand description
Api for querying onchain state in the test
Provided Methods§
sourcefn free_balance(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
account_id: AccountId,
) -> Result<Balance, ApiError>
fn free_balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, account_id: AccountId, ) -> Result<Balance, ApiError>
Api to get the free balance of the given account
sourcefn get_open_channel_for_chain(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
dst_chain_id: ChainId,
) -> Result<Option<ChannelId>, ApiError>
fn get_open_channel_for_chain( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, dst_chain_id: ChainId, ) -> Result<Option<ChannelId>, ApiError>
Returns the last open channel for a given domain.
sourcefn verify_proof_and_extract_leaf(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
proof: ConsensusChainMmrLeafProof<NumberFor<Block>, Block::Hash, H256>,
) -> Result<Option<MmrLeaf<NumberFor<Block>, Block::Hash>>, ApiError>
fn verify_proof_and_extract_leaf( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, proof: ConsensusChainMmrLeafProof<NumberFor<Block>, Block::Hash, H256>, ) -> Result<Option<MmrLeaf<NumberFor<Block>, Block::Hash>>, ApiError>
Verify the mmr proof statelessly and extract the state root.