Skip to content

feat: wire get_transactions to wallet transaction history#49

Merged
xdustinface merged 1 commit intov0.42-devfrom
claude/issue-47-20260314-0024
Mar 14, 2026
Merged

feat: wire get_transactions to wallet transaction history#49
xdustinface merged 1 commit intov0.42-devfrom
claude/issue-47-20260314-0024

Conversation

@xdustinface
Copy link
Owner

Closes #47

Wires the three stub methods in the UniFFI bridge to real wallet data:

  • get_transactions(limit, offset): reads wallet transaction history, sorts newest-first, applies pagination
  • get_transaction(txid): finds a single transaction by txid string
  • get_transaction_count(): returns total transaction count across all wallets
  • Helper transaction_record_to_info maps TransactionRecord fields to TransactionInfo bridge type

…o wallet data

- Import WalletInfoInterface trait and TransactionRecord type
- Add transaction_record_to_info() helper that maps TransactionRecord fields
  to the TransactionInfo bridge type (amount, fee, confirmations, timestamp,
  is_incoming from net_amount sign)
- Implement get_transactions(): collects from all wallet infos, sorts by
  timestamp descending, applies limit/offset pagination
- Implement get_transaction(): searches all wallet infos by txid string
- Implement get_transaction_count(): returns total across all wallet infos
- Update existing stub tests' docstrings to reflect actual empty-wallet semantics
- Add test_get_transactions_returns_wallet_data: end-to-end wiring test that
  creates a wallet, inserts two transaction records directly, and asserts count,
  ordering, pagination, direction flags, and lookup-by-txid all work
- Add test_transaction_record_to_info_mapping: unit test for the helper covering
  confirmations computation, fee mapping, and is_incoming flag

Closes #47

Co-authored-by: Kevin Rombach <xdustinface@users.noreply.github.com>
@xdustinface xdustinface merged commit 4cd8bec into v0.42-dev Mar 14, 2026
51 of 52 checks passed
@xdustinface xdustinface deleted the claude/issue-47-20260314-0024 branch March 14, 2026 00:53
@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 96.69421% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.62%. Comparing base (9dc7585) to head (2ce017c).
⚠️ Report is 3 commits behind head on v0.42-dev.

Files with missing lines Patch % Lines
dash-spv/src/bridge/mod.rs 96.69% 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      #49      +/-   ##
=============================================
- Coverage      72.89%   67.62%   -5.27%     
=============================================
  Files            287      316      +29     
  Lines          57630    68059   +10429     
=============================================
+ Hits           42010    46028    +4018     
- Misses         15620    22031    +6411     
Flag Coverage Δ
core 75.14% <ø> (ø)
ffi 37.22% <ø> (?)
rpc 19.92% <ø> (ø)
spv 84.62% <96.69%> (+0.21%) ⬆️
wallet 66.40% <ø> (ø)
Files with missing lines Coverage Δ
dash-spv/src/bridge/mod.rs 91.09% <96.69%> (-0.48%) ⬇️

... and 32 files with indirect coverage changes

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

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: wire get_transactions to wallet transaction history

2 participants