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::Extrinsic)>, ApiError> { ... }
fn is_within_tx_range(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
extrinsic: &Block::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::Header,
) -> Result<Vec<u8>, ApiError> { ... }
fn apply_extrinsic_with_post_state_root(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
extrinsic: Block::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::Extrinsic,
) -> Result<bool, ApiError> { ... }
fn check_extrinsics_and_do_pre_dispatch(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
uxts: Vec<Block::Extrinsic>,
block_number: NumberFor<Block>,
block_hash: Block::Hash,
) -> Result<Result<(), CheckExtrinsicsValidityError>, ApiError> { ... }
fn decode_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
opaque_extrinsic: OpaqueExtrinsic,
) -> Result<Result<Block::Extrinsic, DecodeExtrinsicError>, ApiError> { ... }
fn extrinsic_era(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
extrinsic: &Block::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§
sourcefn extract_signer(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
extrinsics: Vec<<Block as BlockT>::Extrinsic>,
) -> Result<Vec<(Option<AccountId>, Block::Extrinsic)>, ApiError>
fn extract_signer( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsics: Vec<<Block as BlockT>::Extrinsic>, ) -> Result<Vec<(Option<AccountId>, Block::Extrinsic)>, ApiError>
Extracts the optional signer per extrinsic.
fn is_within_tx_range( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: &Block::Extrinsic, bundle_vrf_hash: &U256, tx_range: &U256, ) -> Result<bool, ApiError>
sourcefn intermediate_roots(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<[u8; 32]>, ApiError>
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.
sourcefn initialize_block_with_post_state_root(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
header: &Block::Header,
) -> Result<Vec<u8>, ApiError>
fn initialize_block_with_post_state_root( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, header: &Block::Header, ) -> Result<Vec<u8>, ApiError>
Returns the storage root after initializing the block.
sourcefn apply_extrinsic_with_post_state_root(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
extrinsic: Block::Extrinsic,
) -> Result<Vec<u8>, ApiError>
fn apply_extrinsic_with_post_state_root( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: Block::Extrinsic, ) -> Result<Vec<u8>, ApiError>
Returns the storage root after applying the extrinsic.
sourcefn construct_set_code_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
code: Vec<u8>,
) -> 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>
Returns an encoded extrinsic aiming to upgrade the runtime using given code.
sourcefn construct_timestamp_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
moment: Moment,
) -> Result<Block::Extrinsic, ApiError>
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.
sourcefn 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_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.
sourcefn construct_domain_update_chain_allowlist_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
updates: DomainAllowlistUpdates,
) -> 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>
Returns an extrinsic to update chain allowlist.
sourcefn is_inherent_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
extrinsic: &Block::Extrinsic,
) -> Result<bool, ApiError>
fn is_inherent_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: &Block::Extrinsic, ) -> Result<bool, ApiError>
Returns true if the extrinsic is an inherent extrinsic.
sourcefn check_extrinsics_and_do_pre_dispatch(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
uxts: Vec<Block::Extrinsic>,
block_number: NumberFor<Block>,
block_hash: Block::Hash,
) -> Result<Result<(), CheckExtrinsicsValidityError>, ApiError>
fn check_extrinsics_and_do_pre_dispatch( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, uxts: Vec<Block::Extrinsic>, block_number: NumberFor<Block>, block_hash: Block::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
sourcefn decode_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
opaque_extrinsic: OpaqueExtrinsic,
) -> Result<Result<Block::Extrinsic, DecodeExtrinsicError>, ApiError>
fn decode_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, opaque_extrinsic: OpaqueExtrinsic, ) -> Result<Result<Block::Extrinsic, DecodeExtrinsicError>, ApiError>
Decodes the domain specific extrinsic from the opaque extrinsic.
sourcefn extrinsic_era(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
extrinsic: &Block::Extrinsic,
) -> Result<Option<Era>, ApiError>
fn extrinsic_era( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, extrinsic: &Block::Extrinsic, ) -> Result<Option<Era>, ApiError>
Returns extrinsic Era if present.
sourcefn extrinsic_weight(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
ext: &Block::Extrinsic,
) -> Result<Weight, ApiError>
fn extrinsic_weight( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ext: &Block::Extrinsic, ) -> Result<Weight, ApiError>
Returns the extrinsic weight.
sourcefn block_fees(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<BlockFees<Balance>, ApiError>
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.
sourcefn block_digest(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Digest, ApiError>
fn block_digest( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Digest, ApiError>
Returns the block digest.
sourcefn block_weight(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Weight, ApiError>
fn block_weight( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Weight, ApiError>
Returns the consumed weight of the block.
sourcefn transfers(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Transfers<Balance>, ApiError>
fn transfers( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Transfers<Balance>, ApiError>
Returns the transfers for this domain in the block.
sourcefn transfers_storage_key(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Vec<u8>, ApiError>
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.
sourcefn block_fees_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>
Returns the storage key for the CollectedBlockFees
on Domain.