test(express): end-to-end tests for address/derive endpoint#9032
Closed
rajangarg047 wants to merge 1 commit into
Closed
test(express): end-to-end tests for address/derive endpoint#9032rajangarg047 wants to merge 1 commit into
rajangarg047 wants to merge 1 commit into
Conversation
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>
17cd415 to
758a195
Compare
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. |
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.
Summary
End-to-end tests for
POST /api/v2/{coin}/address/derivethat exercise the real coin derivation through the HTTP endpoint — no mocks. (The unit tests inderiveAddress.tsstubcoin.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:34TTD5…) + bech32 P2WSH (bc1qjpz…) + round-tripContext
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
BITGOJS_TEST_PASSWORD=test mocha)eslintclean (prettier-formatted)🤖 Generated with Claude Code