domain_test_primitives/
lib.rs1#![cfg_attr(not(feature = "std"), no_std)]
4
5use domain_runtime_primitives::EthereumAccountId;
6use parity_scale_codec::{Decode, Encode};
7use sp_domains::PermissionedActionAllowedBy;
8use sp_messenger::messages::{ChainId, ChannelId};
9use subspace_runtime_primitives::Moment;
10
11sp_api::decl_runtime_apis! {
12 pub trait TimestampApi {
14 fn domain_timestamp() -> Moment;
16 }
17}
18
19sp_api::decl_runtime_apis! {
20 pub trait OnchainStateApi<AccountId, Balance>
22 where
23 AccountId: Encode + Decode,
24 Balance: Encode + Decode
25 {
26 fn free_balance(account_id: AccountId) -> Balance;
28
29 fn get_open_channel_for_chain(dst_chain_id: ChainId) -> Option<ChannelId>;
31
32 fn consensus_transaction_byte_fee() -> Balance;
34
35 fn storage_root() -> [u8; 32];
37
38 fn total_issuance() -> Balance;
40 }
41}
42
43sp_api::decl_runtime_apis! {
44 pub trait EvmOnchainStateApi
46 {
47 fn evm_contract_creation_allowed_by() -> Option<PermissionedActionAllowedBy<EthereumAccountId>>;
50 }
51}