Skip to content

Commit 3a1ea00

Browse files
chore(cli): Quality of lite improvement in preparation for paseo v2 (#148)
## Description Brings the `dotns` CLI up to date with the upcoming paseo-v2 contract release. The shipped CLI was diverging from the deployed contracts in small but real ways, and the new deposit lifecycle had no command surface at all. This PR closes both gaps. What changes for users: - **Names with a single trailing digit are rejected up front.** A name's digit suffix must be zero digits or exactly two; one digit (or three or more) is no longer accepted. The CLI now catches this before submission instead of relying on the on-chain revert. - **Downward transfers no longer fail.** When you move a name to a wallet at a lower verification tier, the CLI now asks the contracts what the friction fee is and pays it as part of the transfer. Previously the CLI sent zero value and the transfer reverted; same-tier and upward transfers still cost nothing. - **New escrow command.** There is now a `dotns escrow` group covering the full deposit lifecycle: check the status of a name's escrow position, release the name into escrow, withdraw after the cooldown, drain any overpayment held in the legacy pull ledger, and list, claim, or batch-claim entries from the new time-locked refund ledger. Before this PR none of these flows existed in the CLI; users had to interact with the escrow contract by hand. - **Bundled contract addresses and ABIs refreshed.** The CLI ships with a new contract address slot for the name escrow, plus regenerated ABIs across the board so encoded calls match what the contracts actually expose today. The drift was non-trivial in places (for example the reverse resolver had renamed entry points). Tests have been added to lock the new behaviour: the trailing-digit rule, the new escrow help text and output formatting, a small JSON-output change that lets bigint fields serialise safely, and a live-chain integration test that walks through register, status, release, status. A few redundant assertions in the environment tests have been removed since they were each checking the same hardcoded deployment address; they had nothing to do with what the test was about, and the suite now makes no assumption about which addresses are deployed. ## Type - [x] Chore ## Package - [x] `@parity/dotns-cli` ## Related Issues n/a ## Fixes n/a ## Checklist ### Code - [x] Follows project style - [ ] `bun run lint` passes — *let CI verify* - [ ] `bun run format` passes — *let CI verify* - [x] `bun run typecheck` passes ### Documentation - [ ] README updated if needed — *the new commands are discoverable through the built-in help, so the package readme does not need editing* - [x] Types updated if needed ### Breaking Changes - [x] No breaking changes **Breaking changes:** n/a ## Testing How to test: 1. Run the type checker. It passes on both packages. 2. Run the unit suite. Every assertion passes, including the new validation, escrow help, and escrow formatter tests. 3. Open the CLI's help screen and confirm `escrow` is listed; then look at `escrow --help` and `escrow refunds --help` to see the new subcommands. 4. Against a live paseo-v2 deployment, run the new escrow integration suite. It registers a name, checks the escrow position, releases the name, and verifies the position has flipped to released with a cooldown timestamp in place. The post-cooldown half is intentionally not exercised because the cooldown runs for days on the live chain. ## Notes The integration tests do not hardcode any contract address. They drive the CLI surface and let the bundled environment configuration resolve which addresses to use, so they continue to work whenever a fresh deployment is recorded. The decision to regenerate every ABI rather than patch only the escrow one was deliberate: piecemeal patching is how drift accumulated in the first place. --------- Co-authored-by: Andrew Ahlers <andrew.ahlers@parity.io>
1 parent fddb3b4 commit 3a1ea00

58 files changed

Lines changed: 16527 additions & 14636 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ benchmark-baseline.json
4242
benchmark-report.html
4343
.benchmark-temp
4444
arb-generated
45+
.abis-version

bun.lock

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"scripts": {
77
"hooks:install": "git config core.hooksPath .githooks",
88
"prepare": "git config core.hooksPath .githooks || true",
9+
"postinstall": "node scripts/sync-abis.mjs",
10+
"sync:abis": "node scripts/sync-abis.mjs",
911
"format": "bun run --cwd packages/cli format && bun run --cwd packages/ui format",
1012
"format:fix": "bun run --cwd packages/cli format:fix && bun run --cwd packages/ui format:fix",
1113
"lint": "bun run --cwd packages/cli lint && bun run --cwd packages/ui lint",

packages/cli/abis/DotnsContentResolver.json

Lines changed: 478 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)