Skip to content

fix(web): read renamed validator fields from API/node - #39

Merged
chiliec merged 1 commit into
masterfrom
fix/witness-to-validator-read-fields
Aug 13, 2026
Merged

fix(web): read renamed validator fields from API/node#39
chiliec merged 1 commit into
masterfrom
fix/witness-to-validator-read-fields

Conversation

@chiliec

@chiliec chiliec commented Aug 13, 2026

Copy link
Copy Markdown
Member

What

The viz-cpp-node witness→validator migration renamed the fields the API and node return. Several read-sites still read the old witness names, so they silently rendered empty (you can see 'Current validator' = — on the live homepage right now).

Location Was reading Now reads Symptom fixed
Home page.tsx current_witness current_validator 'Current validator' tile empty
dashboard/page.tsx current_witness current_validator validator tile empty
block/[n]/page.tsx header.witness header.validator block 'Validator' empty
[account]/page.tsx witnesses_voted_for validators_voted_for 'Validator votes' always 0
ValidatorsTable.tsx account.witness_votes account.validator_votes 'already voted' highlight missing
validator/manage/page.tsx dgp.current_witness dgp.current_validator declaration-fee lookup silently failed

Change

Each site uses new ?? old so 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.cx and node.viz.cx. tsc --noEmit and eslint clean (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.

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
chiliec merged commit 22550d7 into master Aug 13, 2026
@chiliec
chiliec deleted the fix/witness-to-validator-read-fields branch August 13, 2026 14:25
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant