Skip to content

feat(cli): add escrow redeem and report the release phase - #312

Merged
charlesHetterich merged 9 commits into
mainfrom
feat/escrow-redeem-command
Oct 5, 2026
Merged

charlesHetterich merged 9 commits into
mainfrom
feat/escrow-redeem-command

Conversation

@charlesHetterich

@charlesHetterich charlesHetterich commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

The escrow lets a previous holder take a released name back inside the redeem window, and available stays false for others that whole time, but the CLI had no way to call redeem. A holder who released a name had a 24 hour right they could not exercise.

  • New escrow redeem <name> returns a released name to its previous holder. Before the write, assertRedeemable refuses when the name is not released, the signer is not the previous holder, the window has closed (naming when), or the deposit was withdrawn, which forfeits redemption.
  • escrow status and escrow positions report the release phase with the time it changes: held, redeemable, awaiting (deposit withdrawn inside the window), reclaimable. releasePhase mirrors the escrow's own redeem and isReclaimable predicates.
  • release reuses the phase text when refusing an already released name.

closes paritytech/dotns#252

Misc

  • The pure escrow rules (releasePhase, formatReleasePhase, and the pre-existing deposit helpers formatPositionStatus, cooldownRemainingSeconds, formatCooldown, isRefundableDeposit, totalEscrowAmount) moved out of commands/escrow.ts into commands/escrowStatus.ts, so the commands, the display layer and the preflight asserts read one definition of each state. No behaviour change.

Type

  • Feature

Package

  • @parity/dotns-cli

Testing

bun test tests/unit/

380 pass. Five new cases for redeem assert each refusal fires with zero writes plus the happy path; four pin releasePhase against the contract predicates; two pin the withdrawn-deposit wording in release and register; the positions table test checks the phase column.

Version bumped to 0.10.0.

The escrow lets a previous holder take a released name back inside the
redeem window, and keeps the name unavailable to others for that long;
the CLI had no way to call it.

- escrow redeem returns a released name to its previous holder. Before
  the write it refuses when the name is not released, the signer is not
  the previous holder, the window has closed (naming when), or the
  deposit was withdrawn, which forfeits redemption.
- escrow status and positions report the release phase with the time it
  changes: held, redeemable, awaiting (deposit withdrawn inside the
  window), reclaimable. The phases mirror the escrow's own predicates.
- release reuses the phase text when refusing an already released name.
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

CI Summary

Check Result
Lint Passed
Format Passed
Typecheck Passed
Build Passed
Release Passed
Deploy Example Passed
PR Title Passed
Labels Passed
Test Passed - 380 passed, 0 failed

Release - Passed

Test this PR

Download artifact (GitHub CLI required):

gh run download 37267053241 -n cli-release-0.0.0-pr.312 -R paritytech/dotns-sdk

Install globally:

npm install -g ./parity-dotns-cli-0.0.0-pr.312.tgz

Verify:

dotns --help
Deploy Example — Passed
Stage Status
✓ Site validation Site validated
✓ Deploy Deployed
Property Value
Domain pr312.dotns-example-site.dot
CID bafybeicx555prsudvmqsdrap7keoilryrudwycdx3ody2rejwqwjwp52u4
URL (dot.li) https://pr312.dotns-example-site.dot.li
URL (paseo.li) https://pr312.dotns-example-site.paseo.li
URL (direct) https://pr312.dotns-example-site.dot
Duration 75s

View run

Labels

pkg: cli, type: docs, type: test, dependencies

Test - Passed

380 passed, 0 failed across 380 tests.

View run

$ bun test tests/unit/
bun test v1.2.6 (8ebd5d53)

::group::tests/unit/store/storeHelp.test.ts:
(pass) store --help lists subcommands [22.00ms]
(pass) store claim --help shows description and auth options [6.00ms]
(pass) store info --help shows auth options [6.00ms]
(pass) store list --help shows options [3.00ms]
(pass) store get --help shows key argument [4.00ms]
(pass) store set --help shows key and value arguments with auth [2.00ms]
(pass) store delete --help shows key argument with auth [3.00ms]

::endgroup::

::group::tests/unit/inspect/prechecks.test.ts:
(pass) releaseName refuses before the approve > a name that is not registered [4.00ms]
(pass) releaseName refuses before the approve > a subname or lite name, which has no registrar token [1.00ms]
(pass) releaseName refuses before the approve > a soulbound personhood name [1.00ms]
(pass) releaseName refuses before the approve > a failed soulbound read, rather than treating it as not soulbound [1.00ms]
(pass) releaseName refuses before the approve > a name with no escrow position [1.00ms]
(pass) releaseName refuses before the approve > a name already released, saying until when the holder may redeem
(pass) releaseName refuses before the approve > a released name whose deposit was withdrawn, saying nobody can redeem it [1.00ms]
(pass) releaseName refuses before the approve > a name owned by another account
(pass) releaseName refuses before the approve > otherwise approves the escrow and then releases [1.00ms]
(pass) transferName refuses before the write > a subname or lite name, which has no registrar token
(pass) transferName refuses before the write > a soulbound personhood name [1.00ms]
(pass) transferName refuses before the write > a name owned by another account
(pass) transferName refuses before the write > otherwise submits the transfer [1.00ms]
(pass) ensureDomainNotRegistered > explains a name inside its redeem window and when registration opens
(pass) ensureDomainNotRegistered > says only when registration opens once the deposit was withdrawn
(pass) ensureDomainNotRegistered > does not mention a redeem window for a held, unreleased name

