/// Tries to apply the requested settings on the canister identified by
/// `canister_id`.
Tries to apply the requested settings on the canister identified by
`canister_id`.
Tries to apply the requested settings on the canister identified by ` canister_id ` .
pub(crate) fn update_settings(
        &self,
        sender: PrincipalId,
        settings: CanisterSettings,
        canister: &mut CanisterState,
        total_subnet_compute_allocation_used: u64,
        total_subnet_memory_taken: NumBytes,
    ) -> Result<(), CanisterManagerError> {
        // Verify controller.
        self.validate_controller(canister, &sender)?;
        self.validate_compute_allocation(
            total_subnet_compute_allocation_used,
            canister,
            settings.compute_allocation(),
        )?;
        self.validate_memory_allocation(
            total_subnet_memory_taken,
            canister,
            settings.memory_allocation(),
        )?;
        let validated_settings =
            ValidatedCanisterSettings::try_from((settings, self.config.max_controllers))?;
        self.do_update_settings(validated_settings, canister);
        Ok(())
    }
pub ( crate ) fn update_settings ( & self , sender : PrincipalId , settings : CanisterSettings , canister : & mut CanisterState , total_subnet_compute_allocation_used : u64 , total_subnet_memory_taken : NumBytes , ) -> Result < ( ) , CanisterManagerError > { // Verify controller. self . validate_controller ( canister , & sender ) ? ; self . validate_compute_allocation ( total_subnet_compute_allocation_used , canister , settings . compute_allocation ( ) , ) ? ; self . validate_memory_allocation ( total_subnet_memory_taken , canister , settings . memory_allocation ( ) , ) ? ; let validated_settings = ValidatedCanisterSettings :: try_from ( ( settings , self . config . max_controllers ) ) ? ; self . do_update_settings ( validated_settings , canister ) ; Ok ( ( ) ) }
Tries to apply the requested settings on the canister identified by
`canister_id`.
Tries to apply the requested settings on the canister identified by ` canister_id ` .
&self
sender
PrincipalId
settings
CanisterSettings
canister
&mut CanisterState
total_subnet_compute_allocation_used
u64
total_subnet_memory_taken
NumBytes