Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

This PR adds optional expected outputs support and fixes several issues in
address handling and transaction parsing:

  • Add optional flag to ExpectedOutput type for outputs that can be excluded
  • Normalize address comparison in parseOutput for accurate matching
  • Fix handling of allowExternalChangeAddress parameter in transaction verification
  • Move toCanonicalTransactionRecipient to parseTransaction module
  • Add missing override keyword to preprocessBuildParams method
  • Move outputDifference tests to correct directory

Issue: BTC-2962

OttoAllmendinger and others added 6 commits January 27, 2026 17:19
Move outputDifference test file from transaction/descriptor/ to
transaction/ directory to match the source file location structure.

Issue: BTC-2962

Co-authored-by: llm-git <llm-git@ttll.de>
The `preprocessBuildParams` method was missing the `override` keyword,
which is now added to correctly indicate that this method overrides
a method from the parent class.

Issue: BTC-2962

Co-authored-by: llm-git <llm-git@ttll.de>
…saction

Move toCanonicalTransactionRecipient out of the AbstractUtxoCoin class into
the parseTransaction module where it's used, removing it from the public API.

Issue: BTC-2962

Co-authored-by: llm-git <llm-git@ttll.de>
When comparing addresses, normalize them to a standard script format to ensure
accurate matching regardless of address representation.

We can now pass `txParams.txRecipients` to `parseOutputs`. It previously passed
`expectedOutputs`, which did multiple things at once:

- Normalize the address format for comparison (which is what we wanted)
- Append the changeAddress in certain cases (which is not desired in
  parseOutput)

This allows us to change the `toExpectedOutputs` function.

Issue: BTC-2962

Co-authored-by: llm-git <llm-git@ttll.de>
Add optional flag to ExpectedOutput type for outputs that can be excluded.
Update output difference logic to filter non-optional outputs when
determining missing outputs.

Issue: BTC-2962

Co-authored-by: llm-git <llm-git@ttll.de>
Fix the way we handle `allowExternalChangeAddress` when verifying
transactions with external change addresses. Use the new ExpectedOutput
interface to mark the change address as optional, as it's not required
to exist in the transaction.

Issue: BTC-2962

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2962.fix-external-change-addr-expected branch from 72db9aa to d79d95a Compare January 27, 2026 16:21
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review January 27, 2026 16:52
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner January 27, 2026 16:52
@OttoAllmendinger OttoAllmendinger merged commit 09fae9c into master Jan 27, 2026
21 checks passed
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.

4 participants