fix: address validation for duplicate input/output addresses (issue #58)#489
fix: address validation for duplicate input/output addresses (issue #58)#489harrshita123 wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 23f5c35 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
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. |
|
This pull request has been automatically closed due to inactivity for 7 days after being marked as stale. Feel free to reopen if needed! |
|
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. |
|
Will review soon |
Legend101Zz
left a comment
There was a problem hiding this comment.
Thanks for the changes, just a small nit and one question of placing test in a seperate new file
Sorry 😅 I went ahead and did the initial review — hope that’s okay :) |
No worries 😄 |
|
Updated the PR with the requested fixes.
Local checks run:
|
Legend101Zz
left a comment
There was a problem hiding this comment.
LGTM , thanks for the PR ..
@bucko13 can you do a final review when you get the chance :)
|
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. |
|
@bucko13 Could you please review this pr . |
|
Heads up @Shadouts @jpcummins |
|
@bucko13 Could you please review this pr . |
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
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