From bbebe151573318ec2a259dc0c0fe2397544c49cb Mon Sep 17 00:00:00 2001 From: Cosku Cinkilic Date: Fri, 11 Oct 2024 00:18:03 +0200 Subject: [PATCH] remove default includeEmptyNeurons=false from getNeuron and set test to includeEmptyNeurons: false --- packages/nns/src/governance.canister.spec.ts | 4 ++-- packages/nns/src/governance.canister.ts | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/nns/src/governance.canister.spec.ts b/packages/nns/src/governance.canister.spec.ts index 89c051a9..ad46a692 100644 --- a/packages/nns/src/governance.canister.spec.ts +++ b/packages/nns/src/governance.canister.spec.ts @@ -756,13 +756,13 @@ describe("GovernanceCanister", () => { const response = await governance.getNeuron({ certified: true, neuronId, - includeEmptyNeurons: true, + includeEmptyNeurons: false, }); expect(certifiedService.list_neurons).toBeCalledWith({ neuron_ids: new BigUint64Array([neuronId]), include_neurons_readable_by_caller: false, - include_empty_neurons_readable_by_caller: [true], + include_empty_neurons_readable_by_caller: [false], include_public_neurons_in_full_neurons: [], }); diff --git a/packages/nns/src/governance.canister.ts b/packages/nns/src/governance.canister.ts index 4abb1c98..3a01c2fa 100644 --- a/packages/nns/src/governance.canister.ts +++ b/packages/nns/src/governance.canister.ts @@ -976,7 +976,7 @@ export class GovernanceCanister { public getNeuron = async ({ certified = true, neuronId, - includeEmptyNeurons = false, + includeEmptyNeurons, }: { certified: boolean; neuronId: NeuronId; @@ -985,13 +985,11 @@ export class GovernanceCanister { // 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 + //Visibility is not provided by oldListNeuronsCertifiedService, and we pass include empty neurons to have option to use the certifiedService const [neuron]: NeuronInfo[] = await this.listNeurons({ certified, neuronIds: [neuronId], - includeEmptyNeurons: includeEmptyNeurons - ? includeEmptyNeurons - : undefined, + includeEmptyNeurons, }); return neuron;