::endgroup::

::group::tests/unit/utils/validation.test.ts:
(pass) normaliseLabel > lowercases, trims, and strips a single trailing .dot [1.00ms]
(pass) normaliseLabel > strips the given TLD suffix rather than assuming .dot
(pass) isSecondLevelDotName > distinguishes a second-level name from a subdomain under the given TLD
(pass) isCanonicalLabel > accepts lowercase letters, digits and internal hyphens
(pass) isCanonicalLabel > rejects dots, uppercase, spaces and other characters
(pass) isCanonicalLabel > rejects leading or trailing hyphens, empty and overlong labels
(pass) isSecondLevelDotName > accepts a single label, with or without the .dot suffix [1.00ms]
(pass) isSecondLevelDotName > rejects subdomains
(pass) validateCanonicalLabel > throws for a name containing a dot, naming the role
(pass) validateCanonicalLabel > does not throw for a canonical label
(pass) validateDomainLabel digit-suffix rule > accepts labels with no trailing digits
(pass) validateDomainLabel digit-suffix rule > accepts labels with exactly two trailing digits
(pass) validateDomainLabel digit-suffix rule > accepts labels with any trailing digit count
(pass) validateDomainLabel digit-suffix rule > rejects labels shorter than three characters
(pass) validateDomainLabel digit-suffix rule > rejects labels with uppercase characters
(pass) validateDomainLabel digit-suffix rule > rejects labels with leading or trailing hyphen
(pass) validateGovernanceLabel stem-length rule > accepts stems of five characters or fewer
(pass) validateGovernanceLabel stem-length rule > rejects stems longer than five characters
(pass) validateGovernanceLabel stem-length rule > measures an ordinary label whole, digits included
(pass) validateGovernanceLabel stem-length rule > does not apply the PopRules digit-suffix rule
(pass) validateGovernanceLabel measures the base as v0.6.0 does > accepts any digit count while the whole label stays within the reserved band
(pass) validateGovernanceLabel measures the base as v0.6.0 does > rejects once the label as written leaves the reserved band [1.00ms]
(pass) validateGovernanceLabel measures the base as v0.6.0 does > the NORMAL path accepts any digit count too
(pass) validateGovernanceLabel canonical-label rules > rejects uppercase characters
(pass) validateGovernanceLabel canonical-label rules > rejects labels containing a dot
(pass) validateGovernanceLabel canonical-label rules > rejects leading or trailing hyphen
(pass) validateGovernanceLabel canonical-label rules > rejects labels shorter than three characters
(pass) isPersonLabel > accepts a letters-only name
(pass) isPersonLabel > rejects digits, hyphens, uppercase and the empty string
(pass) isLitePersonLabel > accepts a letters-only stem, one separator and exactly two digits
(pass) isLitePersonLabel > rejects a stem the gateway could not have issued
(pass) isLitePersonLabel > rejects any other digit count or a missing separator
(pass) baseLabelOf > drops the separator and allocated digits from a lite label
(pass) baseLabelOf > measures an ordinary label whole
(pass) isSecondLevelDotName with a lite name > treats a lite name as one name, not a subdomain
(pass) isSecondLevelDotName with a lite name > still treats a real subname as a subdomain
(pass) lite names on the registration path > validateDomainLabel refuses a lite name with the gateway reason
(pass) lite names on the registration path > a shape the gateway cannot issue still gets the charset error
(pass) validateExistingNameLabel > accepts a lite name
(pass) validateExistingNameLabel > accepts an ordinary label
(pass) validateExistingNameLabel > still rejects a subname and other malformed input

::endgroup::

::group::tests/unit/utils/contractInteractions.test.ts:
(pass) deriveDomainNode > matches namehashUnder(tldNode, labelhash)
(pass) deriveDomainNode > different TLDs yield different nodes for the same label
(pass) deriveDomainNode > folds a subname per label from the TLD node [1.00ms]
(pass) deriveDomainNode > agrees with viem's namehash of the fully qualified name [2.00ms]
(pass) deriveDomainNode > folds a lite personhood name beneath its numeric container (v0.7.0)
(pass) deriveDomainNode > deriveLegacyLiteNode hashes the whole lite label flat (pre-v0.7.0) [1.00ms]
(pass) deriveDomainTokenId > is uint256(node)
(pass) deriveDomainTokenId > known vector: getsome under .dot [1.00ms]
(pass) isRevertFlag matches the EVM revert bit > flags=0n → false
(pass) isRevertFlag matches the EVM revert bit > flags=1n → true
(pass) isRevertFlag matches the EVM revert bit > flags=2n → false
(pass) isRevertFlag matches the EVM revert bit > flags=3n → true
(pass) buildRevertError > empty data names both the unmapped-origin and stale-ABI causes
(pass) buildRevertError > known ABI selector decodes to the named error [4.00ms]
(pass) buildRevertError > unknown selector falls back to raw hex [1.00ms]
(pass) decodeContractRevertError > empty data includes operation context [1.00ms]
(pass) decodeContractRevertError > non-empty data decodes against the ABI [1.00ms]

