Skip to content

e2e: Add test for testing different address types#470

Open
Abhay349 wants to merge 1 commit intocaravan-bitcoin:mainfrom
Abhay349:b3
Open

e2e: Add test for testing different address types#470
Abhay349 wants to merge 1 commit intocaravan-bitcoin:mainfrom
Abhay349:b3

Conversation

@Abhay349
Copy link

@Abhay349 Abhay349 commented Feb 8, 2026

What kind of change does this PR introduce?

  • Test improvement / E2E test coverage

Issue Number:

Fixes subtask of #442

If relevant, did you update the documentation?

  • Not applicable (test-only change)

Summary
This PR adds, parameterized end-to-end tests to validate different wallet address types in the Caravan coordinator.

Previously, E2E tests mainly covered the default address behavior. This change ensures comprehensive coverage for:

P2WSH (Native SegWit): Verifies correct address generation (bcrt1q...) and fund reception.
P2SH-P2WSH (Nested SegWit): Verifies correct address generation (2...) and fund reception.
P2TR (Taproot): Test scaffold included but currently skipped.
For each active type, the test validates:

  1. Importing a wallet configuration specific to that address type.
  2. Verifying the generated receive address matches the expected regex format.
  3. Confirming the wallet can receive a transaction (verified by the address path index incrementing locally).

Does this PR introduce a breaking change?

-No

Checklist

  • I have tested my changes thoroughly.
  • I have added or updated tests to cover my changes (if applicable).
  • I have verified that test coverage meets or exceeds 95% (if applicable).
  • I have run the test suite locally, and all tests pass.
  • I have written tests for all new changes/features
  • I have followed the project's coding style and conventions.
  • I have created a changeset to document my changes (npm run changeset)

Other information

P2TR (Taproot) skipped: The P2TR test case is explicitly marked as skip: true. Investigation into
caravan-bitcoin/src/types/addresses.tsrevealed that while P2TR is defined as a valid
MultisigAddressType, it is currently commented as "not able to be used anywhere yet". The test is preserved to enable immediate verification once support is fully implemented in the underlying package.

All coordinator E2E tests (P2WSH and P2SH-P2WSH) pass locally using the Docker-based setup.

Have you read the contributing guide?

Yes

@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2026

⚠️ No Changeset found

Latest commit: d2e1e71

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
caravan-coordinator Ready Ready Preview, Comment Feb 10, 2026 1:17pm

Request Review

Copy link
Contributor

@Legend101Zz Legend101Zz left a comment

Choose a reason for hiding this comment

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

just a minor comment , and rest it looks really good to me , can you please also attach a screenshot of the working e2e test ? Thanks

{
type: "P2SH-P2WSH",
label: "Nested SegWit (P2SH-P2WSH)",
regex: /^2[MN][a-zA-Z0-9]{33}$/
Copy link
Contributor

Choose a reason for hiding this comment

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

question here , Base58 addresses (like P2SH) are not fixed length. While they are usually 35 characters, they can technically be 33 or 34 characters depending on the number of leading zeros in the hash. maybe Loosen the length requirement and refine the allowed characters ?

Copy link
Author

Choose a reason for hiding this comment

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

I agree and that makes sense, I will loosen regex to avoid enforcing a strict length.
I’m planning to change it to something like:

     /^2[1-9A-HJ-NP-Za-km-z]{30,40}$/

so that we can validate structure without assuming an exact length, let me know if it looks good.
Thanks for guidance :)

@Abhay349
Copy link
Author

Screenshot 2026-02-10 at 18 41 45 Screenshot 2026-02-10 at 18 41 20 Screenshot 2026-02-10 at 18 40 12

Signed-off-by: Abhay349 <pandeyabhay967@gmail.com>
@Abhay349
Copy link
Author

Hi @Legend101Zz I have attached screenshots of working e2e tests and also updated the regex for P2SH-P2WSH.
Let me know if there are issues, happy to iterate on further feedback.
Thanks :)

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.

2 participants