Skip to content

test(sdk-coin-stx): cover PoX-5 staking builds on tstxsignet - #9865

Draft
akarath wants to merge 2 commits into
masterfrom
gopikarath/cshld-1865-bitgojs-test-cases-for-pox-5-staking-build-txns-on-tstxsignet
Draft

akarath wants to merge 2 commits into
masterfrom
gopikarath/cshld-1865-bitgojs-test-cases-for-pox-5-staking-build-txns-on-tstxsignet

Conversation

@akarath

@akarath akarath commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Ticket: CSHLD-1865 (parent epic: CSHLD-1840)

What

Test-only change extending test/unit/transactionBuilder/pox5Builder.ts with a PoX-5 Builder on tstxsignet describe block. No src/, dependency or fixture modifications.

The existing PoX-5 builder tests (SI-1486) cover the builders on tstx (chain ID 2147483648); the tstxsignet coin (Stacks Foundation staking-testnet, chain ID 1280, tx version 0x80, landed in #9843) had no staking-build coverage. wallet-platform builds PoX-5 staking transactions for tstxsignet on staging, so the serialization needs the same test depth on that coin.

Test cases (8 new)

  1. stake build — tx hex prefix 8000000500 (0x80 version + chain ID 1280); payload targets the statics stakingContractAddress (ST000000000000000000002AMW42H), contract pox-5, fn stake, 5 args (signer-manager principal, uint amount, uint cycles, uint start-burn-ht, none) with values asserted
  2. stake-update build — prefix; fn stake-update; new + old signer-manager principals, cycles-to-extend, amount-increase, none
  3. unstake build — prefix; fn unstake; single old-signer-manager principal arg
  4. register-for-bond build (L1 btc lockup + sBTC variant) — prefix; lockup responseOk/responseErr arg shapes
  5. rebuild round-trip — factory.from(rawTxHex) → build() is byte-identical for stake, unstake and register-for-bond (proves the parse path handles chain-1280 txs)
  6. factory routing — parsed stake txs route to Pox5Builder via isValidContractCall on tstxsignet statics (true), and a swapped contract address routes nowhere (false)
  7. toJson sanity — fee, nonce, 64-hex id, sender address
  8. negative — signer-manager principal without the address.contract-name shape rejects with the existing validation error

Verification

  • sdk-coin-stx unit suite: 212 passing / 0 failing (204 pre-existing baseline unchanged; all serialized fixtures byte-identical)
  • tsc and eslint clean on the touched file

Extend the PoX-5 builder tests with a tstxsignet describe block covering
the staking build flows on the staking-testnet coin (chain ID 1280,
tx version 0x80):

- stake / stake-update / unstake / register-for-bond (L1 lockup and
  sBTC) serialize with the 8000000500 tx prefix, target the statics
  stakingContractAddress and carry the expected pox-5 function args
- rebuild round-trip: from(rawTxHex) -> build is byte-identical for
  stake, unstake and register-for-bond
- factory routing: parsed stake txs route to Pox5Builder via
  isValidContractCall on tstxsignet statics
- toJson exposes fee, nonce and sender
- negative: signer-manager principal without the address.contract-name
  shape rejects with the existing validation error

Test-only change: no src/, dependency or fixture modifications.
All 204 pre-existing tests and every serialized fixture stay
byte-identical (212 passing / 0 failing).

Ticket: CSHLD-1865
@linear-code

linear-code Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

CSHLD-1865

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Unit tests are failing on Node 26.x (Current release line, non-blocking). This is not an LTS version yet, so it does not block merge, but it signals an incompatibility to fix before Node 26.x becomes LTS.

View run

Add wallet-creation coverage to the tstxsignet suite:
- the coin generates wallet keypairs (xpub/xprv triples)
- a derived wallet address is a valid testnet ST... address
- a Wallet binds to the tstxsignet coin (mirrors the wallet data the
  API returns for a created wallet)
- testnet wallet address validation accepts ST... forms

Ticket: CSHLD-1865

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant