Trait subspace_test_primitives::OnchainStateApi

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

source

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

source

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.

source

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.

Trait Implementations§

source§

impl<Block: BlockT, AccountId, Balance> RuntimeApiInfo for dyn OnchainStateApi<Block, AccountId, Balance>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§