sp_domains

Trait DomainsApi

source
pub trait DomainsApi<Block: BlockT, DomainHeader: HeaderT>: Core<Block> {
Show 26 methods // Provided methods fn submit_bundle_unsigned( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, opaque_bundle: OpaqueBundle<NumberFor<Block>, Block::Hash, DomainHeader, Balance>, ) -> Result<(), ApiError> { ... } fn submit_receipt_unsigned( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, singleton_receipt: SealedSingletonReceipt<NumberFor<Block>, Block::Hash, DomainHeader, Balance>, ) -> Result<(), ApiError> { ... } fn extract_successful_bundles( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, extrinsics: Vec<Block::Extrinsic>, ) -> Result<OpaqueBundles<Block, DomainHeader, Balance>, ApiError> { ... } fn extrinsics_shuffling_seed( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Randomness, ApiError> { ... } fn domain_runtime_code( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<Vec<u8>>, ApiError> { ... } fn runtime_id( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<RuntimeId>, ApiError> { ... } fn domain_instance_data( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<(DomainInstanceData, NumberFor<Block>)>, ApiError> { ... } fn timestamp( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Moment, ApiError> { ... } fn domain_tx_range( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<U256, ApiError> { ... } fn genesis_state_root( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<H256>, ApiError> { ... } fn head_receipt_number( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<HeaderNumberFor<DomainHeader>, ApiError> { ... } fn oldest_unconfirmed_receipt_number( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<HeaderNumberFor<DomainHeader>>, ApiError> { ... } fn domain_bundle_limit( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<DomainBundleLimit>, ApiError> { ... } fn non_empty_er_exists( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<bool, ApiError> { ... } fn domain_best_number( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<HeaderNumberFor<DomainHeader>>, ApiError> { ... } fn execution_receipt( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, receipt_hash: HeaderHashFor<DomainHeader>, ) -> Result<Option<ExecutionReceiptFor<DomainHeader, Block, Balance>>, ApiError> { ... } fn domain_operators( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<(BTreeMap<OperatorId, Balance>, Vec<OperatorId>)>, ApiError> { ... } fn operator_id_by_signing_key( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, signing_key: OperatorPublicKey, ) -> Result<Option<OperatorId>, ApiError> { ... } fn receipt_hash( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, domain_number: HeaderNumberFor<DomainHeader>, ) -> Result<Option<HeaderHashFor<DomainHeader>>, ApiError> { ... } fn consensus_chain_byte_fee( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Balance, ApiError> { ... } fn latest_confirmed_domain_block( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<(HeaderNumberFor<DomainHeader>, HeaderHashFor<DomainHeader>)>, ApiError> { ... } fn is_bad_er_pending_to_prune( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, receipt_hash: HeaderHashFor<DomainHeader>, ) -> Result<bool, ApiError> { ... } fn storage_fund_account_balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, operator_id: OperatorId, ) -> Result<Balance, ApiError> { ... } fn is_domain_runtime_upgraded_since( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, at: NumberFor<Block>, ) -> Result<Option<bool>, ApiError> { ... } fn domain_sudo_call( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<Vec<u8>>, ApiError> { ... } fn last_confirmed_domain_block_receipt( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<ExecutionReceiptFor<DomainHeader, Block, Balance>>, ApiError> { ... }
}
Expand description

API necessary for domains pallet.

Provided Methods§

source

fn submit_bundle_unsigned( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, opaque_bundle: OpaqueBundle<NumberFor<Block>, Block::Hash, DomainHeader, Balance>, ) -> Result<(), ApiError>

Submits the transaction bundle via an unsigned extrinsic.

source

fn submit_receipt_unsigned( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, singleton_receipt: SealedSingletonReceipt<NumberFor<Block>, Block::Hash, DomainHeader, Balance>, ) -> Result<(), ApiError>

source

fn extract_successful_bundles( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, extrinsics: Vec<Block::Extrinsic>, ) -> Result<OpaqueBundles<Block, DomainHeader, Balance>, ApiError>

Extract the bundles stored successfully from the given extrinsics.

source

fn extrinsics_shuffling_seed( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Randomness, ApiError>

Generates a randomness seed for extrinsics shuffling.

source

fn domain_runtime_code( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<Vec<u8>>, ApiError>

Returns the WASM bundle for given domain_id.

source

fn runtime_id( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<RuntimeId>, ApiError>

Returns the runtime id for given domain_id.

source

fn domain_instance_data( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<(DomainInstanceData, NumberFor<Block>)>, ApiError>

Returns the domain instance data for given domain_id.

source

fn timestamp( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Moment, ApiError>

Returns the current timestamp at given height.

source

fn domain_tx_range( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<U256, ApiError>

Returns the current Tx range for the given domain Id.

source

fn genesis_state_root( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<H256>, ApiError>

Return the genesis state root if not pruned

source

fn head_receipt_number( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<HeaderNumberFor<DomainHeader>, ApiError>

Returns the best execution chain number.

source

fn oldest_unconfirmed_receipt_number( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<HeaderNumberFor<DomainHeader>>, ApiError>

Returns the block number of oldest unconfirmed execution receipt.

source

fn domain_bundle_limit( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<DomainBundleLimit>, ApiError>

Returns the domain bundle limit of the given domain.

source

fn non_empty_er_exists( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<bool, ApiError>

Returns true if there are any ERs in the challenge period with non empty extrinsics.

source

fn domain_best_number( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<HeaderNumberFor<DomainHeader>>, ApiError>

Returns the current best number of the domain.

source

fn execution_receipt( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, receipt_hash: HeaderHashFor<DomainHeader>, ) -> Result<Option<ExecutionReceiptFor<DomainHeader, Block, Balance>>, ApiError>

Returns the execution receipt

source

fn domain_operators( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<(BTreeMap<OperatorId, Balance>, Vec<OperatorId>)>, ApiError>

Returns the current epoch and the next epoch operators of the given domain

source

fn operator_id_by_signing_key( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, signing_key: OperatorPublicKey, ) -> Result<Option<OperatorId>, ApiError>

Get operator id by signing key

source

fn receipt_hash( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, domain_number: HeaderNumberFor<DomainHeader>, ) -> Result<Option<HeaderHashFor<DomainHeader>>, ApiError>

Returns the execution receipt hash of the given domain and domain block number

source

fn consensus_chain_byte_fee( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Balance, ApiError>

Return the consensus chain byte fee that will used to charge the domain transaction for consensus chain storage fee

source

fn latest_confirmed_domain_block( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<(HeaderNumberFor<DomainHeader>, HeaderHashFor<DomainHeader>)>, ApiError>

Returns the latest confirmed domain block number and hash

source

fn is_bad_er_pending_to_prune( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, receipt_hash: HeaderHashFor<DomainHeader>, ) -> Result<bool, ApiError>

Return if the receipt is exist and pending to prune

source

fn storage_fund_account_balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, operator_id: OperatorId, ) -> Result<Balance, ApiError>

Return the balance of the storage fund account

source

fn is_domain_runtime_upgraded_since( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, at: NumberFor<Block>, ) -> Result<Option<bool>, ApiError>

Return if the domain runtime code is upgraded since at

source

fn domain_sudo_call( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<Vec<u8>>, ApiError>

Return domain sudo call.

source

fn last_confirmed_domain_block_receipt( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, ) -> Result<Option<ExecutionReceiptFor<DomainHeader, Block, Balance>>, ApiError>

Return last confirmed domain block execution receipt.

Trait Implementations§

source§

impl<Block: BlockT, DomainHeader: HeaderT> RuntimeApiInfo for dyn DomainsApi<Block, DomainHeader>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§