pub(crate) fn create_canister_with_funds(
        &self,
        sender: PrincipalId,
        cycles_amount: Option<u64>,
        _icp_amount: u64,
        settings: CanisterSettings,
        state: &mut ReplicatedState,
        provisional_whitelist: &ProvisionalWhitelist,
    ) -> Result<CanisterId, CanisterManagerError> {
        if !provisional_whitelist.contains(&sender) {
            return Err(CanisterManagerError::SenderNotInWhitelist(sender));
        }

        let cycles = match cycles_amount {
            Some(cycles_amount) => Cycles::from(cycles_amount),
            None => self.config.default_provisional_cycles_balance,
        };

        // Validate settings before `create_canister_helper` applies them
        match self.validate_settings(settings, state) {
            Err(err) => Err(err),
            Ok(validated_settings) => {
                self.create_canister_helper(sender, cycles, validated_settings, state)
            }
        }
    }
/// Creates a new canister with the fund amounts specified and inserts it
/// into `ReplicatedState`.
///
/// Note that this method is meant to only be invoked in local development
/// or, for Sodium, by a list of whitelisted principals.
///
/// Returns the auto-generated id the new canister that has been created.
Creates a new canister with the fund amounts specified and inserts it
into `ReplicatedState`.

Note that this method is meant to only be invoked in local development
or, for Sodium, by a list of whitelisted principals.

Returns the auto-generated id the new canister that has been created.
Creates a new canister with the fund amounts specified and inserts it into ` ReplicatedState ` . Note that this method is meant to only be invoked in local development or for Sodium by a list of whitelisted principals . Returns the auto - generated id the new canister that has been created .
pub(crate) fn create_canister_with_funds(
        &self,
        sender: PrincipalId,
        cycles_amount: Option<u64>,
        _icp_amount: u64,
        settings: CanisterSettings,
        state: &mut ReplicatedState,
        provisional_whitelist: &ProvisionalWhitelist,
    ) -> Result<CanisterId, CanisterManagerError> {
        if !provisional_whitelist.contains(&sender) {
            return Err(CanisterManagerError::SenderNotInWhitelist(sender));
        }
        let cycles = match cycles_amount {
            Some(cycles_amount) => Cycles::from(cycles_amount),
            None => self.config.default_provisional_cycles_balance,
        };
        // Validate settings before `create_canister_helper` applies them
        match self.validate_settings(settings, state) {
            Err(err) => Err(err),
            Ok(validated_settings) => {
                self.create_canister_helper(sender, cycles, validated_settings, state)
            }
        }
    }
pub ( crate ) fn create_canister_with_funds ( & self , sender : PrincipalId , cycles_amount : Option < u64 > , _icp_amount : u64 , settings : CanisterSettings , state : & mut ReplicatedState , provisional_whitelist : & ProvisionalWhitelist , ) -> Result < CanisterId , CanisterManagerError > { if ! provisional_whitelist . contains ( & sender ) { return Err ( CanisterManagerError :: SenderNotInWhitelist ( sender ) ) ; } let cycles = match cycles_amount { Some ( cycles_amount ) => Cycles :: from ( cycles_amount ) , None => self . config . default_provisional_cycles_balance , } ; // Validate settings before `create_canister_helper` applies them match self . validate_settings ( settings , state ) { Err ( err ) => Err ( err ) , Ok ( validated_settings ) => { self . create_canister_helper ( sender , cycles , validated_settings , state ) } } }
Creates a new canister with the fund amounts specified and inserts it
into `ReplicatedState`.
Creates a new canister with the fund amounts specified and inserts it into ` ReplicatedState ` .
&self
sender
PrincipalId
cycles_amount
Option<u64>
_icp_amount
u64
settings
CanisterSettings
state
&mut ReplicatedState
provisional_whitelist
&ProvisionalWhitelist
&self
sender
PrincipalId
cycles_amount
Option<u64>
_icp_amount
u64
settings
CanisterSettings
state
&mut ReplicatedState
provisional_whitelist
&ProvisionalWhitelist