Skip to content

Validate add_foreign_utxo inputs at method boundary#944

Open
reez wants to merge 2 commits intobitcoindevkit:masterfrom
reez:fix-add
Open

Validate add_foreign_utxo inputs at method boundary#944
reez wants to merge 2 commits intobitcoindevkit:masterfrom
reez:fix-add

Conversation

@reez
Copy link
Collaborator

@reez reez commented Feb 9, 2026

Description

This PR aligns bdk-ffi TxBuilder::add_foreign_utxo with upstream bdk_wallet boundary validation behavior.

  • Validate foreign input immediately in add_foreign_utxo (instead of deferring to finish), behavior now matches method’s documented error semantics
  • Update test_add_foreign_utxo_missing_witness_data to assert failure at add_foreign_utxo and remove wallet sync/recipient setup that is no longer needed for this boundary test

Notes to the reviewers

Directly related to comment: #928 (comment)

I implemented a broader version of my original suggestion by aligning add_foreign_utxo with full upstream boundary validation, so all documented input errors are returned immediately instead of being deferred to finish().

Documentation

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing
  • I've added a changelog in the next release tracking issue (see example)
  • I've linked the relevant upstream docs or specs above

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

@reez reez marked this pull request as ready for review February 9, 2026 16:41
@reez reez requested a review from thunderbiscuit February 9, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant