pub(in crate::fleet_ensure) mod coordinator;
pub(in crate::fleet_ensure) mod evidence;
pub(in crate::fleet_ensure) mod ledger;
pub(in crate::fleet_ensure) mod membership;
use crate::{fleet_ensure::model::DesiredCanisterKind, protocol_binding::RegistryProtocolBinding};
use candid::Principal;
use canic_core::ids::{FleetBinding, ReleaseBuildId, SubnetId};
use std::collections::BTreeMap;
#[derive(Debug)]
pub struct CompletedSourceInspectionView {
pub inventory: CompletedEstateInventoryView,
pub source_protocols: BTreeMap<String, crate::protocol_binding::ResolvedProtocolBinding>,
}
#[derive(Debug)]
pub struct CompletedEstateInventoryView {
pub receipts: super::CompletedReceiptAuditView,
pub fleet: FleetBinding,
pub release_build_id: ReleaseBuildId,
pub coordinator: Principal,
pub coordinator_registry: coordinator::CompletedCoordinatorMembershipView,
pub canisters: BTreeMap<String, CompletedCanisterInventoryView>,
pub recorded_controlled_canister_cycles: u128,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct CompletedCanisterInventoryView {
pub principal: Principal,
pub subnet: SubnetId,
pub kind: DesiredCanisterKind,
pub parent: Option<String>,
pub root: Option<String>,
pub module_sha256: Option<String>,
pub protocol_binding: Option<RegistryProtocolBinding>,
pub originally_declared_controllers: Vec<Principal>,
pub recorded_cycles: u128,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct CompletedCanisterCustodyView {
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 CompletedCanisterCustodyView {
#[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
}
}
#[derive(Debug)]
pub struct CompletedEstateCustodyView {
pub(in crate::fleet_ensure) observed_at: std::time::Instant,
pub(in crate::fleet_ensure) documents: crate::fleet_ensure::model::FleetTerminalSourceRecord,
pub(in crate::fleet_ensure) network: canic_core::ids::CanonicalNetworkId,
pub(in crate::fleet_ensure) operator: Principal,
pub(in crate::fleet_ensure) canisters: BTreeMap<String, CompletedCanisterCustodyView>,
}
impl CompletedEstateCustodyView {
#[must_use]
pub const fn documents(&self) -> &crate::fleet_ensure::model::FleetTerminalSourceRecord {
&self.documents
}
#[must_use]
pub const fn network(&self) -> canic_core::ids::CanonicalNetworkId {
self.network
}
#[must_use]
pub const fn operator(&self) -> Principal {
self.operator
}
#[must_use]
pub const fn canisters(&self) -> &BTreeMap<String, CompletedCanisterCustodyView> {
&self.canisters
}
}