pub(crate) fn from_panorama<'a, C: Context>(
        panorama: &'a Panorama<C>,
        state: &'a State<C>,
    ) -> Self {
        let mut validator_map: ValidatorMap<IndexObservation> =
            ValidatorMap::from(vec![IndexObservation::NextSeq(0); panorama.len()]);
        for (vid, obs) in panorama.enumerate() {
            let index_obs = match obs {
                Observation::None => IndexObservation::NextSeq(0),
                Observation::Correct(hash) => IndexObservation::NextSeq(
                    state
                        .maybe_unit(hash)
                        .map_or(0, |unit| unit.seq_number.saturating_add(1)),
                ),
                Observation::Faulty => IndexObservation::Faulty,
            };
            validator_map[vid] = index_obs;
        }
        validator_map
    }
/// Creates an instance of `IndexPanorama` out of a panorama.
Creates an instance of `IndexPanorama` out of a panorama.
Creates an instance of ` IndexPanorama ` out of a panorama .
pub(crate) fn from_panorama<'a, C: Context>(
        panorama: &'a Panorama<C>,
        state: &'a State<C>,
    ) -> Self {
        let mut validator_map: ValidatorMap<IndexObservation> =
            ValidatorMap::from(vec![IndexObservation::NextSeq(0); panorama.len()]);
        for (vid, obs) in panorama.enumerate() {
            let index_obs = match obs {
                Observation::None => IndexObservation::NextSeq(0),
                Observation::Correct(hash) => IndexObservation::NextSeq(
                    state
                        .maybe_unit(hash)
                        .map_or(0, |unit| unit.seq_number.saturating_add(1)),
                ),
                Observation::Faulty => IndexObservation::Faulty,
            };
            validator_map[vid] = index_obs;
        }
        validator_map
    }
pub ( crate ) fn from_panorama < ' a , C : Context > ( panorama : & ' a Panorama < C > , state : & ' a State < C > , ) -> Self { let mut validator_map : ValidatorMap < IndexObservation > = ValidatorMap :: from ( vec ! [ IndexObservation NextSeq ( 0 ) panorama len ( ) ] ) ; for ( vid , obs ) in panorama . enumerate ( ) { let index_obs = match obs { Observation :: None => IndexObservation :: NextSeq ( 0 ) , Observation :: Correct ( hash ) => IndexObservation :: NextSeq ( state . maybe_unit ( hash ) . map_or ( 0 , | unit | unit . seq_number . saturating_add ( 1 ) ) , ) , Observation :: Faulty => IndexObservation :: Faulty , } ; validator_map [ vid ] = index_obs ; } validator_map }
Creates an instance of `IndexPanorama` out of a panorama.
Creates an instance of ` IndexPanorama ` out of a panorama .
panorama
&'a Panorama<C>
state
&'a State<C>
panorama
&'a Panorama<C>
state
&'a State<C>