pub trait RuntimeApiSubsystemClient {
Show 23 methods // Required methods fn api_version_parachain_host<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Option<u32>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn validators<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<Public, Global>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn validator_groups<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<(Vec<Vec<ValidatorIndex, Global>, Global>, GroupRotationInfo<u32>), ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn availability_cores<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<CoreState<H256, u32>, Global>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn persisted_validation_data<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id, assumption: OccupiedCoreAssumption ) -> Pin<Box<dyn Future<Output = Result<Option<PersistedValidationData<H256, u32>>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn assumed_validation_data<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id, expected_persisted_validation_data_hash: H256 ) -> Pin<Box<dyn Future<Output = Result<Option<(PersistedValidationData<H256, u32>, ValidationCodeHash)>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn check_validation_outputs<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id, outputs: CandidateCommitments<u32> ) -> Pin<Box<dyn Future<Output = Result<bool, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn session_index_for_child<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<u32, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn validation_code<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id, assumption: OccupiedCoreAssumption ) -> Pin<Box<dyn Future<Output = Result<Option<ValidationCode>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn candidate_pending_availability<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id ) -> Pin<Box<dyn Future<Output = Result<Option<CommittedCandidateReceipt<H256>>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn candidate_events<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<CandidateEvent<H256>, Global>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn dmq_contents<'life0, 'async_trait>( &'life0 self, at: H256, recipient: Id ) -> Pin<Box<dyn Future<Output = Result<Vec<InboundDownwardMessage<u32>, Global>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn inbound_hrmp_channels_contents<'life0, 'async_trait>( &'life0 self, at: H256, recipient: Id ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<Id, Vec<InboundHrmpMessage<u32>, Global>, Global>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn validation_code_by_hash<'life0, 'async_trait>( &'life0 self, at: H256, hash: ValidationCodeHash ) -> Pin<Box<dyn Future<Output = Result<Option<ValidationCode>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn on_chain_votes<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Option<ScrapedOnChainVotes<H256>>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn session_info<'life0, 'async_trait>( &'life0 self, at: H256, index: u32 ) -> Pin<Box<dyn Future<Output = Result<Option<SessionInfo>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn session_info_before_version_2<'life0, 'async_trait>( &'life0 self, at: H256, index: u32 ) -> Pin<Box<dyn Future<Output = Result<Option<OldV1SessionInfo>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn submit_pvf_check_statement<'life0, 'async_trait>( &'life0 self, at: H256, stmt: PvfCheckStatement, signature: Signature ) -> Pin<Box<dyn Future<Output = Result<(), ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn pvfs_require_precheck<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<ValidationCodeHash, Global>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn validation_code_hash<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id, assumption: OccupiedCoreAssumption ) -> Pin<Box<dyn Future<Output = Result<Option<ValidationCodeHash>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn disputes<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<(u32, CandidateHash, DisputeState<u32>), Global>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn current_epoch<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Epoch, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait; fn authorities<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<Public, Global>, ApiError>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait;
}
Expand description

Exposes all runtime calls that are used by the runtime API subsystem.

Required Methods§

source

fn api_version_parachain_host<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Option<u32>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Parachain host API version

source

fn validators<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<Public, Global>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get the current validators.

source

fn validator_groups<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<(Vec<Vec<ValidatorIndex, Global>, Global>, GroupRotationInfo<u32>), ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Returns the validator groups and rotation info localized based on the hypothetical child of a block whose state this is invoked on. Note that now in the GroupRotationInfo should be the successor of the number of the block.

source

fn availability_cores<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<CoreState<H256, u32>, Global>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Yields information on all availability cores as relevant to the child block. Cores are either free or occupied. Free cores can have paras assigned to them.

source

fn persisted_validation_data<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id, assumption: OccupiedCoreAssumption ) -> Pin<Box<dyn Future<Output = Result<Option<PersistedValidationData<H256, u32>>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Yields the persisted validation data for the given ParaId along with an assumption that should be used if the para currently occupies a core.

Returns None if either the para is not registered or the assumption is Freed and the para already occupies a core.

source

