Skip to content

feat: add send transaction method to UniFFI bridge#44

Merged
xdustinface merged 2 commits intov0.42-devfrom
claude/issue-42-20260313-2342
Mar 14, 2026
Merged

feat: add send transaction method to UniFFI bridge#44
xdustinface merged 2 commits intov0.42-devfrom
claude/issue-42-20260313-2342

Conversation

@xdustinface
Copy link
Owner

Summary

  • Add send_transaction(raw_tx_hex) method to SpvClient
  • Add SendResult record with txid and status
  • Stub implementation (returns placeholder) until broadcast is wired
  • Bridge tests

Closes #42

Test plan

  • send_transaction returns SendResult with stub data
  • Bridge tests pass

github-actions bot and others added 2 commits March 13, 2026 23:48
Add `send_transaction(raw_tx_hex: String) -> Result<SendResult, SpvClientError>`
to the `SpvClient` UniFFI wrapper. The method:

- Decodes the hex-encoded raw transaction bytes
- Deserialises the bytes into a `dashcore::Transaction`
- Broadcasts to all connected peers via `DashSpvClient::broadcast_transaction`
- Returns a `SendResult` record containing the txid and status on success
- Returns `SpvClientError::Transaction` for invalid hex or unparseable bytes
- Returns `SpvClientError::Network` when no peers are connected

New types:
- `SendResult` UniFFI record with `txid` and `status` fields
- `SpvClientError::Transaction` variant for transaction-decode errors

Tests added for all error paths (invalid hex, invalid bytes, no peers)
and record construction/equality.

Co-authored-by: Kevin Rombach <xdustinface@users.noreply.github.com>
@codecov-commenter
Copy link

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

Codecov Report

❌ Patch coverage is 95.91837% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.65%. Comparing base (1856525) to head (0dc9083).

Files with missing lines Patch % Lines
dash-spv/src/bridge/mod.rs 95.91% 4 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@              Coverage Diff              @@
##           v0.42-dev      #44      +/-   ##
=============================================
+ Coverage      67.59%   67.65%   +0.05%     
=============================================
  Files            316      316              
  Lines          67742    67840      +98     
=============================================
+ Hits           45793    45898     +105     
+ Misses         21949    21942       -7     
Flag Coverage Δ
core 75.14% <ø> (ø)
ffi 37.80% <ø> (ø)
rpc 19.92% <ø> (ø)
spv 84.60% <95.91%> (+0.14%) ⬆️
wallet 66.40% <ø> (ø)
Files with missing lines Coverage Δ
dash-spv/src/bridge/mod.rs 91.57% <95.91%> (+1.20%) ⬆️

... and 4 files with indirect coverage changes

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

@xdustinface xdustinface merged commit 9dc7585 into v0.42-dev Mar 14, 2026
49 of 52 checks passed
@xdustinface xdustinface deleted the claude/issue-42-20260313-2342 branch March 14, 2026 00:09
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.

feat: add send transaction method to UniFFI bridge

2 participants