-
Notifications
You must be signed in to change notification settings - Fork 250
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
zcash_client_sqlite: Ensure that all shielded change outputs are correctly flagged. #1585
base: main
Are you sure you want to change the base?
Conversation
…ash#1571 The update to a shielding transaction causes the information that the output is considered change to be lost. This happens because the scanning process does not have access to any information about the inputs to the transaction, and so it does not recognize the output as change.
…ic migration state.
215d4d9
to
88b8f79
Compare
…scind that determination. This is a minimal and correct but incomplete fix for zcash#1571. Additional work to distinguish change outputs is necessary to update existing wallets that have made an incorrect change determination in the past.
88b8f79
to
cacbf26
Compare
…tly flagged when recording sent outputs. Fixes zcash#1571
cacbf26
to
0d82e1e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1585 +/- ##
==========================================
+ Coverage 61.88% 61.95% +0.07%
==========================================
Files 149 150 +1
Lines 18946 18994 +48
==========================================
+ Hits 11724 11768 +44
- Misses 7222 7226 +4 ☔ 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.
Reviewed 0d82e1e
// Complete the migration | ||
init_wallet_db(st.wallet_mut().db_mut(), None).unwrap(); | ||
|
||
// Ensure that the transaction metadata is still correct after the update produced by scanning. |
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.
What scanning update? AFAICT this test doesn't do one; it just checks that the unscanned shielding transaction's metadata is not altered by the migration. It might indeed be useful to have two tests for this migration: one that ensures correct data isn't altered, and one that ensures incorrect data gets fixed.
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.
Copy/paste error - this comment was correct in the test for the change from IS_NULL
to MAX
, and the test is the same.
Fixes #1571