use crate::{
nns::{
governance::NnsGovernanceCacheMetadata,
neuron::report::{collection::NnsNeuronCollectionState, model::NnsNeuronRow},
},
snapshot_cache::SnapshotEnvelope,
};
use serde::{Deserialize as SerdeDeserialize, Serialize};
pub(super) type NnsNeuronCache = SnapshotEnvelope<NnsGovernanceCacheMetadata, NnsNeuronCacheRows>;
pub(super) const NNS_NEURON_CACHE_FIELDS: &[&str] = &[
"schema_version",
"network",
"source_endpoint",
"fetched_at",
"fetched_by",
"domain",
"entity",
"collection",
"scope",
"governance_canister_id",
"completeness",
"collection_state",
"neurons",
];
#[derive(Clone, Debug, Eq, PartialEq, SerdeDeserialize, Serialize)]
pub(super) struct NnsNeuronCacheRows {
pub(super) collection_state: NnsNeuronCollectionState,
pub(super) neurons: Vec<NnsNeuronRow>,
}
pub(super) struct CompleteNeuronCollection {
pub(super) neurons: Vec<NnsNeuronRow>,
pub(super) state: NnsNeuronCollectionState,
}