pub trait BlockParticipationApi<Block: BlockT, BlockProducerId: Decode, Moment: Decode + Encode>: Core<Block> {
// Provided methods
fn blocks_to_process(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
moment: &Moment,
) -> Result<Vec<(Moment, BlockProducerId)>, ApiError> { ... }
fn target_inherent_id(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<InherentIdentifier, ApiError> { ... }
fn moment_to_timestamp_millis(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
moment: Moment,
) -> Result<u64, ApiError> { ... }
}Expand description
Runtime api exposing configuration and runtime bindings necessary for inherent_data::BlockParticipationInherentDataProvider.
This API should typically be implemented by simply exposing relevant functions and data from the feature’s pallet.
Provided Methods§
Sourcefn blocks_to_process(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
moment: &Moment,
) -> Result<Vec<(Moment, BlockProducerId)>, ApiError>
fn blocks_to_process( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, moment: &Moment, ) -> Result<Vec<(Moment, BlockProducerId)>, ApiError>
Returns block participation data that should be processed in the current block.
Sourcefn target_inherent_id(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<InherentIdentifier, ApiError>
fn target_inherent_id( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<InherentIdentifier, ApiError>
Returns the inherent ID under which block participation data should be provided.
Sourcefn moment_to_timestamp_millis(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
moment: Moment,
) -> Result<u64, ApiError>
fn moment_to_timestamp_millis( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, moment: Moment, ) -> Result<u64, ApiError>
Converts moment into a timestamp in UNIX milliseconds