Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
max-dfinity committed Jan 29, 2025
1 parent 8083f45 commit afe31d5
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions rs/nns/governance/src/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ use ic_nns_constants::{
LIFELINE_CANISTER_ID, REGISTRY_CANISTER_ID, ROOT_CANISTER_ID, SNS_WASM_CANISTER_ID,
SUBNET_RENTAL_CANISTER_ID,
};
use ic_nns_governance_api::pb::v1::list_neurons::NeuronSubaccount;
use ic_nns_governance_api::{
pb::v1::{
self as api,
Expand Down Expand Up @@ -2277,17 +2278,21 @@ impl Governance {
BTreeSet::new()
};

let mut neurons_by_subaccount: BTreeSet<NeuronId> = neuron_subaccounts
.unwrap_or_default()
.iter()
.flat_map(|neuron_subaccount| {
Self::bytes_to_subaccount(&neuron_subaccount.subaccount)
.ok()
.and_then(|subaccount| {
self.neuron_store.get_neuron_id_for_subaccount(subaccount)
let neurons_by_subaccount: BTreeSet<NeuronId> = neuron_subaccounts
.as_ref()
.map(|subaccounts| {
subaccounts
.iter()
.flat_map(|neuron_subaccount| {
Self::bytes_to_subaccount(&neuron_subaccount.subaccount)
.ok()
.and_then(|subaccount| {
self.neuron_store.get_neuron_id_for_subaccount(subaccount)
})
})
.collect()
})
.collect();
.unwrap_or_default();

// Concatenate (explicit and implicit)-ly included neurons.
let mut requested_neuron_ids: BTreeSet<NeuronId> =
Expand Down

0 comments on commit afe31d5

Please sign in to comment.