Skip to content

test(express): end-to-end tests for address/derive endpoint#9032

Closed
rajangarg047 wants to merge 1 commit into
masterfrom
rajangarg047/wcn-918-e2e-derive-address
Closed

test(express): end-to-end tests for address/derive endpoint#9032
rajangarg047 wants to merge 1 commit into
masterfrom
rajangarg047/wcn-918-e2e-derive-address

Conversation

@rajangarg047

Copy link
Copy Markdown
Contributor

Summary

End-to-end tests for POST /api/v2/{coin}/address/derive that exercise the real coin derivation through the HTTP endpoint — no mocks. (The unit tests in deriveAddress.ts stub coin.deriveAddress; these don't.)

For each Phase 1 wallet kind, the test asserts the endpoint returns the exact known-good address, and that the endpoint-derived address round-trips through isWalletAddress:

  • SOL (EdDSA MPC): exact address + derive→verify round-trip
  • ETH (secp256k1 MPC): exact address; legacy forwarder versions (1/2/4) surface as a 500 (Stage C not yet implemented)
  • BTC (UTXO multisig): exact legacy P2SH (34TTD5…) + bech32 P2WSH (bc1qjpz…) + round-trip

Context

WCN-918, rescoped: per-coin derivation + derive→verify round-trips already shipped as unit tests within the coin PRs (#9016/#9017/#9018) and the endpoint codec/integration tests shipped with the endpoint (#9013). The only genuine gap was an end-to-end test that drives real derivation through the live endpoint rather than a mocked coin — that's what this adds. Stage C (ETH forwarder, WCN-932) tests will follow with that implementation.

All Phase 1 derivation (WCN-912–917, 914) is merged to master.

Test plan

  • 7 e2e tests pass (BITGOJS_TEST_PASSWORD=test mocha)
  • eslint clean (prettier-formatted)
  • CI

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Jun 16, 2026

Copy link
Copy Markdown

WCN-918

@rajangarg047 rajangarg047 marked this pull request as draft June 16, 2026 14:32
Exercise the real coin derivation through POST /api/v2/{coin}/address/derive with
no mocks (the unit tests stub coin.deriveAddress). Asserts the endpoint returns the
exact known-good address for each Phase 1 wallet kind and that the derived address
round-trips through isWalletAddress:

- SOL (EdDSA MPC): exact address + derive->verify round-trip
- ETH (secp256k1 MPC): exact address; legacy forwarder versions surface as 500
- BTC (UTXO multisig): exact legacy P2SH + bech32 P2WSH + round-trip

WCN-918

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rajangarg047 rajangarg047 force-pushed the rajangarg047/wcn-918-e2e-derive-address branch from 17cd415 to 758a195 Compare June 16, 2026 14:47
@rajangarg047

Copy link
Copy Markdown
Contributor Author

Closing — this introduced an end-to-end test pattern that doesn't exist anywhere else in the repo (real cross-package coin derivation through the endpoint, coupling the express test to the built dist of 6 packages). The repo convention is to mock the coin at the route layer.

The coverage is already in place idiomatically: real derivation + derive→verify round-trips are unit-tested in each coin package (#9016/#9017/#9018), and the endpoint wiring/validation is covered by the mocked integration test in #9013. WCN-918 is resolved as covered by those.

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