use candid::Principal;
use canic_core::ids::SubnetId;
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct CertifiedCanisterCustodyView {
pub(in crate::fleet_ensure) principal: Principal,
pub(in crate::fleet_ensure) subnet: SubnetId,
pub(in crate::fleet_ensure) controllers: Vec<Principal>,
pub(in crate::fleet_ensure) module_sha256: Option<String>,
pub(in crate::fleet_ensure) certificate_tree_sha256: [u8; 32],
}
impl CertifiedCanisterCustodyView {
#[must_use]
pub const fn principal(&self) -> Principal {
self.principal
}
#[must_use]
pub const fn subnet(&self) -> SubnetId {
self.subnet
}
#[must_use]
pub fn controllers(&self) -> &[Principal] {
&self.controllers
}
#[must_use]
pub fn module_sha256(&self) -> Option<&str> {
self.module_sha256.as_deref()
}
#[must_use]
pub const fn certificate_tree_sha256(&self) -> [u8; 32] {
self.certificate_tree_sha256
}
}