::endgroup::

::group::tests/unit/account/accountHelp.test.ts:
(pass) account --help lists subcommands including is-mapped and grant [9.00ms]
(pass) account is-mapped --help shows address argument and --json [4.00ms]
(pass) account grant --help shows label argument and --json [4.00ms]

::endgroup::

::group::tests/unit/delegate/delegateHelp.test.ts:
(pass) delegate --help lists set, revoke, status, records and auth options [6.00ms]
(pass) delegate records --help shows operator argument and --revoke [5.00ms]
(pass) delegate records-status --help shows operator argument and --json [4.00ms]
(pass) delegate set --help shows name and delegate arguments [4.00ms]
(pass) delegate revoke --help shows name argument [4.00ms]
(pass) delegate status --help shows name argument and --json [4.00ms]

::endgroup::

::group::tests/unit/auth/resolveAuthSourceReadOnly.test.ts:
(pass) resolveAuthSourceReadOnly honours environment variables > $label [4.00ms]
(pass) resolveAuthSourceReadOnly honours environment variables > $label
(pass) resolveAuthSourceReadOnly honours environment variables > $label
(pass) resolveAuthSourceReadOnly honours environment variables > $label
(pass) resolveAuthSourceReadOnly honours environment variables > $label

::endgroup::

::group::tests/unit/auth/authRevert.test.ts:
(pass) auth set rejects account name with forward slash [6.00ms]
(pass) auth set rejects account name with backslash [6.00ms]
(pass) auth set rejects account name that is just a dot [5.00ms]
(pass) auth set rejects account name that is double dots [3.00ms]
(pass) auth set rejects account name starting with dot [2.00ms]
(pass) auth set rejects account name ending with dot [3.00ms]
(pass) auth set rejects account name with special characters [17.00ms]
(pass) auth set rejects account name that is too long [5.00ms]
(pass) auth use rejects non-existent account [85.00ms]
(pass) auth remove rejects non-existent account [71.00ms]

::endgroup::

::group::tests/unit/auth/authHelp.test.ts:
(pass) root help lists auth command [3.00ms]
(pass) auth help shows options and subcommands [5.00ms]
(pass) auth set help shows all options [2.00ms]
(pass) auth list help shows options [2.00ms]
(pass) auth use help shows options [2.00ms]
(pass) auth remove help shows options [2.00ms]
(pass) auth clear help shows options [2.00ms]
(pass) auth parses keystore-path option [3.00ms]
(pass) auth parses password option [2.00ms]
(pass) auth set parses account option [2.00ms]
(pass) auth set parses mnemonic option [3.00ms]
(pass) auth set parses key-uri option [2.00ms]
(pass) auth help command shows help [3.00ms]
(pass) auth help set shows set command help [3.00ms]
(pass) auth help list shows list command help [2.00ms]
(pass) auth help use shows use command help [2.00ms]
(pass) auth help remove shows remove command help [3.00ms]
(pass) auth help clear shows clear command help [3.00ms]

::endgroup::

::group::tests/unit/auth/auth.test.ts:
(pass) auth set creates keystore and stores multiple accounts [291.00ms]
(pass) auth set accepts account names with special characters [438.00ms]
(pass) auth list reports missing keystore [4.00ms]
(pass) auth list shows all accounts and auth types [283.00ms]
(pass) auth use switches default account [422.00ms]
(pass) auth remove last account clears default [75.00ms]
(pass) auth remove preserves remaining accounts and reassigns default [219.00ms]
(pass) auth clear deletes all accounts [86.00ms]
(pass) resolveAuthSource prefers selected keystore account over ambient env mnemonic [213.00ms]
(pass) resolveAuthSource resolves from env mnemonic when only the default keystore path is given [1.00ms]
(pass) resolveAuthSource prefers selected keystore account over ambient env key URI [133.00ms]
(pass) auth set rejects weak password supplied by flag for new keystore [5.00ms]
(pass) auth set rejects weak password supplied by env for new keystore [3.00ms]
(pass) resolveAuthSource default branch carries the dev credential for the retry cache [1.00ms]

::endgroup::

::group::tests/unit/primary/primaryHelp.test.ts:
(pass) primary --help lists set, status and auth options [2.00ms]
(pass) primary set --help shows name argument and --json [3.00ms]
(pass) primary status --help shows optional address argument and --json [1.00ms]

::endgroup::

::group::tests/unit/client/storageDepositLimit.test.ts:
(pass) computeStorageDepositLimit > floors at two whole tokens for 10 decimals [1.00ms]
(pass) computeStorageDepositLimit > floors at two whole tokens for 12 decimals
(pass) computeStorageDepositLimit > keeps the floor when the buffered estimate is below it
(pass) computeStorageDepositLimit > uses the estimate plus 20% once it exceeds the floor
(pass) ReviveClientWrapper token info > defaults to DEFAULT_NATIVE_TOKEN_DECIMALS and DEFAULT_NATIVE_TOKEN_SYMBOL
(pass) ReviveClientWrapper token info > rejects non-integer and negative decimals
(pass) ReviveClientWrapper token info > rejects an empty symbol
(pass) ReviveClientWrapper token info > createDotnsContext reads token info from the wrapper [3.00ms]
(pass) submitTransaction storage_deposit_limit > applies the connected chain's two-token floor [1.00ms]
(pass) submitTransaction storage_deposit_limit > derives the limit from the dry run when it exceeds the floor

