From 110f8df4580d362c3998104eac5419b17c1f1673 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:13:32 +0000 Subject: [PATCH 1/2] Updating formatting --- packages/nns/src/utils/neurons.utils.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/nns/src/utils/neurons.utils.ts b/packages/nns/src/utils/neurons.utils.ts index 9bd94ad6..0530afd7 100644 --- a/packages/nns/src/utils/neurons.utils.ts +++ b/packages/nns/src/utils/neurons.utils.ts @@ -1,5 +1,4 @@ import { Vote } from "../enums/governance.enums"; -import type { NeuronId } from "../types/common"; import type { Ballot, NeuronInfo, @@ -8,13 +7,12 @@ import type { const getNeuronVoteForProposal = ({ proposal: { ballots }, - neuron: {neuronId}, + neuron: { neuronId }, }: { proposal: ProposalInfo; neuron: NeuronInfo; -}): Vote | undefined => ballots.find( - ({ neuronId: id }) => id === neuronId, - )?.vote; +}): Vote | undefined => + ballots.find(({ neuronId: id }) => id === neuronId)?.vote; /** * Filter the neurons that are ineligible to vote to a proposal. @@ -63,7 +61,8 @@ export const votableNeurons = ({ }: { neurons: NeuronInfo[]; proposal: ProposalInfo; -}): NeuronInfo[] => neurons.filter( +}): NeuronInfo[] => + neurons.filter( (neuron: NeuronInfo) => getNeuronVoteForProposal({ proposal, neuron }) === Vote.Unspecified && ineligibleNeurons({ neurons, proposal }).find( From 10eabefab735813070cb16cfb9ae4c7116f2e2b5 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:14:48 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20Documentation=20auto-update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/nns/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nns/README.md b/packages/nns/README.md index 5469d723..6f36f471 100644 --- a/packages/nns/README.md +++ b/packages/nns/README.md @@ -96,7 +96,7 @@ Parameters: - `params.neurons`: The neurons to filter. - `params.proposal`: The proposal to match against the selected neurons. -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L38) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L29) #### :gear: votableNeurons @@ -111,22 +111,22 @@ Parameters: - `params.neurons`: The neurons to filter. - `params.proposal`: The proposal to match against the selected neurons. -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L67) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L58) #### :gear: votedNeurons Filter the neurons that have voted for a proposal. -| Function | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------- | -| `votedNeurons` | `({ neurons, proposal: { ballots }, }: { neurons: NeuronInfo[]; proposal: ProposalInfo; }) => NeuronInfo[]` | +| Function | Type | +| -------------- | ---------------------------------------------------------------------------------------------- | +| `votedNeurons` | `({ neurons, proposal, }: { neurons: NeuronInfo[]; proposal: ProposalInfo; }) => NeuronInfo[]` | Parameters: - `params.neurons`: The neurons to filter. - `params.proposal`: The proposal for which some neurons might have already voted. -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L93) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L81) ### :factory: GenesisTokenCanister