pub fn update_associated_key(
        &mut self,
        account_hash: AccountHash,
        weight: Weight,
    ) -> Result<(), UpdateKeyFailure> {
        if let Some(current_weight) = self.associated_keys.get(&account_hash) {
            if weight < *current_weight {
                // New weight is smaller than current weight
                if !self.can_update_key(account_hash, weight) {
                    return Err(UpdateKeyFailure::ThresholdViolation);
                }
            }
        }
        self.associated_keys.update_key(account_hash, weight)
    }
/// Updates an associated key.
///
/// Returns an error if the update would result in a violation of the key management thresholds.
Updates an associated key.
Returns an error if the update would result in a violation of the key management thresholds.
Updates an associated key . Returns an error if the update would result in a violation of the key management thresholds .
pub fn update_associated_key(
        &mut self,
        account_hash: AccountHash,
        weight: Weight,
    ) -> Result<(), UpdateKeyFailure> {
        if let Some(current_weight) = self.associated_keys.get(&account_hash) {
            if weight < *current_weight {
                // New weight is smaller than current weight
                if !self.can_update_key(account_hash, weight) {
                    return Err(UpdateKeyFailure::ThresholdViolation);
                }
            }
        }
        self.associated_keys.update_key(account_hash, weight)
    }
pub fn update_associated_key ( & mut self , account_hash : AccountHash , weight : Weight , ) -> Result < ( ) , UpdateKeyFailure > { if let Some ( current_weight ) = self . associated_keys . get ( & account_hash ) { if weight < * current_weight { // New weight is smaller than current weight if ! self . can_update_key ( account_hash , weight ) { return Err ( UpdateKeyFailure :: ThresholdViolation ) ; } } } self . associated_keys . update_key ( account_hash , weight ) }
Updates an associated key.
Updates an associated key .
&mut self
account_hash
AccountHash
weight
Weight
&mut self
account_hash
AccountHash
weight
Weight