fn new_session(
        session_index: SessionIndex,
    ) -> Option<Vec<T::AccountId>> {
        if let Some(current_era) = Self::current_era() {
            // Initial era has been set.
            let current_era_start_session_index = Self::eras_start_session_index(current_era)
                .unwrap_or_else(|| {
                    frame_support::print("Error: start_session_index must be set for current_era");
                    0
                });

            let era_length = session_index.checked_sub(current_era_start_session_index)
                .unwrap_or(0); // Must never happen.
            match ForceEra::get() {
                Forcing::ForceNew => ForceEra::kill(),
                Forcing::ForceAlways => (),
                Forcing::NotForcing if era_length >= T::SessionsPerEra::get() => (),
                _ => return None,
            }

            // New era
            Self::new_era(session_index)
        } else {
            // Set initial era
            Self::new_era(session_index)
        }
    }
/// Session has just ended. Provide the validator set for the next session if it's an era-end, along
/// with the exposure of the prior validator set.
Session has just ended. Provide the validator set for the next session if it's an era-end, along
with the exposure of the prior validator set.
Session has just ended . Provide the validator set for the next session if it ' s an era - end along with the exposure of the prior validator set .
fn new_session(
        session_index: SessionIndex,
    ) -> Option<Vec<T::AccountId>> {
        if let Some(current_era) = Self::current_era() {
            // Initial era has been set.
            let current_era_start_session_index = Self::eras_start_session_index(current_era)
                .unwrap_or_else(|| {
                    frame_support::print("Error: start_session_index must be set for current_era");
                    0
                });
            let era_length = session_index.checked_sub(current_era_start_session_index)
                .unwrap_or(0); // Must never happen.
            match ForceEra::get() {
                Forcing::ForceNew => ForceEra::kill(),
                Forcing::ForceAlways => (),
                Forcing::NotForcing if era_length >= T::SessionsPerEra::get() => (),
                _ => return None,
            }
            // New era
            Self::new_era(session_index)
        } else {
            // Set initial era
            Self::new_era(session_index)
        }
    }
fn new_session ( session_index : SessionIndex , ) -> Option < Vec < T :: AccountId > > { if let Some ( current_era ) = Self :: current_era ( ) { // Initial era has been set. let current_era_start_session_index = Self :: eras_start_session_index ( current_era ) . unwrap_or_else ( | | { frame_support :: print ( " " ) ; 0 } ) ; let era_length = session_index . checked_sub ( current_era_start_session_index ) . unwrap_or ( 0 ) ; // Must never happen. match ForceEra :: get ( ) { Forcing :: ForceNew => ForceEra :: kill ( ) , Forcing :: ForceAlways => ( ) , Forcing :: NotForcing if era_length >= T :: SessionsPerEra :: get ( ) => ( ) , _ => return None , } // New era Self :: new_era ( session_index ) } else { // Set initial era Self :: new_era ( session_index ) } }
Session has just ended.
Session has just ended .
session_index
SessionIndex