Skip to content

test: add sendMany integration tests: btc and eth#217

Merged
pranishnepal merged 1 commit into
masterfrom
WCN-680
Jun 2, 2026
Merged

test: add sendMany integration tests: btc and eth#217
pranishnepal merged 1 commit into
masterfrom
WCN-680

Conversation

@pranishnepal
Copy link
Copy Markdown
Contributor

@pranishnepal pranishnepal commented Jun 2, 2026

What

Adds end-to-end sendMany integration tests covering the 2×2 matrix of coin (tbtc, hteth) × signing mode (local, external).

External signing tests validate that AWM correctly delegates to the key provider: POST /sign is called with the raw PSBT for BTC, and with an operationHash for ETH.

Local signing tests seed the mock key provider with a deterministic xprv so AWM can retrieve it via GET /key/:pub and sign the PSBT using coin.signTransaction() internally.

Ticket: WCN-680

Testing

Purely a test setup, verified with npm run docker:test:integration + this CI

integration-tests-1  |   Generate wallet: LOCAL signing
integration-tests-1  | BitGo SDK env not set - defaulting to test at test.bitgo.com.
integration-tests-1  |     ✔ generates a tbtc onchain wallet end-to-end (157ms)
integration-tests-1  | 
integration-tests-1  |   Generate wallet: EXTERNAL signing
integration-tests-1  |     ✔ generates a tbtc onchain wallet — key provider generates keys (external signing mode) (50ms)
integration-tests-1  | 
integration-tests-1  |   Integration Test — health checks
integration-tests-1  |     ✔ AWM /ping returns 200
integration-tests-1  |     ✔ MBE /advancedwallet/ping returns 200
integration-tests-1  | 
integration-tests-1  |   Send many: EXTERNAL signing
integration-tests-1  | unsigned keys obtained online are being used for address verification
integration-tests-1  |     ✔ signs and submits a tbtc sendMany transaction via external key provider (108ms)
integration-tests-1  | 
integration-tests-1  |   Send many: EXTERNAL signing (hteth — operation hash flow)
integration-tests-1  |     ✔ signs and submits an hteth sendMany via operation hash (45ms)
integration-tests-1  | 
integration-tests-1  |   Send many: LOCAL signing (tbtc)
integration-tests-1  | unsigned keys obtained online are being used for address verification
integration-tests-1  |     ✔ signs a tbtc sendMany locally using the stored xprv (55ms)
integration-tests-1  | 
integration-tests-1  |   Send many: LOCAL signing (hteth)
integration-tests-1  |     ✔ signs an hteth sendMany locally using the stored xprv
integration-tests-1  | 
integration-tests-1  | 
integration-tests-1  |   8 passing

Adds four end-to-end sendMany integration tests covering the 2×2 matrix
of coin (tbtc, hteth) × signing mode (local, external).

External signing tests validate that AWM correctly delegates to the key
provider — POST /sign is called with the raw PSBT for BTC, and with an
operationHash for ETH.

Local signing tests seed the mock key provider with a deterministic xprv
so AWM can retrieve it via GET /key/:pub and sign the PSBT using
coin.signTransaction() internally.

Ticket: WCN-680
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 2, 2026

WCN-680

@pranishnepal pranishnepal marked this pull request as ready for review June 2, 2026 15:44
@pranishnepal pranishnepal requested a review from a team as a code owner June 2, 2026 15:44
@pranishnepal pranishnepal requested a review from rajangarg047 June 2, 2026 15:44
@rajangarg047
Copy link
Copy Markdown

@claude

Copy link
Copy Markdown

@vinhkhangtieu vinhkhangtieu left a comment

Choose a reason for hiding this comment

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

add integration test

@@ -0,0 +1,3 @@
{
"height": 800000
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.

nit - i'd like for this to represent more complete block data. even if all that's required is height a full btc block might be nice here

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.

will look into that

@@ -0,0 +1,14 @@
{
"transfer": {
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.

same for the transfers, something that looks a bit more like our full transfer object might be nice

Copy link
Copy Markdown
Contributor

@margueriteblair margueriteblair left a comment

Choose a reason for hiding this comment

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

looks good, had some nits but those can be done in follow up

@pranishnepal pranishnepal merged commit f39497d into master Jun 2, 2026
21 checks passed
@pranishnepal pranishnepal deleted the WCN-680 branch June 2, 2026 17:18
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.

5 participants