Add account setup, dot update, and vitest suite#13
Merged
UtkarshBhardwaj007 merged 1 commit intomainfrom Apr 16, 2026
Merged
Conversation
- dot init: after QR login and toolchain install, runs a three-step
account setup on Paseo Asset Hub / Bulletin — fund from Alice (testnet),
Revive.map_account signed by the user, then Alice-granted bulletin
allowance. Login + deps run concurrently; account setup gates on both.
- dot update: self-updates from GitHub releases with an atomic
write-staging-then-rename, safe to run over the live binary.
- src/utils/signer.ts: session signer shim that routes transactions
through signPayload rather than signRaw — the default signRaw path
triggers the mobile's <Bytes> wrap and yields BadProof. Delegates to
polkadot-api/pjs-signer for authoritative per-extension mapping.
- src/utils/connection.ts: lazy singleton over getChainAPI("paseo")
with a 30s timeout; underlying errors are preserved via Error.cause.
- getSessionSigner() returns an explicit destroy() — the host-papp
adapter keeps the event loop alive and must be released.
- install.sh now preserves the exit code of the auto-run dot init so
CI can't silently pass on a failed setup.
- Test suite: vitest + 73 tests across 9 files. polkadot-api primitives
(Enum, encoders) are intentionally not mocked so tautological coverage
can't slip in.
- README + CLAUDE.md document the commands, architectural decisions,
and the non-obvious invariants (dep pinning, signer shim rationale,
session lifecycle, test conventions).
Contributor
|
Dev build ready — try this branch: |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
UtkarshBhardwaj007
added a commit
that referenced
this pull request
Apr 16, 2026
- Changeset cuts the release for the account-setup / dot-update / vitest work that merged in #13 (which shipped without a changeset, so release.yml exited on merge to main without cutting a release). - CLAUDE.md now states that every user-facing PR must include a changeset — release.yml is a no-op otherwise.
2 tasks
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 initaccount setup — after QR login and toolchain install (which run concurrently), gates on both and runs a three-step setup on Paseo: fund from Alice (testnet),Revive.map_accountsigned by the user on the mobile app, and Alice-granted bulletin allowance (1000 txs / 100 MB).dot update— self-updates from GitHub releases. Writes todot.new,fsyncs, then renames atomically so the live binary is never half-written.src/utils/signer.ts) — routes transactions throughsignPayloadrather thansignRaw. The defaultsignRawpath triggers the mobile's<Bytes>…</Bytes>wrap, producingBadProofon-chain. Delegates topolkadot-api/pjs-signer'sgetPolkadotSignerFromPjsso per-extension mapping stays authoritative (fixes aCheckMetadataHashencoding error that failed on-device).src/utils/connection.ts) — lazygetChainAPI("paseo")with a 30 s timeout; underlying errors preserved viaError.cause.getSessionSigner()returns adestroy()handle that callers MUST invoke. The host-papp adapter keeps the Node event loop alive; forgetting to release manifests asdot <cmd>hanging after visible work finishes.install.shpreserves the exit code of the auto-rundot initso CI cannot silently pass on a failed setup.polkadot-apiprimitives (Enum, encoders) so tautological coverage can't slip in.README.mdcovers commands + architecture;CLAUDE.mdcaptures the non-obvious invariants (dep pinning, signer-shim rationale, destroy contract, extract-pure-logic-from-tsx pattern).Test plan
npx tsc --noEmitcleanpnpm format:checkcleanpnpm test— 73 tests across 9 files passpnpm cli:installproduces a working binarydot initcompletes end-to-end — QR login, dependency install, fund, map (user signs on mobile), and allowance all succeed. PreviousCheckMetadataHashencoding error is resolved.dot updateon a machine with a previously installeddotin~/.polkadot/bin/(happy path + force-overwrite of the live binary).dot init -ystill only runs toolchain install (no QR, no account setup).