[][src]Trait sc_consensus_epochs::Epoch

pub trait Epoch {
    type NextEpochDescriptor;
    type SlotNumber: Ord + Copy;
    fn start_slot(&self) -> Self::SlotNumber;
fn end_slot(&self) -> Self::SlotNumber;
fn increment(&self, descriptor: Self::NextEpochDescriptor) -> Self; }

Epoch data, distinguish whether it is genesis or not.

Once an epoch is created, it must have a known start_slot and end_slot, which cannot be changed. Consensus engine may modify any other data in the epoch, if needed.

Associated Types

type NextEpochDescriptor

Descriptor for the next epoch.

type SlotNumber: Ord + Copy

Type of the slot number.

Loading content...

Required methods

fn start_slot(&self) -> Self::SlotNumber

The starting slot of the epoch.

fn end_slot(&self) -> Self::SlotNumber

Produce the "end slot" of the epoch. This is NOT inclusive to the epoch, i.e. the slots covered by the epoch are self.start_slot() .. self.end_slot().

fn increment(&self, descriptor: Self::NextEpochDescriptor) -> Self

Increment the epoch data, using the next epoch descriptor.

Loading content...

Implementors

Loading content...