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§
sourcefn 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_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.
fn submit_receipt_unsigned( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, singleton_receipt: SealedSingletonReceipt<NumberFor<Block>, Block::Hash, DomainHeader, Balance>, ) -> Result<(), ApiError>
sourcefn 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 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.
sourcefn extrinsics_shuffling_seed(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Randomness, ApiError>
fn extrinsics_shuffling_seed( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Randomness, ApiError>
Generates a randomness seed for extrinsics shuffling.
sourcefn domain_runtime_code(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<Option<Vec<u8>>, ApiError>
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
.
sourcefn runtime_id(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<Option<RuntimeId>, ApiError>
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
.
sourcefn domain_instance_data(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<Option<(DomainInstanceData, NumberFor<Block>)>, ApiError>
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
.
sourcefn 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>
Returns the current timestamp at given height.
sourcefn domain_tx_range(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<U256, ApiError>
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.
sourcefn genesis_state_root(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<Option<H256>, ApiError>
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
sourcefn head_receipt_number(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<HeaderNumberFor<DomainHeader>, ApiError>
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.
sourcefn oldest_unconfirmed_receipt_number(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<Option<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>
Returns the block number of oldest unconfirmed execution receipt.
sourcefn domain_bundle_limit(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<Option<DomainBundleLimit>, ApiError>
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.
sourcefn non_empty_er_exists(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<bool, ApiError>
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.
sourcefn domain_best_number(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<Option<HeaderNumberFor<DomainHeader>>, ApiError>
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.
sourcefn execution_receipt(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
receipt_hash: HeaderHashFor<DomainHeader>,
) -> Result<Option<ExecutionReceiptFor<DomainHeader, Block, Balance>>, ApiError>
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
sourcefn domain_operators(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<Option<(BTreeMap<OperatorId, Balance>, Vec<OperatorId>)>, ApiError>
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
sourcefn operator_id_by_signing_key(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
signing_key: OperatorPublicKey,
) -> Result<Option<OperatorId>, ApiError>
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
sourcefn receipt_hash(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
domain_number: HeaderNumberFor<DomainHeader>,
) -> Result<Option<HeaderHashFor<DomainHeader>>, 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>
Returns the execution receipt hash of the given domain and domain block number
sourcefn consensus_chain_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>
Return the consensus chain byte fee that will used to charge the domain transaction for consensus chain storage fee
sourcefn latest_confirmed_domain_block(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<Option<(HeaderNumberFor<DomainHeader>, 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>
Returns the latest confirmed domain block number and hash
sourcefn 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 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
sourcefn storage_fund_account_balance(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
operator_id: OperatorId,
) -> Result<Balance, ApiError>
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
sourcefn 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 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
sourcefn domain_sudo_call(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<Option<Vec<u8>>, ApiError>
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.
sourcefn last_confirmed_domain_block_receipt(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
domain_id: DomainId,
) -> Result<Option<ExecutionReceiptFor<DomainHeader, Block, Balance>>, 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>
Return last confirmed domain block execution receipt.