subspace_test_primitives/
lib.rs#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Decode, Encode};
use sp_core::H256;
use sp_messenger::messages::{ChainId, ChannelId};
use sp_runtime::traits::NumberFor;
use sp_subspace_mmr::{ConsensusChainMmrLeafProof, MmrLeaf};
sp_api::decl_runtime_apis! {
pub trait OnchainStateApi<AccountId, Balance>
where
AccountId: Encode + Decode,
Balance: Encode + Decode
{
fn free_balance(account_id: AccountId) -> Balance;
fn get_open_channel_for_chain(dst_chain_id: ChainId) -> Option<ChannelId>;
fn verify_proof_and_extract_leaf(proof: ConsensusChainMmrLeafProof<NumberFor<Block>, Block::Hash, H256>) -> Option<MmrLeaf<NumberFor<Block>, Block::Hash>>;
}
}