Trait frame_support::traits::OneSessionHandler[][src]

pub trait OneSessionHandler<ValidatorId>: BoundToRuntimeAppPublic {
    type Key: Decode + Default + RuntimeAppPublic;
    fn on_genesis_session<'a, I: 'a>(validators: I)
    where
        I: Iterator<Item = (&'a ValidatorId, Self::Key)>,
        ValidatorId: 'a
;
fn on_new_session<'a, I: 'a>(
        changed: bool,
        validators: I,
        queued_validators: I
    )
    where
        I: Iterator<Item = (&'a ValidatorId, Self::Key)>,
        ValidatorId: 'a
;
fn on_disabled(_validator_index: usize); fn on_before_session_ending() { ... } }

A session handler for specific key type.

Associated Types

type Key: Decode + Default + RuntimeAppPublic[src]

The key type expected.

Loading content...

Required methods

fn on_genesis_session<'a, I: 'a>(validators: I) where
    I: Iterator<Item = (&'a ValidatorId, Self::Key)>,
    ValidatorId: 'a, 
[src]

The given validator set will be used for the genesis session. It is guaranteed that the given validator set will also be used for the second session, therefore the first call to on_new_session should provide the same validator set.

fn on_new_session<'a, I: 'a>(changed: bool, validators: I, queued_validators: I) where
    I: Iterator<Item = (&'a ValidatorId, Self::Key)>,
    ValidatorId: 'a, 
[src]

Session set has changed; act appropriately. Note that this can be called before initialization of your module.

changed is true when at least one of the session keys or the underlying economic identities/distribution behind one the session keys has changed, false otherwise.

The validators are the validators of the incoming session, and queued_validators will follow.

fn on_disabled(_validator_index: usize)[src]

A validator got disabled. Act accordingly until a new session begins.

Loading content...

Provided methods

fn on_before_session_ending()[src]

A notification for end of the session.

Note it is triggered before any SessionManager::end_session handlers, so we can still affect the validator set.

Loading content...

Implementors

Loading content...