fn for_index<C: Context>(
        idx: ValidatorIndex,
        state: &State<C>,
        now: Timestamp,
    ) -> Option<Status> {
        if let Some(fault) = state.maybe_fault(idx) {
            return Some(match fault {
                Fault::Banned | Fault::Indirect => Status::EquivocatedInOtherEra,
                Fault::Direct(_) => Status::Equivocated,
            });
        }
        if state.panorama()[idx].is_none() {
            return Some(Status::Inactive);
        }
        if state.last_seen(idx) + state.params().max_round_length() < now {
            let seconds = now.saturating_diff(state.last_seen(idx)).millis() / 1000;
            return Some(Status::LastSeenSecondsAgo(seconds));
        }
        None
    }
/// Returns a `Status` for a validator unless they are honest and online.
Returns a `Status` for a validator unless they are honest and online.
Returns a ` Status ` for a validator unless they are honest and online .
fn for_index<C: Context>(
        idx: ValidatorIndex,
        state: &State<C>,
        now: Timestamp,
    ) -> Option<Status> {
        if let Some(fault) = state.maybe_fault(idx) {
            return Some(match fault {
                Fault::Banned | Fault::Indirect => Status::EquivocatedInOtherEra,
                Fault::Direct(_) => Status::Equivocated,
            });
        }
        if state.panorama()[idx].is_none() {
            return Some(Status::Inactive);
        }
        if state.last_seen(idx) + state.params().max_round_length() < now {
            let seconds = now.saturating_diff(state.last_seen(idx)).millis() / 1000;
            return Some(Status::LastSeenSecondsAgo(seconds));
        }
        None
    }
fn for_index < C : Context > ( idx : ValidatorIndex , state : & State < C > , now : Timestamp , ) -> Option < Status > { if let Some ( fault ) = state . maybe_fault ( idx ) { return Some ( match fault { Fault :: Banned | Fault :: Indirect => Status :: EquivocatedInOtherEra , Fault :: Direct ( _ ) => Status :: Equivocated , } ) ; } if state . panorama ( ) [ idx ] . is_none ( ) { return Some ( Status :: Inactive ) ; } if state . last_seen ( idx ) + state . params ( ) . max_round_length ( ) < now { let seconds = now . saturating_diff ( state . last_seen ( idx ) ) . millis ( ) / 1000 ; return Some ( Status :: LastSeenSecondsAgo ( seconds ) ) ; } None }
Returns a `Status` for a validator unless they are honest and online.
Returns a ` Status ` for a validator unless they are honest and online .
idx
ValidatorIndex
state
&State<C>
now
Timestamp
idx
ValidatorIndex
state
&State<C>
now
Timestamp