Skip to content

feat(init): show registry username + account-in-use row#206

Merged
UtkarshBhardwaj007 merged 5 commits into
mainfrom
feat/read-registry-username
May 26, 2026
Merged

feat(init): show registry username + account-in-use row#206
UtkarshBhardwaj007 merged 5 commits into
mainfrom
feat/read-registry-username

Conversation

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member

Summary

  • dot init now displays the user's playground.dot registry username (the handle set via the playground-app profile) when claimed, with precedence: registry username → People-parachain identity → H160. Mirrors displayNameForAccount in playground-app so the CLI and web UI agree on what the user is called.
  • Adds an "account in use" row showing the derivation path (playground.dot/0) and the full H160 that signs on the user's behalf.
  • Read-only — silent fallback when the resolved registry doesn't expose get_username yet (e.g. against an older @W3S deploy). Picks up real values automatically once dot contract install refreshes against a newer ABI.

Companion change

This pairs with playground-app#204 which adds the username surface to the registry contract. No release coordination required: the CLI side degrades gracefully if the contract doesn't have the method yet.

Test plan

  • pnpm test — all 496 unit tests pass
  • pnpm format:check clean (Biome)
  • pnpm lint:license clean
  • pnpm build clean (Bun SEA)
  • Manual: dot init against the new @W3S shows username + account in use rows; if no username claimed yet, falls back to the People-parachain name
  • Manual: dot init against an older registry deploy (no get_username method) doesn't error, just falls back to People-parachain name

`dot init`'s identity block now displays the user's playground.dot
registry username (the handle they set via the playground-app profile)
when one is claimed, falling back to the People-parachain identity
name, then to the H160 — same precedence the playground-app uses in
`displayNameForAccount`. Also adds an "account in use" row showing the
derivation path (`playground.dot/0`) plus the full H160 that signs on
their behalf.

The new lookup (`lookupRegistryUsername(productH160)`) re-uses the
shared `getConnection()` client and the existing
`getReadOnlyRegistryContract` helper — no new deps. The call has a
runtime optional-chain guard against contracts that don't expose
`get_username` (e.g. the @W3S v7 deploy that's still live until the
v_new cutover ships): in that case the lookup silently returns null
and the display falls through to the People-parachain name. Once
`dot contract install` picks up the new @W3S ABI, the call starts
returning real values automatically — no CLI release needed.

Errors are caught and logged; this is a display-time enhancement and
never a hard failure path.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

Dev build ready — try this branch:

curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | VERSION=dev/feat/read-registry-username bash

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

E2E Test Pass · ❌ FAIL

Tag: e2e-ci-pr · Branch: feat/read-registry-username · Commit: 21314c7 · Run logs

Cell Result Time
pr-mod ✅ PASS 2m06s
pr-init-session ✅ PASS 2m27s
pr-deploy-cdm ✅ PASS 2m29s
pr-deploy-frontend ❌ FAIL 10m19s
pr-deploy-foundry ✅ PASS 1m05s
pr-install ✅ PASS 2m09s
pr-preflight ✅ PASS 2m38s
${{ matrix.cell }} ⏭️ SKIP 0m-1s
${{ matrix.cell }} ⏭️ SKIP 0m-1s

Sentry traces: view spans for this run

The v8 @w3s/playground-registry contract added `modded_from`,
`is_moddable`, and `is_dev_signer` to `publish(...)`, so every
`dot deploy --playground` against Paseo Asset Hub Next was reverting
with `Revive.ContractReverted` at the registry step. Wire the three
new args through `publishToPlayground` and refresh `cdm.json` to the
v8 ABI so the call encodes correctly. The runtime keeps resolving
the live address from the on-chain meta-registry.
Parity self-hosted runners ship rustup at a non-standard path (not
$HOME/.cargo). The previous guarded install skipped rustup-init, then
`source $HOME/.cargo/env` aborted the step under `set -e`. Run
rustup-init unconditionally (idempotent, `-y --default-toolchain none`
keeps it cheap) and source the env file only if it exists.
Bumps `@w3s/playground-registry` from v8 to v11 via `cdm i -n paseo`.
ABI is byte-identical to v8 (only version, address, and metadataCid
move), so the 7-arg publish signature already added on this branch is
correct against the new deploy.
…tring

Adds six unit tests for `lookupRegistryUsername` pinning the silent
backward-compatibility path: no `getUsername` method on the contract,
missing `.query`, `success: false`, empty-string sentinel, the happy
path, and the swallow-and-null-on-throw branch.

Refreshes the top-of-file docstring on `IdentityLines.tsx` to describe
the new four-row layout (was three) and the two-tier registry-then-People
precedence so the file's intro matches what it actually renders.
@UtkarshBhardwaj007 UtkarshBhardwaj007 merged commit 426768e into main May 26, 2026
3 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the feat/read-registry-username branch May 26, 2026 12:08
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