Skip to content

Conversation

@sdmg15
Copy link

@sdmg15 sdmg15 commented Dec 15, 2025

Description

This PR as a new function to the wallet API public_key_at_index(keychain, index) which returns the public key found at the specified index. It closes #209

Notes to the reviewers

I explicitly matched all arms branches of the Descriptor<DefiniteDescriptorKey> so that if a new type is added in the future it signals there is a need to update this function too.

Changelog notice

  • Add a helper function public_key_at_index(keychain, index) which returns the public key found at the specified index.

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 88.37209% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.26%. Comparing base (bec219a) to head (7ac497f).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
src/wallet/mod.rs 88.37% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #355      +/-   ##
==========================================
+ Coverage   85.24%   85.26%   +0.01%     
==========================================
  Files          23       23              
  Lines        8230     8273      +43     
==========================================
+ Hits         7016     7054      +38     
- Misses       1214     1219       +5     
Flag Coverage Δ
rust 85.26% <88.37%> (+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.

@sdmg15 sdmg15 marked this pull request as ready for review December 24, 2025 08:57
Copy link

@AdamuAbba AdamuAbba left a comment

Choose a reason for hiding this comment

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

tACK 7ac497f

Ran the test locally and it was successful.
Screenshot 2026-01-16 at 4 01 28 PM

use crate::test_utils::insert_tx;

#[test]
fn test_generate_publick_keys() {

Choose a reason for hiding this comment

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

minor typo in function name k in public

Suggested change
fn test_generate_publick_keys() {
fn test_generate_public_keys() {

@ValuedMammal ValuedMammal added the new feature New feature or request label Jan 16, 2026
@ValuedMammal ValuedMammal added this to the Wallet 3.0.0 milestone Jan 16, 2026
@ValuedMammal ValuedMammal moved this to In Progress in BDK Wallet Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Add deriving public keys from wallet

3 participants