Skip to content

Commit

Permalink
Pass includeEmptyNeurons to use the new service
Browse files Browse the repository at this point in the history
  • Loading branch information
coskucinkilic committed Oct 10, 2024
1 parent 1db2d72 commit aef7a18
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/nns/src/governance.canister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -976,16 +976,20 @@ export class GovernanceCanister {
public getNeuron = async ({
certified = true,
neuronId,
includeEmptyNeurons,
}: {
certified: boolean;
neuronId: NeuronId;
includeEmptyNeurons: boolean;
}): Promise<NeuronInfo | undefined> => {
// The governance canister exposes two functions "get_neuron_info" and "get_full_neuron" that could probably be used to fetch the neuron details too.
// However historically this function has been resolved with a single call "list_neurons".

//Visibility is not provided by old oldListNeuronsCertifiedService, and we pass include empty neurons to get correct visibility
const [neuron]: NeuronInfo[] = await this.listNeurons({
certified,
neuronIds: [neuronId],
includeEmptyNeurons,
});

return neuron;
Expand Down

0 comments on commit aef7a18

Please sign in to comment.