pub fn rotate_session() {
        let session_index = CurrentIndex::get();
        {
            let lvl = ::log::Level::Trace;
            if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() {
                :: log :: __private_api_log (:: core :: fmt :: Arguments :: new_v1 (& ["rotating session "] , & match (& session_index ,) { _args => [:: core :: fmt :: ArgumentV1 :: new (_args . 0 , :: core :: fmt :: Debug :: fmt)] , }) , lvl , & ("runtime::session" , "pallet_session" , "/Users/mmac/.cargo/git/checkouts/substrate-7e08433d4c370a21/4d28ebe/frame/session/src/lib.rs" , 586u32)) ;
            }
        };
        let changed = QueuedChanged::get();
        T::SessionHandler::on_before_session_ending();
        T::SessionManager::end_session(session_index);
        let session_keys = <QueuedKeys<T>>::get();
        let validators = session_keys
            .iter()
            .map(|(validator, _)| validator.clone())
            .collect::<Vec<_>>();
        <Validators<T>>::put(&validators);
        if changed {
            DisabledValidators::take();
        }
        let session_index = session_index + 1;
        CurrentIndex::put(session_index);
        T::SessionManager::start_session(session_index);
        let maybe_next_validators = T::SessionManager::new_session(session_index + 1);
        let (next_validators, next_identities_changed) =
            if let Some(validators) = maybe_next_validators {
                (validators, true)
            } else {
                (<Validators<T>>::get(), false)
            };
        let (queued_amalgamated, next_changed) = {
            let mut changed = next_identities_changed;
            let mut now_session_keys = session_keys.iter();
            let mut check_next_changed = |keys: &T::Keys| {
                if changed {
                    return;
                }
                if let Some(&(_, ref old_keys)) = now_session_keys.next() {
                    if old_keys != keys {
                        changed = true;
                        return;
                    }
                }
            };
            let queued_amalgamated = next_validators
                .into_iter()
                .map(|a| {
                    let k = Self::load_keys(&a).unwrap_or_default();
                    check_next_changed(&k);
                    (a, k)
                })
                .collect::<Vec<_>>();
            (queued_amalgamated, changed)
        };
        <QueuedKeys<T>>::put(queued_amalgamated.clone());
        QueuedChanged::put(next_changed);
        Self::deposit_event(Event::NewSession(session_index));
        T::SessionHandler::on_new_session::<T::Keys>(changed, &session_keys, &queued_amalgamated);
    }
/// Move on to next session. Register new validator set and session keys. Changes to the
/// validator set have a session of delay to take effect. This allows for equivocation
/// punishment after a fork.
Move on to next session. Register new validator set and session keys. Changes to the
validator set have a session of delay to take effect. This allows for equivocation
punishment after a fork.
Move on to next session . Register new validator set and session keys . Changes to the validator set have a session of delay to take effect . This allows for equivocation punishment after a fork .
pub fn rotate_session() {
        let session_index = CurrentIndex::get();
        {
            let lvl = ::log::Level::Trace;
            if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() {
                :: log :: __private_api_log (:: core :: fmt :: Arguments :: new_v1 (& ["rotating session "] , & match (& session_index ,) { _args => [:: core :: fmt :: ArgumentV1 :: new (_args . 0 , :: core :: fmt :: Debug :: fmt)] , }) , lvl , & ("runtime::session" , "pallet_session" , "/Users/mmac/.cargo/git/checkouts/substrate-7e08433d4c370a21/4d28ebe/frame/session/src/lib.rs" , 586u32)) ;
            }
        };
        let changed = QueuedChanged::get();
        T::SessionHandler::on_before_session_ending();
        T::SessionManager::end_session(session_index);
        let session_keys = <QueuedKeys<T>>::get();
        let validators = session_keys
            .iter()
            .map(|(validator, _)| validator.clone())
            .collect::<Vec<_>>();
        <Validators<T>>::put(&validators);
        if changed {
            DisabledValidators::take();
        }
        let session_index = session_index + 1;
        CurrentIndex::put(session_index);
        T::SessionManager::start_session(session_index);
        let maybe_next_validators = T::SessionManager::new_session(session_index + 1);
        let (next_validators, next_identities_changed) =
            if let Some(validators) = maybe_next_validators {
                (validators, true)
            } else {
                (<Validators<T>>::get(), false)
            };
        let (queued_amalgamated, next_changed) = {
            let mut changed = next_identities_changed;
            let mut now_session_keys = session_keys.iter();
            let mut check_next_changed = |keys: &T::Keys| {
                if changed {
                    return;
                }
                if let Some(&(_, ref old_keys)) = now_session_keys.next() {
                    if old_keys != keys {
                        changed = true;
                        return;
                    }
                }
            };
            let queued_amalgamated = next_validators
                .into_iter()
                .map(|a| {
                    let k = Self::load_keys(&a).unwrap_or_default();
                    check_next_changed(&k);
                    (a, k)
                })
                .collect::<Vec<_>>();
            (queued_amalgamated, changed)
        };
        <QueuedKeys<T>>::put(queued_amalgamated.clone());
        QueuedChanged::put(next_changed);
        Self::deposit_event(Event::NewSession(session_index));
        T::SessionHandler::on_new_session::<T::Keys>(changed, &session_keys, &queued_amalgamated);
    }
