Skip to content
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

Merged
merged 11 commits into from
Oct 20, 2023
Merged

Txdb tests and updates #782

merged 11 commits into from
Oct 20, 2023

Conversation

nodech
Copy link
Contributor

@nodech nodech commented Dec 16, 2022

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 checkboxes in the document: https://gist.github.com/nodech/c943e7c50b300b0505cc9dfcae243d48

Suggestions 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:

  • Add 'missed credit' events

@coveralls
Copy link

coveralls commented Dec 16, 2022

Coverage Status

coverage: 68.686% (+0.03%) from 68.658% when pulling 2d5c25a on nodech:txdb-updates into 5c287c9 on handshake-org:master.

@pinheadmz pinheadmz added this to the hsd 5.0.1 milestone Dec 21, 2022
@nodech nodech force-pushed the txdb-updates branch 3 times, most recently from ba2d6c5 to 65127a1 Compare December 21, 2022 21:04
@nodech nodech marked this pull request as ready for review December 21, 2022 21:04
@nodech nodech added advanced review difficulty - advanced wallet part of the codebase wallet-db part of the codebase patch Release version enhancement general - improving existing feature tests part of the codebase labels Dec 21, 2022
@nodech nodech removed this from the hsd 5.0.1 milestone Jan 5, 2023
@nodech nodech modified the milestone: hsd 5.0.0 Jan 19, 2023
@nodech nodech added this to the hsd 7.0.0 milestone Aug 1, 2023
@nodech
Copy link
Contributor Author

nodech commented Aug 22, 2023

Updated the document with the stuff that has been verified/implemented: https://gist.github.com/nodech/c943e7c50b300b0505cc9dfcae243d48

@nodech nodech requested a review from rithvikvibhu August 22, 2023 13:29
@nodech
Copy link
Contributor Author

nodech commented Oct 17, 2023

Rebased on master to fix bdb segfaults.

Copy link
Member

@rithvikvibhu rithvikvibhu left a 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

@nodech
Copy link
Contributor Author

nodech commented Oct 20, 2023

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.

@nodech nodech merged commit fc23f41 into handshake-org:master Oct 20, 2023
6 checks passed
@nodech nodech mentioned this pull request Nov 29, 2024
@nodech nodech mentioned this pull request Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced review difficulty - advanced enhancement general - improving existing feature patch Release version tests part of the codebase wallet part of the codebase wallet-db part of the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants