feat(explorer): resolve candidate validators#11124
feat(explorer): resolve candidate validators#11124KeitoTadashi wants to merge 9 commits intodevelopfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
begonaalvarezd
left a comment
There was a problem hiding this comment.
As discussed, the solution should be done to consider candidate validators, not extending inactive ones, since candidates are not really inactive
| const allCandidates: IotaValidatorSummaryExtended[] = sanitizeValidatorObjects( | ||
| candidateObjects, | ||
| { isCandidate: true }, | ||
| ); | ||
|
|
||
| const data = validatorAddress | ||
| ? allCandidates.filter((v) => v.iotaAddress === validatorAddress) | ||
| : allCandidates; | ||
|
|
There was a problem hiding this comment.
Prefer mapping the data in the query's select() method instead
| ? activeValidators?.concat(sanitizedPendingValidatorsData) | ||
| : activeValidators | ||
| : []; | ||
| const allValidators = useMemo( |
There was a problem hiding this comment.
Drop the useMemo, it hurts more than it helps
| const data = validatorAddress | ||
| ? allCandidates.filter((v) => v.iotaAddress === validatorAddress) | ||
| : allCandidates; |
There was a problem hiding this comment.
Why filter instead of find? You only want one
| const data = validatorAddress | |
| ? allCandidates.filter((v) => v.iotaAddress === validatorAddress) | |
| : allCandidates; | |
| const data = validatorAddress | |
| ? allCandidates.find((v) => v.iotaAddress === validatorAddress) | |
| : null; |
| function parseBigIntSafe(value: string | undefined | null): bigint { | ||
| try { | ||
| return BigInt(value ?? 0); | ||
| } catch { | ||
| return 0n; | ||
| } |
There was a problem hiding this comment.
Why was this now suddenly used for everything? Why would a field be missing?
There was a problem hiding this comment.
ill take another look here
|
closed in favor of iotaledger/ts-packages#59 |
Description of change
provide expected result

Links to any relevant issues
fixes iotaledger/ts-packages#59
How the change has been tested
Describe the tests that you ran to verify your changes.
Make sure to provide instructions for the maintainer as well as any relevant configurations.