::endgroup::

::group::tests/unit/client/chainTokenInfo.test.ts:
(pass) getChainTokenInfo > reads scalar properties
(pass) getChainTokenInfo > reads the first entry of array properties
(pass) getChainTokenInfo > accepts decimals encoded as a digit string
(pass) getChainTokenInfo > falls back to the defaults with a warning when properties are missing [1.00ms]
(pass) getChainTokenInfo > falls back to the default decimals for ""
(pass) getChainTokenInfo > falls back to the default decimals for null
(pass) getChainTokenInfo > falls back to the default decimals for true
(pass) getChainTokenInfo > falls back to the default decimals for -1
(pass) getChainTokenInfo > falls back to the default decimals for 1.5
(pass) getChainTokenInfo > falls back to the default decimals for "1.5"
(pass) getChainTokenInfo > falls back to the default decimals for []
(pass) getChainTokenInfo > falls back to the default symbol for an empty string

::endgroup::

::group::tests/unit/register/subnodePersist.test.ts:
(pass) registerSubnode encodes the persist flag > persists into the owner's store by default [1.00ms]
(pass) registerSubnode encodes the persist flag > skips store indexing when persist is disabled [1.00ms]

::endgroup::

::group::tests/unit/register/registrationManifest.test.ts:
(pass) registration manifest persistence > saves a record and reads it back by label [77.00ms]
(pass) registration manifest persistence > stores the sealed pricing fields losslessly as decimal strings [62.00ms]
(pass) registration manifest persistence > encrypts the secret at rest (never stored in plaintext) [64.00ms]
(pass) registration manifest persistence > decrypts the secret with the correct credential [136.00ms]
(pass) registration manifest persistence > rejects decryption with the wrong credential [141.00ms]
(pass) registration manifest persistence > lists records for the env + caller, newest commit first [125.00ms]
(pass) registration manifest persistence > isolates records by env and caller [138.00ms]
(pass) registration manifest persistence > deletes a record [63.00ms]
(pass) registration manifest persistence > returns empty when nothing is cached
(pass) registration manifest persistence > clear record selection scopes to a requested label [137.00ms]
(pass) registration manifest persistence > clear record selection errors when a requested label is missing [63.00ms]
(pass) resolveManifestCredential > prefers password, then mnemonic, then key URI [1.00ms]
(pass) resolveManifestCredential > returns null when no credential is available
(pass) resolveManifestCredential > uses env mnemonic and key URI for registration cache encryption
(pass) TLD ingested from chain > resolveTldInfo reads the deployment TLD rather than assuming .dot
(pass) TLD ingested from chain > retries a transient read failure before resolving [303.00ms]
(pass) TLD ingested from chain > the immutable TLD is cached across calls
(pass) TLD ingested from chain > does not share the cache between clients that share a controller address
(pass) TLD ingested from chain > computeDomainTokenId derives the id under the chain TLD [1.00ms]
(pass) TLD ingested from chain > formatDomainName uses the deployment TLD suffix
(pass) ensureDomainNotRegistered enforces the controller predicate > passes when available(label) is true, checking available not ownerOf
(pass) ensureDomainNotRegistered enforces the controller predicate > throws with the real TLD suffix when available(label) is false

::endgroup::

::group::tests/unit/register/registerOwnerConflicts.test.ts:
(pass) register domain rejects --owner with --transfer [5.00ms]
(pass) register domain rejects --owner with --reverse [4.00ms]
(pass) register domain rejects --owner with --governance [3.00ms]

::endgroup::

::group::tests/unit/register/registerJson.test.ts:
(pass) register domain --help shows --json option [3.00ms]
(pass) register subname --help shows --json option [2.00ms]
(pass) register domain --json emits JSON error when --transfer without --to [2.00ms]

::endgroup::

::group::tests/unit/register/registerHelp.test.ts:
(pass) root help lists register command [2.00ms]
(pass) register help shows subcommands [2.00ms]
(pass) register domain help shows options [2.00ms]
(pass) register subname help shows options [4.00ms]
(pass) register domain parses reverse flag [3.00ms]
(pass) register domain parses governance flag [3.00ms]
(pass) register domain parses owner option [2.00ms]
(pass) register domain parses transfer with destination [3.00ms]
(pass) register domain parses account option [3.00ms]
(pass) register domain parses keystore-path option [3.00ms]
(pass) register domain parses password option [2.00ms]
(pass) register domain parses mnemonic option [3.00ms]
(pass) register domain parses key-uri option [3.00ms]
(pass) register domain parses commitment-buffer option [2.00ms]
(pass) register domain parses commitment-buffer alias --cb [3.00ms]
(pass) register subname parses name and parent [3.00ms]
(pass) register subname parses owner option [2.00ms]
(pass) getCommitmentBufferSeconds defaults to 6 when env is not set
(pass) getCommitmentBufferSeconds reads from DOTNS_COMMITMENT_BUFFER env variable [1.00ms]
(pass) COMMITMENT_POLL_INTERVAL_MS is 2000
(pass) COMMITMENT_POLL_TIMEOUT_MS is 30000