pub fn rotate_session ( ) { let session_index = CurrentIndex :: get ( ) ; { let lvl = :: log :: Level :: Trace ; if lvl <= :: log :: STATIC_MAX_LEVEL && lvl <= :: log :: max_level ( ) { :: log :: __private_api_log ( :: core :: fmt :: Arguments :: new_v1 ( & [ " " ] , & match ( & session_index , ) { _args => [ :: core :: fmt :: ArgumentV1 :: new ( _args . 0 , :: core :: fmt :: Debug :: fmt ) ] , } ) , lvl , & ( " " , " " , " " , 586u32 ) ) ; } } ; let changed = QueuedChanged :: get ( ) ; T :: SessionHandler :: on_before_session_ending ( ) ; T :: SessionManager :: end_session ( session_index ) ; let session_keys = < QueuedKeys < T > > :: get ( ) ; let validators = session_keys . iter ( ) . map ( | ( validator , _ ) | validator . clone ( ) ) . collect :: < Vec < _ > > ( ) ; < Validators < T > > :: put ( & validators ) ; if changed { DisabledValidators :: take ( ) ; } let session_index = session_index + 1 ; CurrentIndex :: put ( session_index ) ; T :: SessionManager :: start_session ( session_index ) ; let maybe_next_validators = T :: SessionManager :: new_session ( session_index + 1 ) ; let ( next_validators , next_identities_changed ) = if let Some ( validators ) = maybe_next_validators { ( validators , true ) } else { ( < Validators < T > > :: get ( ) , false ) } ; let ( queued_amalgamated , next_changed ) = { let mut changed = next_identities_changed ; let mut now_session_keys = session_keys . iter ( ) ; let mut check_next_changed = | keys : & T :: Keys | { if changed { return ; } if let Some ( & ( _ , ref old_keys ) ) = now_session_keys . next ( ) { if old_keys != keys { changed = true ; return ; } } } ; let queued_amalgamated = next_validators . into_iter ( ) . map ( | a | { let k = Self :: load_keys ( & a ) . unwrap_or_default ( ) ; check_next_changed ( & k ) ; ( a , k ) } ) . collect :: < Vec < _ > > ( ) ; ( queued_amalgamated , changed ) } ; < QueuedKeys < T > > :: put ( queued_amalgamated . clone ( ) ) ; QueuedChanged :: put ( next_changed ) ; Self :: deposit_event ( Event :: NewSession ( session_index ) ) ; T :: SessionHandler :: on_new_session :: < T :: Keys > ( changed , & session_keys , & queued_amalgamated ) ; }
Move on to next session.
Move on to next session .