feat: wallet transaction confirmation lifecycle#540
feat: wallet transaction confirmation lifecycle#540xdustinface wants to merge 3 commits intov0.42-devfrom
Conversation
commit 0077e89 Author: xdustinface <xdustinfacex@gmail.com> Date: Sun Mar 15 13:52:27 2026 +0700 test: consolidate test transaction creation - Add `Transaction::empty()` for creating transactions with no inputs/outputs, replacing the private `create_test_transaction()` in `transaction_record.rs` - Remove `create_transaction_to_address` from `key-wallet/src/test_utils/wallet.rs` and replace all call sites in `wallet_checker` tests with `Transaction::dummy` - Remove `create_test_transaction` from router test helpers and replace all call sites across all router test files with `Transaction::dummy` - Add `test_addr()` helper in router test helpers to reduce verbosity
commit c9e13c1 Author: xdustinface <xdustinfacex@gmail.com> Date: Sun Mar 15 13:54:02 2026 +0700 test: extract wallet setup into `TestWalletContext` Add `TestWalletContext` struct to `test_utils::wallet` providing a pre-built testnet wallet with BIP44 account, receive address, and xpub. Replace duplicated wallet setup code across `wallet_checker`, `routing`, `coinbase`, and `asset_unlock` test modules.
Add `InstantSend` transaction context and transaction state management so wallet transactions can transition through confirmation stages (mempool → InstantSend → block → chain-locked block). Key changes: - Add `TransactionContext::InstantSend` variant with FFI support - Track known transactions to avoid double-counting - Add `confirm_transaction()` for mempool→block transitions - Add IS lock dedup set to prevent redundant processing - Update balance after any UTXO state change - Add `status_changed` field to `TransactionCheckResult` - Add `TestWalletContext::with_mempool_funding()` helper - Add more relevant tests
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v0.42-dev #540 +/- ##
=============================================
- Coverage 66.89% 65.62% -1.28%
=============================================
Files 313 313
Lines 64753 64819 +66
=============================================
- Hits 43317 42535 -782
- Misses 21436 22284 +848
*This pull request uses carry forward flags. Click here to find out more.
|
Add
InstantSendtransaction context and transaction state managementso wallet transactions can transition through confirmation stages
(mempool → InstantSend → block → chain-locked block).
Key changes:
TransactionContext::InstantSendvariant with FFI supportconfirm_transaction()for mempool→block transitionsstatus_changedfield toTransactionCheckResultTestWalletContext::with_mempool_funding()helper