junobuild_shared::controllers

Function assert_max_number_of_controllers

Source
pub fn assert_max_number_of_controllers(
    current_controllers: &Controllers,
    controllers_ids: &[ControllerId],
    max_controllers: usize,
) -> Result<(), String>
Expand description

Asserts that the number of controllers does not exceed the maximum allowed.

§Arguments

  • current_controllers: Reference to the current set of controllers.
  • controllers_ids: Slice of ControllerId representing the controllers to be added.
  • max_controllers: Maximum number of allowed controllers.

§Returns

Ok(()) if the operation is successful, or Err(String) if the maximum is exceeded.