-
Notifications
You must be signed in to change notification settings - Fork 251
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
[#1411] Refactor AccountBalance to use Balance for transparent funds #1570
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1570 +/- ##
==========================================
+ Coverage 56.39% 56.73% +0.34%
==========================================
Files 149 149
Lines 19466 19540 +74
==========================================
+ Hits 10977 11086 +109
+ Misses 8489 8454 -35 ☔ View full report in Codecov by Sentry. |
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.
Changes required.
Note that tests passed despite the bug of not checking the overflow invariant in AccountBalance::add_unshielded_value
. The suggested replacement code obviously does maintain the invariant because it only uses other public methods, but still we might want more test coverage here.
Thank you for the thorough review! I'll be addressing these comments shortly. |
3734cda
to
68b9725
Compare
d49ebd3
to
f706b33
Compare
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.
Changes needed.
f706b33
to
da30040
Compare
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.
The changes to (This was fixed.)AccountBalance
should be documented in the CHANGELOG for zcash_client_backend
, not zcash_primitives
.
Also, the fix to (This was also fixed.)zcash_client_sqlite
's implementation of get_wallet_summary
, along with its remaining limitations, should be documented in the CHANGELOG for zcash_client_sqlite
:
### Fixed
- `zcash_client_sqlite::WalletDb`'s implementation of
`zcash_client_backend::data_api::WalletRead::get_wallet_summary` has been
fixed to take account of `min_confirmations` for transparent balances.
Note that this implementation treats `min_confirmations == 0` the same
as `min_confirmations == 1` for both shielded and transparent TXOs.
It also does not currently distinguish between pending change and
non-change; the pending value is all counted as non-change (issue
[#1592](https://github.com/zcash/librustzcash/issues/1592)).
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.
utACK. (The complaint about redundancy in the test code is non-blocking.)
oh no! a wild conflicting commit appeared! |
0bf347e
to
f6c36fc
Compare
…unds closes zcash#1411 - Adds min_confirmations to transparent account balances - Adds a new `transparent_balance_spendability` test to verify transparent funds spendability. - cargo clippy + cargo fmt Refactor: Extract Method on lambda `check_balance` Fix transparent_balance_spendability tests and `check_balance` to properly verify `min_confirmations` assumptions Fix comment typo Improve test documentation PR Suggestions cargo fmt and cargo clippy
f6c36fc
to
bc63767
Compare
Squashed commits and rebased to main afterwards. |
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.
utACK with minor non-blocking suggestion.
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.
utACK (+ doc-only self-ACK for 19dedb7)
Signed-off-by: Daira-Emma Hopwood <[email protected]>
886f72f
to
3f80212
Compare
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.
utACK bc63767 + doc-only self-ACK for 3f80212.
Changes since last ACK for 19dedb7 are only to the zcash_client_backend
changelog.
Signed-off-by: Daira-Emma Hopwood <[email protected]>
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.
doc-only self-ACK for bd45812
fixes #1411