Skip to content

fix: address validation for duplicate input/output addresses (issue #58)#489

Open
harrshita123 wants to merge 1 commit intocaravan-bitcoin:mainfrom
harrshita123:fix/build-errors-and-issue-58
Open

fix: address validation for duplicate input/output addresses (issue #58)#489
harrshita123 wants to merge 1 commit intocaravan-bitcoin:mainfrom
harrshita123:fix/build-errors-and-issue-58

Conversation

@harrshita123
Copy link
Copy Markdown

What kind of change does this PR introduce?

Bugfix

Issue Number:

Fixes #58

Summary

Previously, address validation was only performed when an output was modified. This caused a sync issue: if an output was added first and a matching input was added later, the "duplicate address" error wouldn't show up because the reducer didn't re-validate the existing outputs against the new input list.

This PR centralizes validation into a validateOutputAddress helper and ensures that validateTransaction re-checks all current outputs every time inputs are updated.

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

A new test file apps/coordinator/src/reducers/transactionReducer_repro.test.js was added to specifically verify the "output before input" scenario and prevent regressions.

Have you read the contributing guide?

Yes

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 27, 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 27, 2026 10:30pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 27, 2026

⚠️ No Changeset found

Latest commit: 0918ebd

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 4, 2026

This pull request has been inactive for 30 days and has been marked as stale. It will be closed in 7 days if no further activity occurs. To keep this PR open, add the "long-lived" label or comment on it.

@github-actions github-actions Bot added the stale label Apr 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically closed due to inactivity for 7 days after being marked as stale. Feel free to reopen if needed!

@github-actions github-actions Bot closed this Apr 11, 2026
@bucko13 bucko13 reopened this Apr 14, 2026
@bucko13 bucko13 removed the stale label Apr 14, 2026
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.

Bug: possible to construct a transaction with an output equal to an input

2 participants