Skip to content

Refactor bdk-cli structure #278

Open
tvpeter wants to merge 8 commits intobitcoindevkit:masterfrom
tvpeter:refactor/restructure-project
Open

Refactor bdk-cli structure #278
tvpeter wants to merge 8 commits intobitcoindevkit:masterfrom
tvpeter:refactor/restructure-project

Conversation

@tvpeter
Copy link
Copy Markdown
Collaborator

@tvpeter tvpeter commented Apr 21, 2026

Description

This PR restructures the bdk-cli codebase to move away from a monolithic handling model towards a modular architecture. The primary goal is to improve code readability, simplify the addition of new features, and decouple core logic into smaller modules.

Notes to the reviewers

This PR introduces new subdirectories under src:
src/
|---- commands/ # all command structures
|---- config/ # Wallet configuration related operations
|---- handlers/ # subdirectory for all command handlers
|---- backend/ # all blockchain backends
|----- utils/ # general helpers
|----- main.rs # entry point

Changelog notice

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

tvpeter added 8 commits April 21, 2026 11:01
- move all blockchain clients code into the
backend subdirectory
- move commands.rs content into commands
subdirectory
- split util fns into `descriptors` and `common`
- move persister into wallet subdirectory
- update imports in payjoin module
- split handlers into top level commands config,
key and descriptors
- move handler fns into offline, online, wallets
modules
- split handler fns into repl
- add entry point to the handlers subdir
- add wallet subdir entry point
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 3.29523% with 1438 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.24%. Comparing base (07fd32f) to head (9e03351).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/handlers/offline.rs 0.00% 407 Missing ⚠️
src/utils/descriptors.rs 0.00% 198 Missing ⚠️
src/handlers/online.rs 0.00% 191 Missing ⚠️
src/handlers/mod.rs 7.04% 132 Missing ⚠️
src/utils/common.rs 0.00% 123 Missing ⚠️
src/handlers/config.rs 0.00% 83 Missing ⚠️
src/backend/mod.rs 0.00% 77 Missing ⚠️
src/handlers/repl.rs 0.00% 61 Missing ⚠️
src/handlers/descriptor.rs 0.00% 57 Missing ⚠️
src/handlers/key.rs 43.82% 50 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff            @@
##           master    #278      +/-   ##
=========================================
- Coverage   11.13%   7.24%   -3.90%     
=========================================
  Files           8      18      +10     
  Lines        2488    2389      -99     
=========================================
- Hits          277     173     -104     
- Misses       2211    2216       +5     
Flag Coverage Δ
rust 7.24% <3.29%> (-3.90%) ⬇️

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.

@tvpeter tvpeter marked this pull request as ready for review April 21, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant