]> Untitled Git - bdk/commitdiff
Merge bitcoindevkit/bdk#1662: fix(wallet): fix building change signers in `load_with_...
author志宇 <hello@evanlinjin.me>
Tue, 29 Oct 2024 11:46:35 +0000 (22:46 +1100)
committer志宇 <hello@evanlinjin.me>
Tue, 29 Oct 2024 11:47:27 +0000 (22:47 +1100)
b6b767f3fc12062d6787eec8b3e1021458283985 test(wallet): check keymaps can be set when loading wallet (valued mammal)
517fb53760626ada00551716fd35dbd84ed6d48e fix(wallet): fix building change signers in `load_with_params` (valued mammal)

Pull request description:

  This fixes an issue that prevented change signers from being built when using the `keymap` method on `LoadParams`. Now we always build a `SignersContainer` with the internal keymap whenever a change descriptor is loaded. Note, the signer may still be "empty" if neither `keymap` or `extract_keys` is used.

  ### Notes to the reviewers

  Building a `SignersContainer` now happens outside of the [match statement](https://github.com/bitcoindevkit/bdk/blob/b6b767f3fc12062d6787eec8b3e1021458283985/crates/wallet/src/wallet/mod.rs#L557) in `load_with_params` which simplifies the logic such that we can interpret this area of code as "initialize a value for `change_descriptor` and optionally extend the internal keymap, returning a `LoadMismatch` error if the changeset doesn't match the expected params."

  ### Changelog notice

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### Bugfixes:

  * [x] I've added tests to reproduce the issue which are now passing

ACKs for top commit:
  evanlinjin:
    ACK b6b767f3fc12062d6787eec8b3e1021458283985

Tree-SHA512: fef2de691191e84f3e7cbe50c080cafb3b297d41e9bd493b97e45dfc1b3d77f4985c09b8fc3b398d54e22a43cf90501f6df70f8738e9b31a663efc0886f795e3


Trivial merge