fix(web): read renamed validator fields from API/node - #39
Merged
Conversation
The viz-cpp-node witness→validator migration renamed the fields the API and node return, but several read-sites still read the old witness names, so they silently rendered empty: - Home + Dashboard 'Current validator' → current_validator (was current_witness) - Block page 'Validator' → block header .validator (was .witness) - Account 'Validator votes' → validators_voted_for (was witnesses_voted_for) - Validators table 'already voted' → account.validator_votes (was witness_votes) - Validator manage fee lookup → dgp.current_validator (was current_witness) Each falls back to the old field (new ?? old) so it still works against a lagging node. Verified new names against live api.viz.cx and node.viz.cx. tsc --noEmit and eslint clean.
chiliec
added a commit
that referenced
this pull request
Aug 14, 2026
Pick up the witness→validator read-path type fixes now published to npm (ts-api#4, ts-core#16). The runtime fix (#39) already reads the new fields with fallbacks; this aligns the build-time SDK types so tsc validates against current_validator / validator / validators_voted_for etc. Both lockfiles refreshed (package-lock.json is authoritative — web/Dockerfile runs npm ci; pnpm-lock.yaml kept consistent). tsc --noEmit and eslint clean against the real published packages.
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.
What
The viz-cpp-node
witness→validatormigration renamed the fields the API and node return. Several read-sites still read the oldwitnessnames, so they silently rendered empty (you can see 'Current validator' = — on the live homepage right now).page.tsxcurrent_witnesscurrent_validatordashboard/page.tsxcurrent_witnesscurrent_validatorblock/[n]/page.tsxheader.witnessheader.validator[account]/page.tsxwitnesses_voted_forvalidators_voted_forValidatorsTable.tsxaccount.witness_votesaccount.validator_votesvalidator/manage/page.tsxdgp.current_witnessdgp.current_validatorChange
Each site uses
new ?? oldso it still works against a lagging node. Pairs with the type fixes in ts-api#4 and ts-core#16.Verified
New field names confirmed against live
api.viz.cxandnode.viz.cx.tsc --noEmitandeslintclean (checked against the patched SDK builds).Note
Web unit tests (
vitest) couldn't run in my sandbox due to an unrelated ESM/native-binding toolchain issue (@rolldown/binding/std-env), not caused by this change — all edits are field renames covered by type-check + lint.