test: add integration test for consolidate unspents#223
Merged
Conversation
vinhkhangtieu
approved these changes
Jun 8, 2026
vinhkhangtieu
left a comment
There was a problem hiding this comment.
add integ test. Also need eyes from other wallet member as I need to learn more about the context of this pr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds end-to-end consolidateUnspents integration tests for tbtc in local and external signing modes.
consolidateUnspents.integ.test.tswhere external and local suites check a 200 response (txid,tx,status,transfer), the key provider call (POST/signvs GET/key/:pub), BitGo POST/consolidateUnspentswithfeeRate/maxFeeRate/minValue/txFormat, and POST/tx/sendwithtype: 'consolidate'. Confirms tx/build is never called (consolidate goes directly to/consolidateUnspents).prebuildTx.consolidate.tbtc.json, using real PSBT from test keypairs (2 p2wsh inputs, 1 change-only output) so SDKverifyTransactionpasses; tests PSBT magic bytes on key providersignablePayload.mockBitgoServer.tsby addingPOST /consolidateUnspentsroute andconsolidatePrebuildTxfixture slot in the coin registry (tbtcuses 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.
prebuildTx.accelerate.tbtc.jsonfrom simple emptyish stub to a full PSBT with real input/output data matching the test keypairs;accelerate.integ.test.tsgets body checks forsignablePayloadmagic bytes,transfershape, andcpfpTxIds/txHexon tx/send.Tests pass (npm run docker:test:integration shown here):

Ticket: WCN-764