use crate::{
InternalError,
cdk::types::Principal,
dto::canister::{CanisterHistoryResponse, CanisterStatusResponse},
ops::ic::mgmt::MgmtOps,
};
pub struct MgmtWorkflow;
impl MgmtWorkflow {
pub async fn canister_history(
pid: Principal,
) -> Result<CanisterHistoryResponse, InternalError> {
MgmtOps::canister_history(pid).await
}
pub async fn canister_status(pid: Principal) -> Result<CanisterStatusResponse, InternalError> {
let status = MgmtOps::canister_status(pid).await?;
Ok(MgmtOps::canister_status_to_dto(status))
}
}