::endgroup::

::group::tests/unit/pop/setPopHelp.test.ts:
(pass) root help lists pop command [3.00ms]
(pass) pop help shows commands and description [2.00ms]
(pass) pop help shows auth options [2.00ms]
(pass) pop info help shows description [3.00ms]
(pass) pop status help shows description [2.00ms]
(pass) pop info help shows auth options [2.00ms]
(pass) pop info parses auth options at pop level [2.00ms]
(pass) pop info parses auth options at info level [1.00ms]
(pass) pop help command shows pop help [2.00ms]
(pass) pop help status shows info help [2.00ms]
(pass) pop help info shows info help [2.00ms]

::endgroup::

::group::tests/unit/pop/popJson.test.ts:
(pass) pop info --help shows --json option [4.00ms]
(pass) pop status --help shows --json option [3.00ms]

::endgroup::

::group::tests/unit/lookup/lookupHelp.test.ts:
(pass) lookup --help lists subcommands and auth options [3.00ms]
(pass) lookup name --help shows label argument and options [3.00ms]
(pass) lookup owner-of --help shows label argument and options [3.00ms]
(pass) lookup transfer --help shows label argument and destination option [3.00ms]
(pass) lookup transfer parses destination at transfer level [3.00ms]
(pass) lookup transfer parses auth options at lookup level [3.00ms]

::endgroup::

::group::tests/unit/lookup/lookupNormalisation.test.ts:
(pass) lookup normalises fully-qualified names > performDomainLookup derives the same node for `alice` and `alice.paseo` [1.00ms]
(pass) lookup normalises fully-qualified names > performOwnerOfLookup derives the same node for `alice` and `alice.paseo` [1.00ms]
(pass) lookup normalises fully-qualified names > a name under a different suffix is not stripped
(pass) lite names resolve on both node schemes > a v0.7.0 lite name resolves at its folded subnode [2.00ms]
(pass) lite names resolve on both node schemes > a pre-v0.7.0 lite name falls back to its flat node
(pass) lite names resolve on both node schemes > an unregistered lite name reports the legacy node and no record [1.00ms]
(pass) lookup folds subnames per label > performDomainLookup queries the EIP-137 node of `blog.alice`
(pass) lookup folds subnames per label > `blog.alice` and `blog.alice.paseo` resolve to the same node [1.00ms]
(pass) lookup folds subnames per label > performOwnerOfLookup reads the registry owner, so a subname reports its holder
(pass) lookup folds subnames per label > performOwnerOfLookup reports an unregistered name as such [1.00ms]

::endgroup::

::group::tests/unit/escrow/escrowHelp.test.ts:
(pass) root help lists escrow command [2.00ms]
(pass) escrow help shows the subcommand description and subcommands [2.00ms]
(pass) escrow balance help describes the claimable pull-payment balance [2.00ms]
(pass) escrow positions help describes the list and total [2.00ms]
(pass) escrow status help describes the read-only position lookup [1.00ms]
(pass) escrow release help describes the approve-and-release sequence [2.00ms]
(pass) escrow redeem help describes taking a released name back [2.00ms]
(pass) escrow withdraw help describes the post-cooldown step [2.00ms]
(pass) escrow claim-withdrawal help describes the overpayment ledger [2.00ms]
(pass) escrow refunds help lists list/claim/claim-batch [1.00ms]
(pass) escrow refunds list help exposes pagination options [2.00ms]
(pass) escrow refunds claim help requires an entry id positional [2.00ms]
(pass) escrow refunds claim-batch help accepts variadic ids [1.00ms]

::endgroup::

::group::tests/unit/escrow/escrowFormatting.test.ts:
(pass) formatRefundEntryLine > marks entries past their cooldown as claimable [1.00ms]
(pass) formatRefundEntryLine > marks entries inside their cooldown window with remaining seconds [1.00ms]
(pass) formatRefundEntryLine > renders the amount in the chain's native token symbol
(pass) formatRefundEntryLine > truncates large tokenIds for terminal display
(pass) totalEscrowAmount > is zero for no positions
(pass) totalEscrowAmount > sums position amounts
(pass) isRefundableDeposit > is true only when the position holds an amount
(pass) cooldownRemainingSeconds > returns the seconds left, clamped to zero once elapsed
(pass) formatCooldown > formats seconds and minutes
(pass) formatPositionStatus > held when not released
(pass) formatPositionStatus > embeds the cooldown countdown while released and waiting
(pass) formatPositionStatus > claimable once the cooldown elapses
(pass) formatPositionStatus > claimed after withdrawal
(pass) releasePhase > held while the name is not released
(pass) releasePhase > redeemable while released, unwithdrawn and inside the window
(pass) releasePhase > awaiting when the deposit was withdrawn inside the window
(pass) releasePhase > reclaimable once the window elapses, matching the escrow's isReclaimable [1.00ms]
(pass) formatReleasePhase > names the phase and the time it changes
(pass) formatPositionsTable > returns no lines for an empty set
(pass) formatPositionsTable > renders a header plus one aligned row per position with the phase and cooldown
(pass) pendingRefunds multi-output decode > decodes to a [ids, entries] tuple [2.00ms]
(pass) pendingRefunds multi-output decode > decodes an empty ledger to a pair of empty arrays

