Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/app/[account]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default async function AccountPage({ params }: { params: Promise<{ accoun

<Card>
<SectionTitle>Governance</SectionTitle>
<DefRow label="Validator votes">{profile.witnesses_voted_for ?? 0}</DefRow>
<DefRow label="Validator votes">{profile.validators_voted_for ?? profile.witnesses_voted_for ?? 0}</DefRow>
<DefRow label="Vote proxy">
{profile.proxy ? <AccountChip name={profile.proxy} size={16} /> : "none"}
</DefRow>
Expand Down
6 changes: 5 additions & 1 deletion web/app/block/[n]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ export default async function BlockPage({ params }: { params: Promise<{ n: strin
<Card>
<DefRow label="Timestamp">{timestamp ? formatUTC(timestamp) : "—"}</DefRow>
<DefRow label="Validator">
{header?.witness ? <AccountChip name={header.witness} size={18} /> : "—"}
{header?.validator || header?.witness ? (
<AccountChip name={(header.validator ?? header.witness)!} size={18} />
) : (
"—"
)}
</DefRow>
<DefRow label="Transactions">
{txMap.size} {txMap.size === 1 ? "transaction" : "transactions"} · {ops.length} ops
Expand Down
6 changes: 5 additions & 1 deletion web/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export default async function DashboardPage() {
const dao = assetAmount(info?.committee_fund as string | undefined);
const rewards = assetAmount(info?.total_reward_fund as string | undefined);
const liquid = Math.max(0, supply - capital - dao - rewards);
const currentValidator =
(info?.current_validator as string | undefined) ??
(info?.current_witness as string | undefined) ??
null;

// Recent blocks strip (best-effort; immutable so cached hard).
const recentNums = head ? Array.from({ length: 8 }, (_, i) => head - i) : [];
Expand All @@ -40,7 +44,7 @@ export default async function DashboardPage() {
<StatTile label="Vesting (capital)" value={capital ? `${compact(capital)} VIZ` : "—"} tone="green" />
<StatTile
label="Current validator"
value={info?.current_witness ? <AccountChip name={info.current_witness} size={20} /> : "—"}
value={currentValidator ? <AccountChip name={currentValidator} size={20} /> : "—"}
/>
</StatStrip>

Expand Down
5 changes: 4 additions & 1 deletion web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export default async function Home() {
const head = info?.head_block_number;
const supply = assetAmount(info?.current_supply as string | undefined);
const vestFund = assetAmount(info?.total_vesting_fund as string | undefined);
const witness = (info?.current_witness as string | undefined) ?? null;
const witness =
(info?.current_validator as string | undefined) ??
(info?.current_witness as string | undefined) ??
null;

return (
<div className="flex flex-col gap-8">
Expand Down
2 changes: 1 addition & 1 deletion web/app/validator/manage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function ValidatorManagePage() {
if (v) { setUrl(v.url ?? ''); setSigningKey(v.signing_key ?? '') }
}).finally(() => { if (!cancelled) setLoading(false) })
withNode((api) => api.getDynamicGlobalProperties())
.then((dgp) => fetchValidator(dgp.current_witness))
.then((dgp) => fetchValidator(dgp.current_validator ?? dgp.current_witness))
.then((top) => {
if (cancelled || !top?.props) return
const fee = (top.props as Record<string, unknown>)['validator_declaration_fee']
Expand Down
2 changes: 1 addition & 1 deletion web/components/tables/ValidatorsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function ValidatorsTable({
api.getAccounts([wallet.account])
.then(([acc]) => {
if (cancelled || !acc) return;
setVotedSet(new Set((acc['witness_votes'] as string[] | undefined) ?? []));
setVotedSet(new Set(((acc['validator_votes'] ?? acc['witness_votes']) as string[] | undefined) ?? []));
setProxy((acc['proxy'] as string | undefined) ?? "");
const levels = (acc['proxied_vsf_votes'] as (string | number)[] | undefined) ?? [];
const rawSum = levels.reduce<number>((s, v) => s + assetAmount(v), 0);
Expand Down