From: 志宇 Date: Wed, 14 Aug 2024 08:09:09 +0000 (+0000) Subject: Merge bitcoindevkit/bdk#1533: [wallet] Enable support for single descriptor wallets X-Git-Tag: v1.0.0-beta.2~11 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/blockdata/transaction/struct.Version.html?a=commitdiff_plain;h=76aec62cea852344b1113228645a00413c7fcba9;p=bdk Merge bitcoindevkit/bdk#1533: [wallet] Enable support for single descriptor wallets 13e7008f00b77802481733eb74daf38f48a2faef doc(wallet): clarify docs for `Wallet::load` (valued mammal) 3951110bb596d56a30ddc4cf09903cee4eebedea fix(wallet)!: Change method `LoadParams::descriptors` (valued mammal) b8027147056bf78beab5e1c606d7fd93c2a57872 example(wallet): simplify miniscript compiler example (valued mammal) 2ca8b6ff73308c3852f454579206f3a234790ce9 test(wallet): Add tests for single descriptor wallet (valued mammal) 31f1c2d665363137e6a2d9fda3ae4ed2532d680b fix(wallet): Change FromSql type to `Option<_>` (valued mammal) 75155b7dc0bb7dfee9046d323fb87b0f8e0321c1 feat(wallet): Add method `Wallet::create_single` (valued mammal) Pull request description: The change descriptor is made optional, making this an effective reversion of #1390 and enables creating wallets with a single descriptor. fixes #1511 ### Notes to the reviewers PR 1390 also removed an error case [`ChangePolicyDescriptor`](https://github.com/bitcoindevkit/bdk/blob/8eef350bd08057acc39b6fc50b1217db5e29b968/crates/wallet/src/wallet/mod.rs#L1529-L1533) and this can possibly be added back. In the case the wallet only has a single descriptor we allow any utxos to fund a tx that aren't specifically marked unspendable regardless of the change spend policy. ### Changelog notice * Added method `Wallet::create_single` that expects a single `D: IntoWalletDescriptor` as input and enables building a wallet with no internal keychain. ### 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 #### New Features: * [x] This pull request breaks the existing API * [x] I've added tests for the new feature * [x] I've added docs for the new feature ACKs for top commit: evanlinjin: ACK 13e7008f00b77802481733eb74daf38f48a2faef Tree-SHA512: 3e6fe5d9165d62332ac1863ec769c4bc5c7cd3c7f3fbdb8f505906bcdc681fa73b3fef2571adb0e52e9a23d4257f66a6145838b90ec68596b5f4c64054a047fa --- 76aec62cea852344b1113228645a00413c7fcba9