::endgroup::

::group::tests/unit/escrow/redeem.test.ts:
(pass) redeemName refuses before the write > a name that was never released [1.00ms]
(pass) redeemName refuses before the write > a caller who is not the previous holder
(pass) redeemName refuses before the write > a closed redeem window, saying when it closed
(pass) redeemName refuses before the write > a deposit already withdrawn inside the window
(pass) redeemName refuses before the write > otherwise submits redeem for the token [1.00ms]

::endgroup::

::group::tests/unit/cli/paseoCreate3Addresses.test.ts:
(pass) paseo-v2 uses the canonical fresh-deploy address book
(pass) previewnet shares the whole paseo-v2 book
(pass) devnet keeps its own distinct deployment

::endgroup::

::group::tests/unit/cli/bulletinRpc.test.ts:
(pass) paseo-v2 default resolves to the existing bulletin RPC
(pass) explicit argument wins over env var and active env
(pass) env var wins over active env config when no explicit argument
(pass) falls back to active env's bulletin RPC
(pass) throws when nothing is configured (synthetic case)
(pass) bulletin cache Asset Hub RPC uses merged CLI rpc before DOTNS_RPC [1.00ms]
(pass) bulletin cache Asset Hub RPC uses selected environment when no rpc override exists
(pass) bulletin cache rejects custom Bulletin env override without matching target
(pass) bulletin cache accepts custom Bulletin override with explicit environment
(pass) bulletin cache custom Bulletin with DOTNS_ENV ignores stale DOTNS_RPC
(pass) bulletin cache accepts custom Bulletin override with explicit Asset Hub RPC

::endgroup::

::group::tests/unit/cli/environment.test.ts:
(pass) defaults to paseo-v2
(pass) accepts friendly paseo-v2 aliases
(pass) DOTNS_ENV selects rpc and contract set
(pass) --env takes precedence over DOTNS_ENV while --rpc only overrides endpoint
(pass) printCommandHeader emits one contextual line with version, action, target and network

::endgroup::

::group::tests/unit/cli/authOptions.test.ts:
(pass) getAuthOptions resolves a global --env given before a two-level-nested command [1.00ms]
(pass) getAuthOptions lets a command-level --env override the global one
(pass) getAuthOptions resolves the --network alias from the program root [1.00ms]

::endgroup::

::group::tests/unit/cli/qrSigner.test.ts:
⚠ The QR mobile-wallet signer is experimental and still in development; expect rough edges.
(pass) createQrSigner > throws a clear error when no global WebSocket is available [1.00ms]
⚠ The QR mobile-wallet signer is experimental and still in development; expect rough edges.
Approve the signing allowance on your phone to continue.
(pass) createQrSigner > returns the SS58 origin derived from the paired signer's public key [1.00ms]

::endgroup::

::group::tests/unit/cli/transfer.test.ts:
(pass) resolveTransferRecipient > returns a raw EVM address in checksummed form without touching the chain [1.00ms]
(pass) resolveTransferRecipient > rejects input that is neither an EVM address, SS58 address, nor domain name

::endgroup::

::group::tests/unit/cli/assertExpectedChain.test.ts:
(pass) assertExpectedChain > passes when the chain reports the environment's genesis
(pass) assertExpectedChain > fails naming both chains on a mismatch
(pass) assertExpectedChain > hash comparison is case-insensitive
(pass) assertExpectedChain > a null pinned hash skips the check [1.00ms]
(pass) assertExpectedChain > a bulletin mismatch points at the bulletin knobs
(pass) assertExpectedChain > the escape hatch bypasses the check
(pass) assertExpectedChain > a known chain is named in the error, not just hashed
(pass) assertExpectedChain > the bulletin connection is checked against the bulletin genesis
(pass) assertExpectedChain > the caller can inject the environment

::endgroup::

::group::tests/unit/cli/dotliViewUrls.test.ts:
(pass) paseo-v2 emits only its paseo.li gateway
(pass) devnet emits only its dev-dot.li gateway
(pass) previewnet emits no dot.li gateway
(pass) passes the label through unchanged, so the TLD is never duplicated

::endgroup::

::group::tests/unit/cli/signerKind.test.ts:
(pass) resolveSignerKind > defaults to keystore
(pass) resolveSignerKind > reads DOTNS_SIGNER=qr
(pass) resolveSignerKind > an explicit flag overrides the env var
(pass) resolveSignerKind > an unknown value falls back to keystore
(pass) resolveQrAppId > defaults to the unified product id
(pass) resolveQrAppId > flag beats env beats default
(pass) resolveQrPeopleEndpoints > defaults to the paseo stage
(pass) resolveQrPeopleEndpoints > resolves named stages
(pass) resolveQrPeopleEndpoints > treats a non-stage value as a comma-separated wss list
(pass) resolveQrPeopleEndpoints > rejects a non-wss URL [1.00ms]
(pass) resolveQrPeopleEndpoints > rejects an empty/blank value
(pass) resolveQrPeopleEndpoints > rejects a wss URL with embedded credentials
(pass) resolveQrPeopleEndpoints > flag beats env beats default
(pass) assertSignerOptions > keystore signer allows local-account flags
(pass) assertSignerOptions > qr signer with no local flags is allowed
(pass) assertSignerOptions > qr signer rejects a local-account flag
(pass) assertSignerOptions > qr signer lists every conflicting flag
(pass) assertSignerOptions > qr from env is also guarded [1.00ms]
(pass) assertSignerOptions > qr signer rejects a keystore secret supplied via env

