fn new_era(start_session_index: SessionIndex) -> Option<Vec<T::AccountId>> {
        // Increment or set current era.
        let current_era = CurrentEra::mutate(|s| {
            *s = Some(s.map(|s| s + 1).unwrap_or(0));
            s.unwrap()
        });
        log!(
            trace,
            "💸 Plan a new era {:?}",
            current_era,
        );
        ErasStartSessionIndex::insert(&current_era, &start_session_index);

        // Clean old era information.
        if let Some(old_era) = current_era.checked_sub(Self::history_depth() + 1) {
            Self::clear_era_information(old_era);
        }

        // Set staking information for new era.
        Self::deposit_event(RawEvent::UpdateIdentitiesSuccess(current_era.clone()));
        let maybe_new_validators = Self::select_and_update_validators(current_era);

        maybe_new_validators
    }
/// The era has changed - enact new staking set.
///
/// NOTE: This always happens immediately before a session change to ensure that new validators
/// get a chance to set their session keys.
/// This also checks stake limitation based on work reports
The era has changed - enact new staking set.
NOTE: This always happens immediately before a session change to ensure that new validators
get a chance to set their session keys.
This also checks stake limitation based on work reports
The era has changed - enact new staking set . NOTE : This always happens immediately before a session change to ensure that new validators get a chance to set their session keys . This also checks stake limitation based on work reports
fn new_era(start_session_index: SessionIndex) -> Option<Vec<T::AccountId>> {
        // Increment or set current era.
        let current_era = CurrentEra::mutate(|s| {
            *s = Some(s.map(|s| s + 1).unwrap_or(0));
            s.unwrap()
        });
        log!(
            trace,
            "💸 Plan a new era {:?}",
            current_era,
        );
        ErasStartSessionIndex::insert(&current_era, &start_session_index);
        // Clean old era information.
        if let Some(old_era) = current_era.checked_sub(Self::history_depth() + 1) {
            Self::clear_era_information(old_era);
        }
        // Set staking information for new era.
        Self::deposit_event(RawEvent::UpdateIdentitiesSuccess(current_era.clone()));
        let maybe_new_validators = Self::select_and_update_validators(current_era);
        maybe_new_validators
    }
fn new_era ( start_session_index : SessionIndex ) -> Option < Vec < T :: AccountId > > { // Increment or set current era. let current_era = CurrentEra :: mutate ( | s | { * s = Some ( s . map ( | s | s + 1 ) . unwrap_or ( 0 ) ) ; s . unwrap ( ) } ) ; log ! ( trace " current_era ) ; ErasStartSessionIndex :: insert ( & current_era , & start_session_index ) ; // Clean old era information. if let Some ( old_era ) = current_era . checked_sub ( Self :: history_depth ( ) + 1 ) { Self :: clear_era_information ( old_era ) ; } // Set staking information for new era. Self :: deposit_event ( RawEvent :: UpdateIdentitiesSuccess ( current_era . clone ( ) ) ) ; let maybe_new_validators = Self :: select_and_update_validators ( current_era ) ; maybe_new_validators }
The era has changed - enact new staking set.
The era has changed - enact new staking set .
start_session_index
SessionIndex