|
Ran
|
Jobs
1
|
Files
22
|
Run time
1min
|
Badge
README BADGES
|
push
github
Merge bitcoindevkit/bdk_wallet#275: Multipath descriptor support (BIP 389) da0b57713 Update wallet/src/wallet/params.rs (Andreas Schjønhaug) 9e3adf229 feat(wallet): add multipath descriptor support for two-path descriptors (Andreas Schjønhaug) Pull request description: ### Description #### Key Features: - New API: `Wallet::create_multipath(descriptor)` following the same pattern as `create()` and `create_single()` - [BIP 389](https://github.com/bitcoin/bips/blob/master/bip-0389.mediawiki) compliance with exactly 2-path validation (receive and change) - Robust validation with clear error messages - Pattern consistency with existing wallet creation methods #### Usage Example: ```rust let multipath_desc = "wpkh([9a6a2580/84'/1'/0']tpub.../‹0;1›/*)"; let wallet = Wallet::create_multipath(multipath_desc) .network(Network::Testnet) .create_wallet_no_persist()?; // Automatically creates separate receive and change descriptors let receive_addr = wallet.peek_address(KeychainKind::External, 0); // Uses path /0/* let change_addr = wallet.peek_address(KeychainKind::Internal, 0); // Uses path /1/* ``` ### Notes to the reviewers #### Design Decisions: 1. Pattern Consistency: Uses `make_multipath_descriptor_to_extract()` helper following the same pattern as existing `make_descriptor_to_extract()` function 2. Lazy Evaluation: Descriptor parsing only happens when needed during wallet creation, not during parameter setup - this maintains performance and follows Rust's lazy evaluation patterns 3. Strict Validation: Only allows exactly 2-path multipath descriptors to ensure proper receive/change separation 4. API Consistency: The `create_multipath()` method returns `CreateParams` just like `create()` and `create_single()`, maintaining the fluent builder pattern #### Implementation Notes: - The function calls `make_multi... (continued)
80 of 82 new or added lines in 4 files covered. (97.56%)
6655 of 7841 relevant lines covered (84.87%)
3496.34 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 1 |
6.67 |
0.0% | wallet/src/descriptor/error.rs |
| 1 |
88.36 |
-0.08% | wallet/src/descriptor/mod.rs |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 16656352974.1 | 22 |
84.87 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|