feat: wire get_transactions to wallet transaction history#49
Merged
xdustinface merged 1 commit intov0.42-devfrom Mar 14, 2026
Merged
feat: wire get_transactions to wallet transaction history#49xdustinface merged 1 commit intov0.42-devfrom
xdustinface merged 1 commit intov0.42-devfrom
Conversation
…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>
|
Codecov Report❌ Patch coverage is
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
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 paginationget_transaction(txid): finds a single transaction by txid stringget_transaction_count(): returns total transaction count across all walletstransaction_record_to_infomapsTransactionRecordfields toTransactionInfobridge type