Skip to content

Commit

Permalink
Fix build issue after bumping ic-js (#5262)
Browse files Browse the repository at this point in the history
# Motivation

Bump ic-js version and fix the build

# Changes

Adding the new field `visibility` in `Neuron` and `NeuronInfo` and pass
them through in anonymization

# Tests

N/A

# Todos

- [ x] Add entry to changelog (if necessary).

---------

Co-authored-by: gix-bot <[email protected]>
  • Loading branch information
jasonz-dfinity and gix-bot authored Aug 1, 2024
1 parent 8ae01ae commit acde27d
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 48 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-Nns-Dapp-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ proposal is successful, the changes it released will be moved from this file to
#### Changed

* Replace the nervous system left navigation on the staking tab with a new table.
* Bump ic-js to a version with new proposal types and neuron visibility.

#### Deprecated

Expand Down
96 changes: 48 additions & 48 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions frontend/src/lib/utils/anonymize.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export const anonymizeNeuronInfo = async (
retrievedAtTimestampSeconds,
votingPower,
ageSeconds,
visibility,
fullNeuron,
} = neuron;

Expand All @@ -145,6 +146,7 @@ export const anonymizeNeuronInfo = async (
retrievedAtTimestampSeconds,
votingPower: await anonymizeAmount(votingPower),
ageSeconds,
visibility,
fullNeuron: await anonymizeFullNeuron(fullNeuron),
};
};
Expand Down Expand Up @@ -191,6 +193,7 @@ export const anonymizeFullNeuron = async (
dissolveState,
followees,
spawnAtTimesSeconds,
visibility,
} = neuron;

return {
Expand All @@ -215,6 +218,7 @@ export const anonymizeFullNeuron = async (
spawnAtTimesSeconds,
dissolveState,
followees: await mapPromises(followees, anonymizeFollowees),
visibility,
};
};

Expand Down
2 changes: 2 additions & 0 deletions frontend/src/tests/mocks/neurons.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const mockFullNeuron: Neuron = {
joinedCommunityFundTimestampSeconds: undefined,
dissolveState: undefined,
followees: [],
visibility: undefined,
};

export const createMockFullNeuron = (id: number | bigint) => {
Expand All @@ -50,6 +51,7 @@ export const mockNeuron: NeuronInfo = {
retrievedAtTimestampSeconds: 10n,
votingPower: 300_000_000n,
ageSeconds: 100n,
visibility: undefined,
fullNeuron: mockFullNeuron,
};

Expand Down

0 comments on commit acde27d

Please sign in to comment.