Commit 734b35f
authored
feat: expose full
* feat: expose full `TransactionRecord` through FFI and wallet events
- Add FFI types for transaction direction, type, output role, and input/output details
- Enrich `FFITransactionRecord` with classification, details, label and serialized tx bytes
- Simplify `WalletEvent::TransactionReceived` to carry `Box<TransactionRecord>`
- Return `TransactionRecord` from `record_transaction` and propagate via `TransactionCheckResult`
- Refactor `OnTransactionReceivedCallback` to pass `*const FFITransactionRecord`
* fix: prevent `label` CString memory leak in transaction callback
Addresses CodeRabbit review comment on PR #614
#614 (comment)
* refactor: combine received txid/amount into single mutex in test tracker
Addresses CodeRabbit review comment on PR #614
#614 (comment)
* fix: correct `net_amount` assertion in FFI callback integration test
The test sends 1 DASH from the same wallet (same mnemonic) that the SPV
client tracks, making it an internal transfer where both inputs and
outputs belong to the wallet. The `net_amount` therefore equals
approximately `-fee`, not +100_000_000. Replace the strict amount pairing
assertion with a txid presence check and non-zero net_amount verification.TransactionRecord through FFI and wallet events (#614)1 parent c6a4ed6 commit 734b35f
File tree
15 files changed
+689
-290
lines changed- dash-spv-ffi
- src
- bin
- tests/dashd_sync
- dash-spv/tests/dashd_sync
- key-wallet-ffi/src
- key-wallet-manager/src
- key-wallet/src
- managed_account
- transaction_checking
15 files changed
+689
-290
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
160 | | - | |
161 | 161 | | |
162 | | - | |
163 | | - | |
164 | | - | |
| 162 | + | |
165 | 163 | | |
166 | 164 | | |
167 | 165 | | |
168 | | - | |
169 | 166 | | |
170 | 167 | | |
171 | 168 | | |
172 | 169 | | |
173 | 170 | | |
174 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
175 | 180 | | |
176 | | - | |
177 | | - | |
| 181 | + | |
| 182 | + | |
178 | 183 | | |
179 | 184 | | |
180 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
530 | 534 | | |
531 | 535 | | |
532 | 536 | | |
533 | | - | |
534 | | - | |
535 | | - | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
536 | 541 | | |
537 | 542 | | |
538 | 543 | | |
539 | | - | |
540 | 544 | | |
541 | | - | |
542 | | - | |
543 | | - | |
| 545 | + | |
544 | 546 | | |
545 | 547 | | |
546 | 548 | | |
| |||
696 | 698 | | |
697 | 699 | | |
698 | 700 | | |
699 | | - | |
700 | 701 | | |
701 | | - | |
702 | | - | |
703 | | - | |
| 702 | + | |
704 | 703 | | |
705 | 704 | | |
706 | 705 | | |
707 | 706 | | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
712 | 766 | | |
713 | 767 | | |
714 | | - | |
715 | 768 | | |
716 | | - | |
717 | | - | |
718 | | - | |
| 769 | + | |
719 | 770 | | |
720 | 771 | | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
721 | 781 | | |
722 | 782 | | |
723 | 783 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
346 | | - | |
347 | 346 | | |
348 | | - | |
349 | | - | |
350 | | - | |
| 347 | + | |
351 | 348 | | |
352 | 349 | | |
353 | 350 | | |
354 | 351 | | |
355 | 352 | | |
356 | | - | |
357 | | - | |
358 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
359 | 360 | | |
360 | | - | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
| 363 | + | |
369 | 364 | | |
370 | 365 | | |
371 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 215 | + | |
| 216 | + | |
224 | 217 | | |
225 | | - | |
| 218 | + | |
226 | 219 | | |
227 | 220 | | |
228 | | - | |
| 221 | + | |
229 | 222 | | |
230 | 223 | | |
231 | 224 | | |
| |||
308 | 301 | | |
309 | 302 | | |
310 | 303 | | |
311 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
312 | 309 | | |
313 | | - | |
| 310 | + | |
| 311 | + | |
314 | 312 | | |
315 | | - | |
316 | | - | |
| 313 | + | |
| 314 | + | |
317 | 315 | | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
322 | 319 | | |
323 | | - | |
324 | | - | |
325 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
326 | 323 | | |
327 | | - | |
| 324 | + | |
328 | 325 | | |
329 | 326 | | |
330 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
0 commit comments