pub trait EraInfoProvider {
    type AccountId;

    // Required methods
    fn active_era() -> Option<EraIndex>;
    fn current_era() -> Option<EraIndex>;
    fn era_start_session_index(era: EraIndex) -> Option<SessionIndex>;
    fn sessions_per_era() -> SessionIndex;
    fn elected_validators(era: EraIndex) -> Vec<Self::AccountId>;
}

Required Associated Types§

Required Methods§

source

fn active_era() -> Option<EraIndex>

Returns Some(idx) where idx is the active era index otherwise if no era is active returns None.

source

fn current_era() -> Option<EraIndex>

Returns Some(idx) where idx is the current era index which is latest planed era otherwise if no era has started returns None.

source

fn era_start_session_index(era: EraIndex) -> Option<SessionIndex>

Returns the index of the starting session of the era if possible. Otherwise returns None.

source

fn sessions_per_era() -> SessionIndex

Returns how many sessions are in single era.

source

fn elected_validators(era: EraIndex) -> Vec<Self::AccountId>

Returns the elected authorities for provided era.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> EraInfoProvider for Pallet<T>
where T: Config,

§

type AccountId = <T as Config>::AccountId

source§

fn active_era() -> Option<EraIndex>

source§

fn current_era() -> Option<EraIndex>

source§

fn era_start_session_index(era: EraIndex) -> Option<SessionIndex>

source§

fn sessions_per_era() -> SessionIndex

source§

fn elected_validators(era: EraIndex) -> Vec<Self::AccountId>

Implementors§