fn assumed_validation_data<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id, expected_persisted_validation_data_hash: H256 ) -> Pin<Box<dyn Future<Output = Result<Option<(PersistedValidationData<H256, u32>, ValidationCodeHash)>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Returns the persisted validation data for the given ParaId along with the corresponding validation code hash. Instead of accepting assumption about the para, matches the validation data hash against an expected one and yields None if they’re not equal.

source

fn check_validation_outputs<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id, outputs: CandidateCommitments<u32> ) -> Pin<Box<dyn Future<Output = Result<bool, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Checks if the given validation outputs pass the acceptance criteria.

source

fn session_index_for_child<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<u32, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Returns the session index expected at a child of the block.

This can be used to instantiate a SigningContext.

source

fn validation_code<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id, assumption: OccupiedCoreAssumption ) -> Pin<Box<dyn Future<Output = Result<Option<ValidationCode>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Fetch the validation code used by a para, making the given OccupiedCoreAssumption.

Returns None if either the para is not registered or the assumption is Freed and the para already occupies a core.

source

fn candidate_pending_availability<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id ) -> Pin<Box<dyn Future<Output = Result<Option<CommittedCandidateReceipt<H256>>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get the receipt of a candidate pending availability. This returns Some for any paras assigned to occupied cores in availability_cores and None otherwise.

source

fn candidate_events<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<CandidateEvent<H256>, Global>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get a vector of events concerning candidates that occurred within a block.

source

fn dmq_contents<'life0, 'async_trait>( &'life0 self, at: H256, recipient: Id ) -> Pin<Box<dyn Future<Output = Result<Vec<InboundDownwardMessage<u32>, Global>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get all the pending inbound messages in the downward message queue for a para.

source

fn inbound_hrmp_channels_contents<'life0, 'async_trait>( &'life0 self, at: H256, recipient: Id ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<Id, Vec<InboundHrmpMessage<u32>, Global>, Global>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get the contents of all channels addressed to the given recipient. Channels that have no messages in them are also included.

source

fn validation_code_by_hash<'life0, 'async_trait>( &'life0 self, at: H256, hash: ValidationCodeHash ) -> Pin<Box<dyn Future<Output = Result<Option<ValidationCode>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get the validation code from its hash.

source

fn on_chain_votes<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Option<ScrapedOnChainVotes<H256>>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Scrape dispute relevant from on-chain, backing votes and resolved disputes.

source

fn session_info<'life0, 'async_trait>( &'life0 self, at: H256, index: u32 ) -> Pin<Box<dyn Future<Output = Result<Option<SessionInfo>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get the session info for the given session, if stored.

NOTE: This function is only available since parachain host version 2.

source

fn session_info_before_version_2<'life0, 'async_trait>( &'life0 self, at: H256, index: u32 ) -> Pin<Box<dyn Future<Output = Result<Option<OldV1SessionInfo>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get the session info for the given session, if stored.

NOTE: This function is only available since parachain host version 2.

source

fn submit_pvf_check_statement<'life0, 'async_trait>( &'life0 self, at: H256, stmt: PvfCheckStatement, signature: Signature ) -> Pin<Box<dyn Future<Output = Result<(), ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Submits a PVF pre-checking statement into the transaction pool.

NOTE: This function is only available since parachain host version 2.

source

fn pvfs_require_precheck<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<ValidationCodeHash, Global>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Returns code hashes of PVFs that require pre-checking by validators in the active set.

NOTE: This function is only available since parachain host version 2.

source

fn validation_code_hash<'life0, 'async_trait>( &'life0 self, at: H256, para_id: Id, assumption: OccupiedCoreAssumption ) -> Pin<Box<dyn Future<Output = Result<Option<ValidationCodeHash>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Fetch the hash of the validation code used by a para, making the given OccupiedCoreAssumption.

NOTE: This function is only available since parachain host version 2.

source

fn disputes<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<(u32, CandidateHash, DisputeState<u32>), Global>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Returns all onchain disputes. This is a staging method! Do not use on production runtimes!

source

fn current_epoch<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Epoch, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Returns information regarding the current epoch.

source

fn authorities<'life0, 'async_trait>( &'life0 self, at: H256 ) -> Pin<Box<dyn Future<Output = Result<Vec<Public, Global>, ApiError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Retrieve authority identifiers of the current and next authority set.

Implementors§