::endgroup::

::group::tests/unit/content/contentJson.test.ts:
(pass) content view --help shows --json option [3.00ms]
(pass) content set --help shows --json option [2.00ms]
(pass) content set --json emits JSON error when both mnemonic and key-uri provided [2.00ms]

::endgroup::

::group::tests/unit/content/contentHelp.test.ts:
result:  {
  exitCode: 0,
  standardOutput: "Usage: dotns content [options] [command]\n\nManage domain content hashes\n\nOptions:\n  --env <environment>            DotNS environment: paseo-v2 (env: DOTNS_ENV)\n  --network <environment>        Alias for --env\n  --rpc <wsUrl>                  WebSocket RPC endpoint (env: DOTNS_RPC)\n  --keystore-path <path>         Keystore path (env: DOTNS_KEYSTORE_PATH)\n  --account <name>               Keystore account name (default: keystore\n                                 default)\n  --password <pw>                Keystore password (env:\n                                 DOTNS_KEYSTORE_PASSWORD)\n  -m, --mnemonic <phrase>        BIP39 mnemonic phrase (env: DOTNS_MNEMONIC)\n  -k, --key-uri <uri>            Substrate key URI (env: DOTNS_KEY_URI)\n  --signer <kind>                Signer: keystore (default) or qr [experimental]\n                                 (env: DOTNS_SIGNER) (default: \"keystore\")\n  --qr-app-id <id>               App id for QR pairing (env: DOTNS_QR_APP_ID)\n  --qr-people-rpc <stageOrUrls>  QR pairing relay: paseo|preview|stable or wss\n                                 URLs (env: DOTNS_QR_PEOPLE_RPC)\n  --qr-fresh                     Force a fresh QR pairing, ignoring any cached\n                                 session\n  -h, --help                     display help for command\n\nCommands:\n  view [options] <name>          View domain content hash\n  set [options] <name> <cid>     Set domain content hash (IPFS CID)\n  help [command]                 display help for command\n",
  standardError: "",
  combinedOutput: "Usage: dotns content [options] [command]\n\nManage domain content hashes\n\nOptions:\n  --env <environment>            DotNS environment: paseo-v2 (env: DOTNS_ENV)\n  --network <environment>        Alias for --env\n  --rpc <wsUrl>                  WebSocket RPC endpoint (env: DOTNS_RPC)\n  --keystore-path <path>         Keystore path (env: DOTNS_KEYSTORE_PATH)\n  --account <name>               Keystore account name (default: keystore\n                                 default)\n  --password <pw>                Keystore password (env:\n                                 DOTNS_KEYSTORE_PASSWORD)\n  -m, --mnemonic <phrase>        BIP39 mnemonic phrase (env: DOTNS_MNEMONIC)\n  -k, --key-uri <uri>            Substrate key URI (env: DOTNS_KEY_URI)\n  --signer <kind>                Signer: keystore (default) or qr [experimental]\n                                 (env: DOTNS_SIGNER) (default: \"keystore\")\n  --qr-app-id <id>               App id for QR pairing (env: DOTNS_QR_APP_ID)\n  --qr-people-rpc <stageOrUrls>  QR pairing relay: paseo|preview|stable or wss\n                                 URLs (env: DOTNS_QR_PEOPLE_RPC)\n  --qr-fresh                     Force a fresh QR pairing, ignoring any cached\n                                 session\n  -h, --help                     display help for command\n\nCommands:\n  view [options] <name>          View domain content hash\n  set [options] <name> <cid>     Set domain content hash (IPFS CID)\n  help [command]                 display help for command\n",
}
(pass) content --help lists subcommands and auth options [2.00ms]
(pass) content view --help shows name argument and options [2.00ms]
(pass) content set --help shows name and cid arguments [2.00ms]

::endgroup::

::group::tests/unit/bulletin/bulletinAuthorizer.test.ts:
(pass) bulletin authorizer default > defaults to //Eve, the seeded AllowedAuthorizers account [1.00ms]
(pass) bulletin authorizer default > is distinct from the sudo key, which stays //Alice
(pass) warnIfDevKeyOnTestnet > warns when the default authorizer is used against previewnet
(pass) warnIfDevKeyOnTestnet > stays silent on paseo-v2 even with the default authorizer
(pass) warnIfDevKeyOnTestnet > stays silent when an explicit signer overrides the default
(pass) getPreviewUrl > returns an https preview link on the environment that has a web app [1.00ms]
(pass) getPreviewUrl > returns null (never throws) on an environment with no web app

::endgroup::

