pub(crate) fn uninstall_code(
        &self,
        canister_id: CanisterId,
        sender: PrincipalId,
        state: &mut ReplicatedState,
    ) -> Result<(), CanisterManagerError> {
        let time = state.time();
        let path = state.path().to_owned();
        let canister = match state.canister_state_mut(&canister_id) {
            Some(canister) => canister,
            None => return Err(CanisterManagerError::CanisterNotFound(canister_id)),
        };

        if canister.controller() != sender {
            return Err(CanisterManagerError::CanisterInvalidController {
                canister_id,
                controller_expected: canister.controller(),
                controller_provided: sender,
            });
        }

        let rejects = uninstall_canister(&self.log, canister, &path, time);
        crate::util::process_responses(rejects, state, Arc::clone(&self.ingress_history_writer));
        Ok(())
    }
/// Uninstalls code from a canister.
///
/// See https://sdk.dfinity.org/docs/interface-spec/index.html#ic-uninstall_code
Uninstalls code from a canister.
Uninstalls code from a canister .
pub(crate) fn uninstall_code(
        &self,
        canister_id: CanisterId,
        sender: PrincipalId,
        state: &mut ReplicatedState,
    ) -> Result<(), CanisterManagerError> {
        let time = state.time();
        let path = state.path().to_owned();
        let canister = match state.canister_state_mut(&canister_id) {
            Some(canister) => canister,
            None => return Err(CanisterManagerError::CanisterNotFound(canister_id)),
        };
        if canister.controller() != sender {
            return Err(CanisterManagerError::CanisterInvalidController {
                canister_id,
                controller_expected: canister.controller(),
                controller_provided: sender,
            });
        }
        let rejects = uninstall_canister(&self.log, canister, &path, time);
        crate::util::process_responses(rejects, state, Arc::clone(&self.ingress_history_writer));
        Ok(())
    }
pub ( crate ) fn uninstall_code ( & self , canister_id : CanisterId , sender : PrincipalId , state : & mut ReplicatedState , ) -> Result < ( ) , CanisterManagerError > { let time = state . time ( ) ; let path = state . path ( ) . to_owned ( ) ; let canister = match state . canister_state_mut ( & canister_id ) { Some ( canister ) => canister , None => return Err ( CanisterManagerError :: CanisterNotFound ( canister_id ) ) , } ; if canister . controller ( ) != sender { return Err ( CanisterManagerError :: CanisterInvalidController { canister_id , controller_expected : canister . controller ( ) , controller_provided : sender , } ) ; } let rejects = uninstall_canister ( & self . log , canister , & path , time ) ; crate :: util :: process_responses ( rejects , state , Arc :: clone ( & self . ingress_history_writer ) ) ; Ok ( ( ) ) }
Uninstalls code from a canister.
Uninstalls code from a canister .
&self
canister_id
CanisterId
sender
PrincipalId
state
&mut ReplicatedState
&self
canister_id
CanisterId
sender
PrincipalId
state
&mut ReplicatedState