Skip to content

Commit

Permalink
feat(dre,registry): add nodes_in_registry field to NodeOperator (#1077)
Browse files Browse the repository at this point in the history
  • Loading branch information
sasa-tomic authored Nov 13, 2024
1 parent dec9967 commit dd6475d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rs/cli/src/commands/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ async fn get_node_operators(local_registry: &Arc<dyn LazyRegistry>, network: &Ne
.iter()
.filter(|(_, value)| value.operator.principal == record.principal && value.subnet_id.is_some())
.count() as u64;
let nodes_in_registry = all_nodes.iter().filter(|(_, value)| value.operator.principal == record.principal).count() as u64;
(
record.principal,
NodeOperator {
Expand All @@ -208,6 +209,7 @@ async fn get_node_operators(local_registry: &Arc<dyn LazyRegistry>, network: &Ne
nodes_health: Default::default(),
rewards_correct: false,
nodes_in_subnets,
nodes_in_registry,
},
)
})
Expand Down Expand Up @@ -523,6 +525,7 @@ struct NodeOperator {
nodes_health: IndexMap<String, Vec<PrincipalId>>,
rewards_correct: bool,
nodes_in_subnets: u64,
nodes_in_registry: u64,
}

// We re-create the rewards structs here in order to convert the output of get-rewards-table into the format
Expand Down

0 comments on commit dd6475d

Please sign in to comment.