sp_domains

Trait DomainsApi

Source
pub trait DomainsApi<Block: BlockT, DomainHeader: HeaderT>: Core<Block> {
Show 28 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 runtime_upgrades( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<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 domain_timestamp( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Moment, ApiError> { ... } fn timestamp( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Moment, ApiError> { ... } fn consensus_transaction_byte_fee( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Balance, ApiError> { ... } fn consensus_chain_byte_fee( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Balance, 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 receipt_hash( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, domain_id: DomainId, domain_number: HeaderNumberFor<DomainHeader>, ) -> Result<Option<HeaderHashFor<DomainHeader>>, 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

APIs used to access the 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>

Extracts the bundles successfully stored 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 current WASM bundle for the 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 the given domain_id.

Source

fn runtime_upgrades( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<RuntimeId>, ApiError>

Returns the list of runtime upgrades in the current block. Only present in API versions 2 and later.

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 the given domain_id.

Source

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

Returns the current timestamp at the current height.

Source

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

👎Deprecated since 3: Use domain_timestamp() instead

Returns the current timestamp at the current height.

Source

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

Returns the consensus transaction byte fee that will used to charge the domain transaction for consensus chain storage fees.

Source

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

👎Deprecated since 3: Use consensus_transaction_byte_fee() instead

Returns the consensus chain byte fee that will used to charge the domain transaction for consensus chain storage fees.

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>

Returns 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 block number for 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 with the given hash.

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 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 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>

Returns 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>

Returns 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>

Returns true if the given domain’s runtime code has been 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>

Returns the domain sudo calls for the given domain, if any.

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>

Returns the 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 = 3u32

The version of the runtime api.

Implementors§