referrerpolicy=no-referrer-when-downgrade
pallet_staking

Trait SessionInterface

Source
pub trait SessionInterface<AccountId> {
    // Required methods
    fn report_offence(validator: AccountId, severity: OffenceSeverity);
    fn validators() -> Vec<AccountId>;
    fn prune_historical_up_to(up_to: SessionIndex);
}
Expand description

Means for interacting with a specialized version of the session trait.

This is needed because Staking sets the ValidatorIdOf of the pallet_session::Config

Required Methods§

Source

fn report_offence(validator: AccountId, severity: OffenceSeverity)

Report an offending validator.

Source

fn validators() -> Vec<AccountId>

Get the validators from session.

Source

fn prune_historical_up_to(up_to: SessionIndex)

Prune historical session tries up to but not including the given index.

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.

Implementations on Foreign Types§

Source§

impl<AccountId> SessionInterface<AccountId> for ()

Source§

fn report_offence(_validator: AccountId, _severity: OffenceSeverity)

Source§

fn validators() -> Vec<AccountId>

Source§

fn prune_historical_up_to(_: SessionIndex)

Implementors§

Source§

impl<T> SessionInterface<<T as Config>::AccountId> for T
where T: Config<ValidatorId = <T as Config>::AccountId> + Config + Config, T::SessionHandler: SessionHandler<<T as Config>::AccountId>, T::SessionManager: SessionManager<<T as Config>::AccountId>, T::ValidatorIdOf: Convert<<T as Config>::AccountId, Option<<T as Config>::AccountId>>,