Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wallet)!: Simplify SignOptions and improve finalization logic #1476

Merged

Conversation

ValuedMammal
Copy link
Contributor

Rather than comingle various SignOptions with the finalization step, we simply clear all fields when finalizing as per the PSBT spec in BIPs 174 and 371 which is more in line with user expectations.

Notes to the reviewers

I chose to re-implement some parts of finalize_input since it's fairly straightforward, see also #1461 (comment). I had to refactor some wallet tests but didn't go out of my way to add additional tests.

closes #1461

Changelog notice

  • Removed field remove_partial_sigs from SignOptions
  • Removed field remove_taproot_extras from SignOptions

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

Copy link
Contributor

@storopoli storopoli left a comment

Choose a reason for hiding this comment

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

Concept ACK.

Nice trick with mem::take.

Copy link
Member

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

ACK ee8d410

Just a small nit lol

crates/wallet/src/wallet/mod.rs Outdated Show resolved Hide resolved
Rather than comingle various `SignOptions` with the finalization
step, we simply clear all fields when finalizing as per the PSBT
spec in BIPs 174 and 371 which is more in line with user
expectations.
Copy link
Member

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

re-ACK 996605f

@evanlinjin evanlinjin merged commit e406675 into bitcoindevkit:master Jun 20, 2024
12 checks passed
@ValuedMammal ValuedMammal deleted the fix/wallet-finalize-psbt branch June 20, 2024 16:54
@notmandatory notmandatory mentioned this pull request Jul 20, 2024
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

wallet: finalize_psbt should clear BIP32 derivations
4 participants