ic_query/nns/neuron/report/classification/mod.rs
1//! Module: nns::neuron::report::classification
2//!
3//! Responsibility: define native NNS neuron classifications and their stable labels.
4//! Does not own: raw Governance DTOs, report assembly, or text layout.
5//! Boundary: retains unrecognized numeric codes instead of collapsing protocol evidence.
6
7use crate::nns::governance::{native_code_classification, native_optional_code_classification};
8
9native_code_classification! {
10 "state";
11 ///
12 /// NnsNeuronState
13 ///
14 /// Native NNS Governance neuron state with unrecognized codes retained.
15 ///
16
17 pub enum NnsNeuronState {
18 /// Governance supplied the unspecified state code.
19 Unspecified = 0 => "unspecified",
20 /// Neuron is not dissolving.
21 NotDissolving = 1 => "not-dissolving",
22 /// Neuron is dissolving.
23 Dissolving = 2 => "dissolving",
24 /// Neuron has dissolved.
25 Dissolved = 3 => "dissolved",
26 /// Neuron is spawning.
27 Spawning = 4 => "spawning",
28 ; unknown Unknown(i32),
29 }
30}
31
32native_optional_code_classification! {
33 "visibility";
34 ///
35 /// NnsNeuronVisibility
36 ///
37 /// Native optional NNS Governance neuron visibility with unknown evidence retained.
38 ///
39
40 pub enum NnsNeuronVisibility {
41 /// Governance omitted the optional visibility code.
42 Unknown,
43 /// Governance supplied the unspecified visibility code.
44 Unspecified = 0 => "unspecified",
45 /// Neuron is private.
46 Private = 1 => "private",
47 /// Neuron is public.
48 Public = 2 => "public",
49 ; unknown UnknownCode(i32),
50 }
51}
52
53native_optional_code_classification! {
54 "type";
55 ///
56 /// NnsNeuronType
57 ///
58 /// Native optional NNS Governance neuron type with unknown evidence retained.
59 ///
60
61 pub enum NnsNeuronType {
62 /// Governance omitted the optional neuron-type code.
63 Unknown,
64 /// Governance supplied the unspecified neuron-type code.
65 Unspecified = 0 => "unspecified",
66 /// Seed neuron.
67 Seed = 1 => "seed",
68 /// Early-contributor-token neuron.
69 Ect = 2 => "ect",
70 ; unknown UnknownCode(i32),
71 }
72}
73
74#[cfg(test)]
75mod tests;