pub(crate) fn check_node_operator_invariants(
    snapshot: &RegistrySnapshot,
    strict: bool,
) -> Result<(), InvariantCheckError> {
    if strict {
        for node_record in get_all_node_records(snapshot) {
            let node_operator_id =
                PrincipalId::try_from(node_record.node_operator_id.clone()).unwrap();
            let key = make_node_operator_record_key(node_operator_id);
            match snapshot.get(key.as_bytes()) {
                Some(node_operator_record_vec) => {
                    decode_or_panic::<NodeOperatorRecord>((*node_operator_record_vec).clone());
                }
                None => {
                    return Err(InvariantCheckError {
                        msg: format!("Node operator {:} not in snapshot", node_operator_id),
                        source: None,
                    });
                }
            }
        }
    }
    Ok(())
}
/// Node operator invariants hold iff:
///    * All node operators referred to in node records are registered
Node operator invariants hold iff:
All node operators referred to in node records are registered
Node operator invariants hold iff : All node operators referred to in node records are registered
pub(crate) fn check_node_operator_invariants(
    snapshot: &RegistrySnapshot,
    strict: bool,
) -> Result<(), InvariantCheckError> {
    if strict {
        for node_record in get_all_node_records(snapshot) {
            let node_operator_id =
                PrincipalId::try_from(node_record.node_operator_id.clone()).unwrap();
            let key = make_node_operator_record_key(node_operator_id);
            match snapshot.get(key.as_bytes()) {
                Some(node_operator_record_vec) => {
                    decode_or_panic::<NodeOperatorRecord>((*node_operator_record_vec).clone());
                }
                None => {
                    return Err(InvariantCheckError {
                        msg: format!("Node operator {:} not in snapshot", node_operator_id),
                        source: None,
                    });
                }
            }
        }
    }
    Ok(())
}
pub ( crate ) fn check_node_operator_invariants ( snapshot : & RegistrySnapshot , strict : bool , ) -> Result < ( ) , InvariantCheckError > { if strict { for node_record in get_all_node_records ( snapshot ) { let node_operator_id = PrincipalId :: try_from ( node_record . node_operator_id . clone ( ) ) . unwrap ( ) ; let key = make_node_operator_record_key ( node_operator_id ) ; match snapshot . get ( key . as_bytes ( ) ) { Some ( node_operator_record_vec ) => { decode_or_panic :: < NodeOperatorRecord > ( ( * node_operator_record_vec ) . clone ( ) ) ; } None => { return Err ( InvariantCheckError { msg : format ! ( " " node_operator_id ) , source : None , } ) ; } } } } Ok ( ( ) ) }
Node operator invariants hold iff:
 All node operators referred to in node records are registered
Node operator invariants hold iff : All node operators referred to in node records are registered
snapshot
&RegistrySnapshot
strict
bool
snapshot
&RegistrySnapshot
strict
bool