ic_query/nns/node_provider/report/model/
report.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
10#[serde(deny_unknown_fields)]
11pub struct NnsNodeProviderListReport {
12 pub schema_version: u32,
13 pub network: String,
14 pub governance_canister_id: String,
15 pub registry_canister_id: String,
16 pub registry_version: u64,
17 pub fetched_at: String,
18 pub source_endpoint: String,
19 pub fetched_by: String,
20 pub node_provider_count: usize,
21 pub node_providers: Vec<NnsNodeProviderRow>,
22}
23
24#[cfg(feature = "nns-host")]
25impl_nns_inventory_report!(
26 NnsNodeProviderListReport,
27 super::super::NNS_NODE_PROVIDER_LIST_REPORT_SCHEMA_VERSION,
28 "node_provider",
29 node_provider_count,
30 node_providers,
31 |report: &NnsNodeProviderListReport| Some(report.governance_canister_id.clone()),
32 |report: &NnsNodeProviderListReport| {
33 if report.governance_canister_id != crate::nns::MAINNET_GOVERNANCE_CANISTER_ID {
34 return Err(format!(
35 "governance_canister_id is {}, expected {}",
36 report.governance_canister_id,
37 crate::nns::MAINNET_GOVERNANCE_CANISTER_ID
38 ));
39 }
40 Ok(())
41 },
42);
43
44#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
51pub struct NnsNodeProviderRow {
52 pub node_provider_principal: String,
53 pub name: Option<String>,
54 pub node_count: Option<u32>,
55 pub reward_account_hex: Option<String>,
56}
57
58#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
65pub struct NnsNodeProviderInfoReport {
66 pub schema_version: u32,
67 pub input: String,
68 pub resolved_from: String,
69 pub network: String,
70 pub governance_canister_id: String,
71 pub registry_canister_id: String,
72 pub registry_version: u64,
73 pub fetched_at: String,
74 pub source_endpoint: String,
75 pub fetched_by: String,
76 pub node_provider_principal: String,
77 pub name: Option<String>,
78 pub node_count: Option<u32>,
79 pub reward_account_hex: Option<String>,
80}