::group::tests/unit/bulletin/bulletinCliHelp.test.ts:
(pass) root help lists bulletin command [2.00ms]
(pass) bulletin help shows commands and description [2.00ms]
(pass) bulletin upload help shows all options [3.00ms]
(pass) bulletin upload help shows default values [1.00ms]
(pass) bulletin authorize help shows all options [2.00ms]
(pass) bulletin authorize help shows default values [2.00ms]
(pass) bulletin history help shows options [2.00ms]
(pass) bulletin history:remove help shows usage [2.00ms]
(pass) bulletin history:clear help shows description [1.00ms]
(pass) bulletin help command shows bulletin help [1.00ms]
(pass) bulletin help upload shows upload help [2.00ms]
(pass) bulletin help authorize shows authorize help [2.00ms]
(pass) bulletin status help shows all options [2.00ms]
(pass) bulletin help status shows status help [2.00ms]
(pass) bulletin list alias works [1.00ms]
(pass) bulletin verify help shows usage [2.00ms]
(pass) bulletin help verify shows verify help [2.00ms]

::endgroup::

::group::tests/unit/bulletin/uploadManifest.test.ts:
(pass) upload manifest resume behavior > returns stale manifest when fingerprint does not match [3.00ms]
(pass) upload manifest resume behavior > deduplicates completed blocks by index [1.00ms]

::endgroup::

::group::tests/unit/bulletin/uploadProfiling.test.ts:
(pass) upload profiler > writes schema-complete profile report with peak aggregation [26.00ms]
(pass) upload profiler > default profile path is deterministic for a given fingerprint

::endgroup::

::group::tests/unit/text/textHelp.test.ts:
(pass) text --help lists subcommands and auth options [2.00ms]
(pass) text view --help shows name and key arguments [2.00ms]
(pass) text set --help shows name, key, and value arguments [4.00ms]

::endgroup::

::group::tests/unit/text/textJson.test.ts:
(pass) text view --help shows --json option [4.00ms]
(pass) text set --help shows --json option [3.00ms]
(pass) text set --json emits JSON error when both mnemonic and key-uri provided [5.00ms]

::endgroup::

 380 pass
 0 fail
 1005 expect() calls
Ran 380 tests across 42 files. [4.91s]

The release phase helpers sit with the other position-to-text helpers in
commands/escrow.ts, the time utilities in utils/formatting.ts, and the
two time-dependent asserts take nowSeconds like the rest of the file.
The two types listed the same seven struct fields by hand.
@charlesHetterich
charlesHetterich marked this pull request as ready for review September 23, 2026 03:16
Version stays 0.10.0 over main's 0.9.5.
@charlesHetterich
charlesHetterich requested a review from a team as a code owner September 23, 2026 04:35
status: formatPositionStatus(position, nowSeconds),
cooldownSeconds: cooldownRemainingSeconds(position, nowSeconds).toString(),
redeemableUntil: position.redeemableUntil.toString(),
phase: releasePhase(position, now),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The positions table shows when the deposit can be withdrawn, and it leaves out whether the name itself can still be taken back.

fix: lease also add phase to the default table at

const rows = positions.map((position) => ({
name: position.domain,
deposit: `${formatWeiAsEther(position.amount)} PAS`,
status: formatPositionStatus(position, nowSeconds),
}));
, which should be changed to

const rows = positions.map((position) => ({
  name: position.domain,
  deposit: `${formatWeiAsEther(position.amount)} PAS`,
  phase: releasePhase(position, nowSeconds),
  status: formatPositionStatus(position, nowSeconds),
}));
const phaseWidth = Math.max("PHASE".length, ...rows.map((row) => row.phase.length));
const header = `${chalk.bold("NAME".padEnd(nameWidth))}  ${chalk.bold("DEPOSIT".padEnd(depositWidth))}  ${chalk.bold("PHASE".padEnd(phaseWidth))}  ${chalk.bold("STATUS")}`;
// each row: name, deposit, phase, status

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 76bc3d4

const phase =
nowSeconds() < n.position.redeemableUntil
nowSeconds < n.position.redeemableUntil
? `redeemable by the previous holder until ${until}`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inside the window with claimed === true, releasePhase is awaiting and redeem refuses, but this error still says the previous holder may redeem. So we should check on n.position.claimed too. Add a test for the fix once applied.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 006ea18

Comment thread packages/cli/src/commands/preflight.ts Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same gap here: while the deposit is withdrawn and the window is still open, available stays false, but the text still says the name is reserved for the previous holder. So we should check on n.position.claimed too. Add a test for the fix once applied.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table reported only the deposit clock, not whether the name itself
could still be taken back.
The deposit and release-phase helpers are time-gated rules with no chain
access, used by the commands, the display layer and the preflight
asserts alike; one module gives them a single definition each.
…ster

Inside the window with the deposit withdrawn, the release refusal still
offered redemption and the register message still called the name
reserved for its previous holder. Both now branch on releasePhase.
Version stays 0.10.0 over main's 0.9.6; the positions table keeps both
the chain token symbol and the phase column.

@re-gius re-gius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@charlesHetterich
charlesHetterich merged commit 1ae7dfe into main Oct 5, 2026
27 checks passed
@charlesHetterich
charlesHetterich deleted the feat/escrow-redeem-command branch October 5, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: The CLI offers operations a name cannot support, and fails only after the user has signed

2 participants