Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dre,registry): add nodes_in_registry field to NodeOperator #1077

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading