Trait sp_domains::core_api::DomainCoreApi

source ·
pub trait DomainCoreApi<Block: BlockT>: Core<Block> {
Show 20 methods // Provided methods fn extract_signer( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsics: Vec<<Block as BlockT>::Extrinsic>, ) -> Result<Vec<(Option<AccountId>, <Block as BlockT>::Extrinsic)>, ApiError> { ... } fn is_within_tx_range( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: &<Block as BlockT>::Extrinsic, bundle_vrf_hash: &U256, tx_range: &U256, ) -> Result<bool, ApiError> { ... } fn intermediate_roots( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<[u8; 32]>, ApiError> { ... } fn initialize_block_with_post_state_root( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, header: &<Block as BlockT>::Header, ) -> Result<Vec<u8>, ApiError> { ... } fn apply_extrinsic_with_post_state_root( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: <Block as BlockT>::Extrinsic, ) -> Result<Vec<u8>, ApiError> { ... } fn construct_set_code_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, code: Vec<u8>, ) -> Result<Vec<u8>, ApiError> { ... } fn construct_timestamp_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, moment: Moment, ) -> Result<Block::Extrinsic, ApiError> { ... } fn construct_consensus_chain_byte_fee_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, consensus_chain_byte_fee: Balance, ) -> Result<Block::Extrinsic, ApiError> { ... } fn construct_domain_update_chain_allowlist_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, updates: DomainAllowlistUpdates, ) -> Result<Block::Extrinsic, ApiError> { ... } fn is_inherent_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: &<Block as BlockT>::Extrinsic, ) -> Result<bool, ApiError> { ... } fn check_extrinsics_and_do_pre_dispatch( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, uxts: Vec<<Block as BlockT>::Extrinsic>, block_number: NumberFor<Block>, block_hash: <Block as BlockT>::Hash, ) -> Result<Result<(), CheckExtrinsicsValidityError>, ApiError> { ... } fn decode_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, opaque_extrinsic: OpaqueExtrinsic, ) -> Result<Result<<Block as BlockT>::Extrinsic, DecodeExtrinsicError>, ApiError> { ... } fn extrinsic_era( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: &<Block as BlockT>::Extrinsic, ) -> Result<Option<Era>, ApiError> { ... } fn extrinsic_weight( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ext: &Block::Extrinsic, ) -> Result<Weight, ApiError> { ... } fn block_fees( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<BlockFees<Balance>, ApiError> { ... } fn block_digest( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Digest, ApiError> { ... } fn block_weight( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Weight, ApiError> { ... } fn transfers( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Transfers<Balance>, ApiError> { ... } fn transfers_storage_key( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<u8>, ApiError> { ... } fn block_fees_storage_key( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<u8>, ApiError> { ... }
}
Expand description

Base API that every domain runtime must implement.

Provided Methods§

source

fn extract_signer( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsics: Vec<<Block as BlockT>::Extrinsic>, ) -> Result<Vec<(Option<AccountId>, <Block as BlockT>::Extrinsic)>, ApiError>

Extracts the optional signer per extrinsic.

source

fn is_within_tx_range( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: &<Block as BlockT>::Extrinsic, bundle_vrf_hash: &U256, tx_range: &U256, ) -> Result<bool, ApiError>

source

fn intermediate_roots( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Vec<[u8; 32]>, ApiError>

Returns the intermediate storage roots in an encoded form.

source

fn initialize_block_with_post_state_root( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, header: &<Block as BlockT>::Header, ) -> Result<Vec<u8>, ApiError>

Returns the storage root after initializing the block.

source

fn apply_extrinsic_with_post_state_root( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: <Block as BlockT>::Extrinsic, ) -> Result<Vec<u8>, ApiError>

Returns the storage root after applying the extrinsic.

source

fn construct_set_code_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, code: Vec<u8>, ) -> Result<Vec<u8>, ApiError>

Returns an encoded extrinsic aiming to upgrade the runtime using given code.

source

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

Returns an encoded extrinsic to set timestamp.

source

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

Returns an encoded extrinsic to set domain transaction byte fee.

source

fn construct_domain_update_chain_allowlist_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, updates: DomainAllowlistUpdates, ) -> Result<Block::Extrinsic, ApiError>

Returns an extrinsic to update chain allowlist.

source

fn is_inherent_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: &<Block as BlockT>::Extrinsic, ) -> Result<bool, ApiError>

Returns true if the extrinsic is an inherent extrinsic.

source

fn check_extrinsics_and_do_pre_dispatch( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, uxts: Vec<<Block as BlockT>::Extrinsic>, block_number: NumberFor<Block>, block_hash: <Block as BlockT>::Hash, ) -> Result<Result<(), CheckExtrinsicsValidityError>, ApiError>

Checks the validity of array of extrinsics + pre_dispatch returning failure on first extrinsic that fails runtime call. IMPORTANT: Change CHECK_EXTRINSICS_AND_DO_PRE_DISPATCH_METHOD_NAME constant when this method name is changed

source

fn decode_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, opaque_extrinsic: OpaqueExtrinsic, ) -> Result<Result<<Block as BlockT>::Extrinsic, DecodeExtrinsicError>, ApiError>

Decodes the domain specific extrinsic from the opaque extrinsic.

source

fn extrinsic_era( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: &<Block as BlockT>::Extrinsic, ) -> Result<Option<Era>, ApiError>

Returns extrinsic Era if present.

source

fn extrinsic_weight( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ext: &Block::Extrinsic, ) -> Result<Weight, ApiError>

Returns the extrinsic weight.

source

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

The accumulated transaction fee of all transactions included in the block.

source

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

Returns the block digest.

source

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

Returns the consumed weight of the block.

source

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

Returns the transfers for this domain in the block.

source

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

Returns the storage key for the Transfers on Domain.

source

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

Returns the storage key for the CollectedBlockFees on Domain.

Trait Implementations§

source§

impl<Block: BlockT> RuntimeApiInfo for dyn DomainCoreApi<Block>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 2u32

The version of the runtime api.

Implementors§