/// Update an existing Node Operator's config
Update an existing Node Operator's config
Update an existing Node Operator ' s config
pub fn do_update_node_operator_config(&mut self, payload: UpdateNodeOperatorConfigPayload) {
        println!(
            "{}do_update_node_operator_config: {:?}",
            LOG_PREFIX, payload
        );
        let node_operator_id = payload.node_operator_id.unwrap();
        let node_operator_record_key = make_node_operator_record_key(node_operator_id).into_bytes();
        let RegistryValue {
            value: node_operator_record_vec,
            version: _,
            deletion_marker: _,
        } = self
            .get(&node_operator_record_key, self.latest_version())
            .unwrap_or_else(|| {
                panic!(
                    "{}Node Operator record with ID {} not found in the registry.",
                    LOG_PREFIX, node_operator_id
                )
            });
        let mut node_operator_record =
            decode_registry_value::<NodeOperatorRecord>(node_operator_record_vec.clone());
        if let Some(new_allowance) = payload.node_allowance {
            if new_allowance == node_operator_record.node_allowance {
                panic!(
                    "{}Node Operator record with ID {} already has an allowance of {}",
                    LOG_PREFIX, node_operator_id, new_allowance
                );
            }
            node_operator_record.node_allowance = new_allowance;
        };
        let mutations = vec![RegistryMutation {
            mutation_type: registry_mutation::Type::Update as i32,
            key: node_operator_record_key,
            value: encode_or_panic(&node_operator_record),
        }];
        // Check invariants before applying mutations
        self.maybe_apply_mutation_internal(mutations);
    }
pub fn do_update_node_operator_config ( & mut self , payload : UpdateNodeOperatorConfigPayload ) { println ! ( " " LOG_PREFIX payload ) ; let node_operator_id = payload . node_operator_id . unwrap ( ) ; let node_operator_record_key = make_node_operator_record_key ( node_operator_id ) . into_bytes ( ) ; let RegistryValue { value : node_operator_record_vec , version : _ , deletion_marker : _ , } = self . get ( & node_operator_record_key , self . latest_version ( ) ) . unwrap_or_else ( | | { panic ! ( " " LOG_PREFIX node_operator_id ) } ) ; let mut node_operator_record = decode_registry_value :: < NodeOperatorRecord > ( node_operator_record_vec . clone ( ) ) ; if let Some ( new_allowance ) = payload . node_allowance { if new_allowance == node_operator_record . node_allowance { panic ! ( " " LOG_PREFIX node_operator_id new_allowance ) ; } node_operator_record . node_allowance = new_allowance ; } ; let mutations = vec ! [ RegistryMutation { mutation_type registry_mutation Type Update as i32 key node_operator_record_key value encode_or_panic ( node_operator_record ) } ] ; // Check invariants before applying mutations self . maybe_apply_mutation_internal ( mutations ) ; }
Update an existing Node Operator's config
Update an existing Node Operator ' s config
&mut self
payload
UpdateNodeOperatorConfigPayload