Refactor bdk-cli structure #278
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #278 +/- ##
=========================================
- Coverage 10.96% 8.35% -2.62%
=========================================
Files 8 20 +12
Lines 2526 2383 -143
=========================================
- Hits 277 199 -78
+ Misses 2249 2184 -65
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- 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
- add trait for formatting outputs - add types for presenting data to the output - refactor offline mod to use types
- add types for descriptor, key and wallets mods
- add simple table helper fn for creating tables - refactor types to use simple table helper - add type defs for key, wallets and descriptors
- rebase master for bip322 feature - update types to use simple table helper
8fc06d8 to
2ce28b2
Compare
|
concept ACK, this is a big change might be a good idea to do a live walk through some time on discord to help with the review process. |
Alright, anytime we are chanced. Also, I would want most of the PRs to get in before this one because it will be challenging for others to rebase and fix conflicts. |
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
Also,
FormatOutputtrait is added to format outputs (both JSON and tabular), which is implemented by alltypespresenting data response to the user. Below are the handler modules that will use the introduced types:Changelog notice
Checklists
All Submissions:
cargo fmtandcargo clippybefore committing