pub(crate) fn deposit_cycles(
        &self,
        canister_id: CanisterId,
        cycles: Cycles,
        state: &mut ReplicatedState,
    ) -> (Cycles, Result<(), CanisterManagerError>) {
        match state.canister_state_mut(&canister_id) {
            None => (
                cycles,
                Err(CanisterManagerError::CanisterNotFound(canister_id)),
            ),
            Some(canister) => {
                self.cycles_account_manager
                    .add_cycles(&mut canister.system_state, cycles);

                // Take out the cost of the operation.
                (Cycles::from(0), Ok(()))
            }
        }
    }
/// Deposits the amount of cycles specified from the sender to the target
/// `canister_id`.
///
/// # Errors
///
/// Returns a `CanisterManagerError` in case the canister does not exist
Deposits the amount of cycles specified from the sender to the target
`canister_id`.
Deposits the amount of cycles specified from the sender to the target ` canister_id ` .
pub(crate) fn deposit_cycles(
        &self,
        canister_id: CanisterId,
        cycles: Cycles,
        state: &mut ReplicatedState,
    ) -> (Cycles, Result<(), CanisterManagerError>) {
        match state.canister_state_mut(&canister_id) {
            None => (
                cycles,
                Err(CanisterManagerError::CanisterNotFound(canister_id)),
            ),
            Some(canister) => {
                self.cycles_account_manager
                    .add_cycles(&mut canister.system_state, cycles);
                // Take out the cost of the operation.
                (Cycles::from(0), Ok(()))
            }
        }
    }
pub ( crate ) fn deposit_cycles ( & self , canister_id : CanisterId , cycles : Cycles , state : & mut ReplicatedState , ) -> ( Cycles , Result < ( ) , CanisterManagerError > ) { match state . canister_state_mut ( & canister_id ) { None => ( cycles , Err ( CanisterManagerError :: CanisterNotFound ( canister_id ) ) , ) , Some ( canister ) => { self . cycles_account_manager . add_cycles ( & mut canister . system_state , cycles ) ; // Take out the cost of the operation. ( Cycles :: from ( 0 ) , Ok ( ( ) ) ) } } }
Deposits the amount of cycles specified from the sender to the target
`canister_id`.
Deposits the amount of cycles specified from the sender to the target ` canister_id ` .
&self
canister_id
CanisterId
cycles
Cycles
state
&mut ReplicatedState
&self
canister_id
CanisterId
cycles
Cycles
state
&mut ReplicatedState
errors
Returns a `CanisterManagerError` in case the canister does not exist
Returns a ` CanisterManagerError ` in case the canister does not exist