Skip to content

feat: add concrete SpvClient UniFFI object#17

Merged
xdustinface merged 1 commit into
v0.42-devfrom
feat/spv-client-uniffi-v2
Mar 13, 2026
Merged

feat: add concrete SpvClient UniFFI object#17
xdustinface merged 1 commit into
v0.42-devfrom
feat/spv-client-uniffi-v2

Conversation

@xdustinface
Copy link
Copy Markdown
Owner

Summary

  • Add SpvClient UniFFI object wrapping DashSpvClient<WalletManager, PeerNetworkManager, DiskStorageManager>
  • Export lifecycle methods: new(), start(), stop(), shutdown()
  • Export state queries: is_running(), tip_height(), tip_hash(), peer_count(), sync_progress(), is_syncing()
  • Add SpvClientError uniffi::Error enum mapped from SpvError
  • Add custom_type! mappings for SocketAddr and PathBuf
  • Add #[cfg_attr(feature = "uniffi", derive(uniffi::Record))] to ClientConfig
  • Add #[cfg_attr(feature = "uniffi", derive(uniffi::Enum))] to MempoolStrategy
  • Unit tests for construction and state queries

Closes #7

@github-actions
Copy link
Copy Markdown

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 13, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 59.78261% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.95%. Comparing base (b8676c8) to head (47526b6).
⚠️ Report is 1 commits behind head on v0.42-dev.

Files with missing lines Patch % Lines
dash-spv/src/bridge/mod.rs 59.09% 36 Missing ⚠️
dash-spv/src/client/mempool.rs 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@              Coverage Diff              @@
##           v0.42-dev      #17      +/-   ##
=============================================
- Coverage      65.96%   65.95%   -0.01%     
=============================================
  Files            312      312              
  Lines          64711    64799      +88     
=============================================
+ Hits           42684    42741      +57     
- Misses         22027    22058      +31     
Flag Coverage Δ
core 75.02% <ø> (ø)
ffi 36.60% <ø> (+0.01%) ⬆️
rpc 19.92% <ø> (ø)
spv 81.19% <59.78%> (-0.14%) ⬇️
wallet 65.68% <ø> (ø)
Files with missing lines Coverage Δ
dash-spv/src/client/config.rs 92.45% <100.00%> (ø)
dash-spv/src/client/lifecycle.rs 63.46% <100.00%> (ø)
dash-spv/src/client/mempool.rs 57.57% <0.00%> (ø)
dash-spv/src/bridge/mod.rs 82.66% <59.09%> (-15.15%) ⬇️

... and 9 files with indirect coverage changes

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

- Add `#[cfg_attr(feature = "uniffi", derive(uniffi::Enum))]` to `MempoolStrategy`
- Add `#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]` to `ClientConfig`
- Change `max_mempool_transactions: usize` → `u64` for UniFFI compatibility
- Add `custom_type!` mappings for `SocketAddr` and `PathBuf` in bridge module
- Make `DashSpvClient::start()` public (was `pub(super)`)
- Implement `SpvClient` UniFFI object wrapping the concrete type
  `DashSpvClient<WalletManager<ManagedWalletInfo>, PeerNetworkManager, DiskStorageManager>`
- Export: `new()`, `start()`, `stop()`, `shutdown()`, `is_running()`,
  `tip_height()`, `tip_hash()`, `peer_count()`, `sync_progress()`, `is_syncing()`
- Add `SpvClientError` uniffi::Error enum mapped from `SpvError`
- Unit tests for construction and state queries

Closes #7

Co-authored-by: Kevin Rombach <xdustinface@users.noreply.github.com>
@xdustinface xdustinface force-pushed the feat/spv-client-uniffi-v2 branch from 2a58afc to 47526b6 Compare March 13, 2026 15:29
@xdustinface xdustinface merged commit 921b67b into v0.42-dev Mar 13, 2026
82 checks passed
@xdustinface xdustinface deleted the feat/spv-client-uniffi-v2 branch March 13, 2026 15:43
@claude claude Bot mentioned this pull request Mar 13, 2026
5 tasks
@xdustinface xdustinface restored the feat/spv-client-uniffi-v2 branch March 13, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add concrete SpvClient UniFFI object for DashSpvClient

2 participants