Commit 3a1ea00
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
File tree
- packages
- cli
- abis
- src
- bulletin
- cli
- commands
- commands
- simpleExamples
- types
- utils
- tests
- _helpers
- integration/escrow
- unit
- bulletin
- cli
- escrow
- register
- utils
- ui
- abis
- src/store
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
Large diffs are not rendered by default.
0 commit comments