pub struct SessionAndEraManager<E, EM, T, C>(PhantomData<(E, EM, T, C)>)
where
E: EraInfoProvider,
EM: EraManager,
T: SessionManager<C::AccountId>,
C: Config;
Expand description
SessionManager that also fires EraManager functions. It is responsible for rotation of the committee, bans and rewards logic.
The order of the calls is as follows: First call is always from the inner SessionManager then the call to EraManager fn if applicable.
- New session is planned:
- Inner T::new_session invoked
- If session starts era EM::on_new_era invoked
- Logic related to new session from this pallet is invoked
- Session ends:
- Inner T::end_session invoked
- Logic related to new session from this pallet is invoked
- Session starts:
- Inner T::start_session invoked
- Logic related to the new session from this pallet is invoked
- If session starts era EM::new_era_start invoked
- If session starts era logic related to new era from this pallet is invoked
In the runtime we set EM to pallet_elections and T to combination of staking and historical_session.
Tuple Fields§
§0: PhantomData<(E, EM, T, C)>
Implementations§
source§impl<E, EM, T, C> SessionAndEraManager<E, EM, T, C>
impl<E, EM, T, C> SessionAndEraManager<E, EM, T, C>
fn session_starts_era(session: SessionIndex) -> Option<EraIndex>
fn session_starts_next_era(session: SessionIndex) -> Option<EraIndex>
fn is_start_of_the_era(era: EraIndex, session: SessionIndex) -> bool
Trait Implementations§
source§impl<E, EM, T, C> SessionManager<<C as Config>::AccountId> for SessionAndEraManager<E, EM, T, C>
impl<E, EM, T, C> SessionManager<<C as Config>::AccountId> for SessionAndEraManager<E, EM, T, C>
source§fn new_session(new_index: SessionIndex) -> Option<Vec<C::AccountId>>
fn new_session(new_index: SessionIndex) -> Option<Vec<C::AccountId>>
Plan a new session, and optionally provide the new validator set. Read more
source§fn end_session(end_index: SessionIndex)
fn end_session(end_index: SessionIndex)
End the session. Read more
source§fn start_session(start_index: SessionIndex)
fn start_session(start_index: SessionIndex)
Start an already planned session. Read more
Auto Trait Implementations§
impl<E, EM, T, C> RefUnwindSafe for SessionAndEraManager<E, EM, T, C>
impl<E, EM, T, C> Send for SessionAndEraManager<E, EM, T, C>
impl<E, EM, T, C> Sync for SessionAndEraManager<E, EM, T, C>
impl<E, EM, T, C> Unpin for SessionAndEraManager<E, EM, T, C>
impl<E, EM, T, C> UnwindSafe for SessionAndEraManager<E, EM, T, C>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.