feat(init): show registry username + account-in-use row#206
Merged
Conversation
`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.
Contributor
|
Dev build ready — try this branch: |
Contributor
E2E Test Pass · ❌ FAILTag:
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.
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.
Summary
dot initnow 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. MirrorsdisplayNameForAccountin playground-app so the CLI and web UI agree on what the user is called.playground.dot/0) and the full H160 that signs on the user's behalf.get_usernameyet (e.g. against an older @W3S deploy). Picks up real values automatically oncedot contract installrefreshes 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 passpnpm format:checkclean (Biome)pnpm lint:licensecleanpnpm buildclean (Bun SEA)dot initagainst the new @W3S showsusername+account in userows; if no username claimed yet, falls back to the People-parachain namedot initagainst an older registry deploy (noget_usernamemethod) doesn't error, just falls back to People-parachain name