From: 志宇 Date: Tue, 29 Oct 2024 11:46:35 +0000 (+1100) Subject: Merge bitcoindevkit/bdk#1662: fix(wallet): fix building change signers in `load_with_... X-Git-Tag: v1.0.0-beta.6~31 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/struct.DecoderReader.html?a=commitdiff_plain;h=24097d7d8a5cebd828adfed21fe344ef3e358575;p=bdk Merge bitcoindevkit/bdk#1662: fix(wallet): fix building change signers in `load_with_params` 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 --- 24097d7d8a5cebd828adfed21fe344ef3e358575