Trait Config

Source
pub trait Config: Config {
    type WeightInfo: WeightInfo;
    type BlockAuthor: Member + Parameter + MaxEncodedLen;
    type DelegatorId: Member + Parameter + MaxEncodedLen;

    const TARGET_INHERENT_ID: InherentIdentifier;

    // Required methods
    fn should_release_data(slot: Slot) -> Option<Slot>;
    fn blocks_produced_up_to_slot(
        slot: Slot,
    ) -> impl Iterator<Item = (Slot, Self::BlockAuthor)>;
    fn discard_blocks_produced_up_to_slot(slot: Slot);
}
Expand description

Configuration trait of this pallet.

The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.

Consequently, a runtime that wants to include this pallet must implement this trait.

Required Associated Constants§

Source

const TARGET_INHERENT_ID: InherentIdentifier

Inherent ID under which block participation data should be provided. It should be set to the ID used by the pallet that will process participation data for paying out block rewards or other purposes.

Required Associated Types§

Source

type WeightInfo: WeightInfo

Weight info for this pallet’s extrinsics

Source

type BlockAuthor: Member + Parameter + MaxEncodedLen

Type identifying the producer of a block on the Partner Chain

Source

type DelegatorId: Member + Parameter + MaxEncodedLen

Type identifying indirect block production participants on the Partner Chain This can be native stakers on Partner Chain, stakers on the main chain or other.

Required Methods§

Source

fn should_release_data(slot: Slot) -> Option<Slot>

Should return slot up to which block production data should be released or None.

Source

fn blocks_produced_up_to_slot( slot: Slot, ) -> impl Iterator<Item = (Slot, Self::BlockAuthor)>

Returns block authors since last processing up to slot

Source

fn discard_blocks_produced_up_to_slot(slot: Slot)

Discards block production data at the source up to slot This should remove exactly the same data as returned by blocks_produced_up_to_slot

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§