use crate::ic_registry::RegistryFetchError;
use crate::subnet_catalog::SubnetCatalogRegistryValueEncoding;
use ic_host_tools::registry::proto::LargeValueChunkKeys;
#[cfg(feature = "nns-host")]
use ic_platform::Principal;
use serde::Deserialize;
#[derive(Debug)]
pub(super) enum RegistryValueContent {
Value(Vec<u8>),
LargeValueChunkKeys(LargeValueChunkKeys),
}
#[derive(Debug, Eq, PartialEq)]
pub(super) struct RegistryVersionedValue {
pub(super) value: Vec<u8>,
pub(super) version: u64,
pub(super) timestamp_nanoseconds: u64,
pub(super) encoding: SubnetCatalogRegistryValueEncoding,
}
#[derive(Debug)]
pub(super) struct RegistryVersionedValueFailure {
pub(super) source: RegistryFetchError,
pub(super) returned_version: Option<u64>,
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
pub(super) struct RegistryGetChunkRequest {
pub(super) content_sha256: Option<Vec<u8>>,
}
ic_platform::candid_record!(RegistryGetChunkRequest {
603_009_517 => content_sha256: Option<Vec<u8>>
});
#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
pub(super) struct RegistryChunk {
pub(super) content: Option<Vec<u8>>,
}
ic_platform::candid_record!(RegistryChunk {
427_265_337 => content: Option<Vec<u8>>
});
#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
#[cfg(feature = "nns-host")]
pub(super) struct ListNodeProvidersResponse {
pub(super) node_providers: Vec<GovernanceNodeProvider>,
}
#[cfg(feature = "nns-host")]
ic_platform::candid_record!(ListNodeProvidersResponse {
1_989_342_821 => node_providers: Vec<GovernanceNodeProvider>
});
#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
#[cfg(feature = "nns-host")]
pub(super) struct GovernanceNodeProvider {
pub(super) id: Option<Principal>,
pub(super) reward_account: Option<GovernanceAccountIdentifier>,
}
#[cfg(feature = "nns-host")]
ic_platform::candid_record!(GovernanceNodeProvider {
23_515 => id: Option<Principal>,
2_095_839_389 => reward_account: Option<GovernanceAccountIdentifier>
});
#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
#[cfg(feature = "nns-host")]
pub(super) struct GovernanceAccountIdentifier {
pub(super) hash: Vec<u8>,
}
#[cfg(feature = "nns-host")]
ic_platform::candid_record!(GovernanceAccountIdentifier {
1_158_164_430 => hash: Vec<u8>
});