BlockParticipationApi

Trait BlockParticipationApi 

Source
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§

Source

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.

Source

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.

Source

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

Trait Implementations§

Source§

impl<Block: BlockT, BlockProducerId: Decode, Moment: Decode + Encode> RuntimeApiInfo for dyn BlockParticipationApi<Block, BlockProducerId, Moment>

Source§

const ID: [u8; 8]

The identifier of the runtime api.
Source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§