feat(explorer): resolve candidate validators#11124
Draft
KeitoTadashi wants to merge 9 commits intodevelopfrom
Draft
feat(explorer): resolve candidate validators#11124KeitoTadashi wants to merge 9 commits intodevelopfrom
KeitoTadashi wants to merge 9 commits intodevelopfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
begonaalvarezd
requested changes
Apr 8, 2026
Member
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
marc2332
requested changes
Apr 9, 2026
Comment on lines
+30
to
+38
| const allCandidates: IotaValidatorSummaryExtended[] = sanitizeValidatorObjects( | ||
| candidateObjects, | ||
| { isCandidate: true }, | ||
| ); | ||
|
|
||
| const data = validatorAddress | ||
| ? allCandidates.filter((v) => v.iotaAddress === validatorAddress) | ||
| : allCandidates; | ||
|
|
Contributor
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( |
Contributor
There was a problem hiding this comment.
Drop the useMemo, it hurts more than it helps
Comment on lines
+35
to
+37
| const data = validatorAddress | ||
| ? allCandidates.filter((v) => v.iotaAddress === validatorAddress) | ||
| : allCandidates; |
Contributor
There was a problem hiding this comment.
Why filter instead of find? You only want one
Suggested change
| const data = validatorAddress | |
| ? allCandidates.filter((v) => v.iotaAddress === validatorAddress) | |
| : allCandidates; | |
| const data = validatorAddress | |
| ? allCandidates.find((v) => v.iotaAddress === validatorAddress) | |
| : null; |
Comment on lines
+482
to
+487
| function parseBigIntSafe(value: string | undefined | null): bigint { | ||
| try { | ||
| return BigInt(value ?? 0); | ||
| } catch { | ||
| return 0n; | ||
| } |
Contributor
There was a problem hiding this comment.
Why was this now suddenly used for everything? Why would a field be missing?
Contributor
Author
There was a problem hiding this comment.
ill take another look here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
provide expected result

Links to any relevant issues
fixes #11123
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.