Skip to content

test: add integration test for consolidate unspents#223

Merged
pranishnepal merged 1 commit into
masterfrom
WCN-764/consolidateUnspents-integ-test
Jun 8, 2026
Merged

test: add integration test for consolidate unspents#223
pranishnepal merged 1 commit into
masterfrom
WCN-764/consolidateUnspents-integ-test

Conversation

@danielpeng1

Copy link
Copy Markdown
Contributor

Adds end-to-end consolidateUnspents integration tests for tbtc in local and external signing modes.

  • New consolidateUnspents.integ.test.ts where external and local suites check a 200 response (txid, tx, status, transfer), the key provider call (POST /sign vs GET /key/:pub), BitGo POST /consolidateUnspents with feeRate/maxFeeRate/minValue/txFormat, and POST /tx/send with type: 'consolidate'. Confirms tx/build is never called (consolidate goes directly to /consolidateUnspents).
  • New prebuildTx.consolidate.tbtc.json, using real PSBT from test keypairs (2 p2wsh inputs, 1 change-only output) so SDK verifyTransaction passes; tests PSBT magic bytes on key provider signablePayload.
  • Extended mockBitgoServer.ts by adding POST /consolidateUnspents route and consolidatePrebuildTx fixture slot in the coin registry (tbtc uses the new consolidate fixture; EVM coins fall back to their standard prebuild).

Also updated the accelerate integration test in similar vein, since I thought we could make my original fixture + associated test more robust.

  • Changed prebuildTx.accelerate.tbtc.json from simple emptyish stub to a full PSBT with real input/output data matching the test keypairs; accelerate.integ.test.ts gets body checks for signablePayload magic bytes, transfer shape, and cpfpTxIds/txHex on tx/send.

Tests pass (npm run docker:test:integration shown here):
Screenshot 2026-06-08 at 10 31 30 AM

Ticket: WCN-764

@danielpeng1 danielpeng1 self-assigned this Jun 8, 2026
@linear-code

linear-code Bot commented Jun 8, 2026

Copy link
Copy Markdown

WCN-764

@danielpeng1 danielpeng1 marked this pull request as ready for review June 8, 2026 15:02
@danielpeng1 danielpeng1 requested a review from a team as a code owner June 8, 2026 15:02

@vinhkhangtieu vinhkhangtieu left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

add integ test. Also need eyes from other wallet member as I need to learn more about the context of this pr

@pranishnepal pranishnepal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

@pranishnepal pranishnepal merged commit 13b86c3 into master Jun 8, 2026
21 checks passed
@pranishnepal pranishnepal deleted the WCN-764/consolidateUnspents-integ-test branch June 8, 2026 17:03
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.

3 participants