-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Txdb tests and updates #782
Conversation
ba2d6c5
to
65127a1
Compare
Updated the document with the stuff that has been verified/implemented: https://gist.github.com/nodech/c943e7c50b300b0505cc9dfcae243d48 |
Now unconfirmation of the transaction can detect missed coins and apply it to balances. Before this change, reconfirmation would correct the balance.
Rebased on master to fix bdb segfaults. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this branch with a few live wallets of a couple of hundred txs and coins - balance remained same.
Went through the changes (and understand most of it I think/hope), nice work!
P.S. Every attempt at reading test/wallet-balance-test.js
, I get lost in some place or another 😄 must've been a pain to write and test
Yeah, I get lost when I get back to it for couple minutes as well. But otherwise it would have been huge file. Maybe I will try to simplify at some point. But for now it is what it is. |
This PR attempts to cover balance tracking with tests and fix some edge cases.
This is based on the initial idea of #780 and tests from it.
But expands scope to cover all balances instead of lock/unlocked.
To do full review on the txdb balance states and cover all missing cases, I have created psuedo code like document that includes all the cases this PR covers and future updates that may happen to the txdb methods. All cases that are covered in this PR are marked as
checkbox
es in the document: https://gist.github.com/nodech/c943e7c50b300b0505cc9dfcae243d48Suggestions to where to move this document or if it's useful to other developers are welcome here or on the document.
Next tasks (Not part of the PR), maybe create issues: