Skip to content

fix: handle MultiXPrv/MultiXPub in network kind detection and fixup#459

Open
tnull wants to merge 1 commit intobitcoindevkit:masterfrom
tnull:2026-04-fix-multixprv-network-kind
Open

fix: handle MultiXPrv/MultiXPub in network kind detection and fixup#459
tnull wants to merge 1 commit intobitcoindevkit:masterfrom
tnull:2026-04-fix-multixprv-network-kind

Conversation

@tnull
Copy link
Copy Markdown
Contributor

@tnull tnull commented Apr 24, 2026

Description

The IntoDescriptorKey impl for DescriptorSecretKey was missing a MultiXPrv match arm, causing mainnet MultiXPrv keys to fall through to the catch-all and receive test_network_kind() instead of mainnet_network_kind().

Also add MultiXPub/MultiXPrv handling to the network fixup code in descriptor/mod.rs, which previously only fixed up XPub/XPrv pairs.

Checklists

All Submissions:

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

The IntoDescriptorKey impl for DescriptorSecretKey was missing a
MultiXPrv match arm, causing mainnet MultiXPrv keys to fall through
to the catch-all and receive test_network_kind() instead of
mainnet_network_kind().

Also add MultiXPub/MultiXPrv handling to the network fixup code in
descriptor/mod.rs, which previously only fixed up XPub/XPrv pairs.

Co-Authored-By: HAL 9000
Signed-off-by: Elias Rohrer <dev@tnull.de>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 15.38462% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.05%. Comparing base (fb7681a) to head (da6c61d).
⚠️ Report is 20 commits behind head on master.

Files with missing lines Patch % Lines
src/descriptor/mod.rs 0.00% 10 Missing ⚠️
src/keys/mod.rs 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #459      +/-   ##
==========================================
+ Coverage   80.04%   80.05%   +0.01%     
==========================================
  Files          24       24              
  Lines        5336     5361      +25     
  Branches      242      243       +1     
==========================================
+ Hits         4271     4292      +21     
- Misses        987      990       +3     
- Partials       78       79       +1     
Flag Coverage Δ
rust 80.05% <15.38%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ValuedMammal ValuedMammal added the bug Something isn't working label Apr 24, 2026
@ValuedMammal ValuedMammal moved this to In Progress in BDK Wallet Apr 24, 2026
@ValuedMammal ValuedMammal added this to the Wallet 3.1.0 milestone Apr 24, 2026
Copy link
Copy Markdown
Member

@luisschwab luisschwab left a comment

Choose a reason for hiding this comment

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

ACK da6c61d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants