feat(wallet)!: include non-canonical txs in wallet history#480
feat(wallet)!: include non-canonical txs in wallet history#480noahjoeris wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #480 +/- ##
==========================================
+ Coverage 81.15% 81.47% +0.31%
==========================================
Files 24 24
Lines 5552 5647 +95
Branches 247 250 +3
==========================================
+ Hits 4506 4601 +95
Misses 970 970
Partials 76 76
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bc1de69 to
2bf915d
Compare
|
Concept ACK |
2bf915d to
5968606
Compare
|
After some ideas by ValuedMammal I simplified the model a bit:
PR description updated accordingly. |
|
|
cd09dc5 to
fe447ad
Compare
|
Yep I agree. I added |
fe447ad to
c39d308
Compare
oleonardolima
left a comment
There was a problem hiding this comment.
I don't fully grasp the rationale for the changes. I mean if you need specific group of transactions (e.g non-canonical, evicted, and so on), you could have other methods for those specific scenarios, and even a newer single one that list everything (same as accessing the inner TxGraph).
It's valid to notice that TxGraph is monotone, so if we are getting all transactions for the Wallet being canonical or not, so the list can be really big, and basically a duplicate of what already exists there.
|
Thanks for the reviews!
It addresses the problem stated in #295 that relevant non-canonical txs (fee-evicted, replaced, reorged) disappear from transactions(), so callers can miss them and accidentally double-pay. Ideal behavior is to keep them in the default wallet history with status/conflicts so apps can act accordingly. A separate method / raw TxGraph leaves that safe path opt-in. Users can rebuild this from existing APIs, but they could get it wrong and it's more convenient this way. |
c39d308 to
d107cce
Compare
d107cce to
404f0fa
Compare
Description
WalletTxwas an alias forCanonicalTx, sowallet.transactions()/wallet.get_tx(txid)only returned canonical wallet-relevant txs. Replaced/evicted txs disappeared even when still wallet-relevant.This PR renames
WalletTx→TransactionInfoand surfaces all wallet-relevant txs, including non-canonical ones:Fixes #295
Supported use cases
Notes to the reviewers
transactions()takes a small hit. Worth confirming whether it's an issue in practice.Changelog notice
Checklists
All Submissions:
just pbefore pushingNew Features: