Skip to content

Commit

Permalink
feat: updated xverse signers
Browse files Browse the repository at this point in the history
  • Loading branch information
BLuEScioN committed Oct 29, 2024
1 parent 1c35949 commit 65c573d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/app/signers/SignerDistributionLegend.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode, useMemo, useRef } from 'react';
import { ReactNode, useMemo } from 'react';

import { Box } from '../../ui/Box';
import { Flex } from '../../ui/Flex';
Expand Down Expand Up @@ -90,22 +90,30 @@ export function SignersDistributionLegend({
signers: SignerInfo[];
onlyShowPublicSigners: boolean;
}) {
const numStackingDaoSigners = useRef(0);
const knownSigners = useMemo(
() =>
signers
.filter(signer => getSignerKeyName(signer.signing_key) !== 'unknown')
.map(signer => {
let name = getSignerKeyName(signer.signing_key);
let nameWithoutStackingDao = removeStackingDaoFromName(name);
if (nameWithoutStackingDao !== name) {
numStackingDaoSigners.current += 1;
}

return {
value: signer.weight_percent,
name: nameWithoutStackingDao,
};
}),
})
.reduce(
(acc, curr) => {
const existingSigner = acc.find(s => s.name === curr.name);

Check warning on line 108 in src/app/signers/SignerDistributionLegend.tsx

View check run for this annotation

Codecov / codecov/patch

src/app/signers/SignerDistributionLegend.tsx#L107-L108

Added lines #L107 - L108 were not covered by tests
if (existingSigner) {
existingSigner.value += curr.value;
return acc;

Check warning on line 111 in src/app/signers/SignerDistributionLegend.tsx

View check run for this annotation

Codecov / codecov/patch

src/app/signers/SignerDistributionLegend.tsx#L110-L111

Added lines #L110 - L111 were not covered by tests
}
return [...acc, curr];

Check warning on line 113 in src/app/signers/SignerDistributionLegend.tsx

View check run for this annotation

Codecov / codecov/patch

src/app/signers/SignerDistributionLegend.tsx#L113

Added line #L113 was not covered by tests
},
[] as { name: string; value: number }[]
),
[signers]
);
const unknownSigners = useMemo(
Expand Down
8 changes: 8 additions & 0 deletions src/app/signers/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ export const SIGNER_KEY_MAP: Record<string, { poolOperator: string; name: string
poolOperator: 'SPXVRSEH2BKSXAEJ00F1BY562P45D5ERPSKR4Q33',
name: 'Xverse',
},
'0x0302328212d5e430a8a880f8e2365a8f976ee50490ff030c106866c0b789eae91a': {
poolOperator: '',
name: 'Xverse',
},
'0x03b3b78738abbdc573cdcefd8200b1bca999e2f2fd8ecdf70c64ced1e4105437b7': {
poolOperator: '',
name: 'Xverse',
},
'0x02b20a0603a409270d4421d89a831e8f7b2fa7c5f2d8872d7aa94737334d10c194': {
poolOperator: 'SP3CPP71K21BKT8952BN0FFZQDEDKQ3BMB9M9J8X4',
name: 'Luxor',
Expand Down

0 comments on commit 65c573d

Please sign in to comment.