-
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
Preparatory refactoring for zcash/librustzcash#1673 #1675
Preparatory refactoring for zcash/librustzcash#1673 #1675
Conversation
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.
This could be better handled by taking a golden testing approach: branching from the commit where this test was added, create a wallet database file containing the buggy state, and store it in the repository; then, add an ordinary test that begins from that buggy database file and ensure that migrating to the current state results in the bug having been fixed.
3e51560
to
7a46303
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.
This could be better handled by taking a golden testing approach: branching from the commit where this test was added, create a wallet database file containing the buggy state, and store it in the repository; then, add an ordinary test that begins from that buggy database file and ensure that migrating to the current state results in the bug having been 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.
utACK with comments.
03d4d2e
to
6ba9b48
Compare
6ba9b48
to
cccbf01
Compare
990cd7e
to
c2dbd20
Compare
… `NetworkConstants` trait.
…he `transparent-inputs` feature flag. This variant should not have been a part of the public API unless `tranpsarent-inputs` was enabled, as it's necessary for the wallet to be able to spend a transparent input in order for a ZIP 320 transaction to be properly constructed and authorized. In addition, this simplifies the `Recipient` API by removing its type parameters in favor of concrete types, made possible by using a separate type for the build process.
…gration. This test is not specific to the migration; it's a more general test of ephemeral address rotation behavior and should evolve with the evolution of address rotation and gap limit handling, not be tied to the behavior of methods at the time that this migration was created.
This permits `UnifiedAddressRequest` values an additional dimension of flexibility, permitting generation of unified addresses having receivers for all recever types for which a key item exists and a diversifier index is valid.
This removes a `fix_bad_change_flagging` migration test duplicated from `zcash_client_backend::data_api::testing::pool::shiled_transparent`. It is impractical to maintain backwards compatibility to earlier database states for the entire test harness, which is more or less what retaining this test would require, and the desired outcome is already demonstrated by the `shield_transparent` test; demonstrating the fix directly is unnecessary.
c2dbd20
to
e6b45f7
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 e6b45f7
zcash_keys/src/keys.rs
Outdated
(Require, Omit) => None, | ||
(Require, Require) => Some(Require), | ||
(Require, Allow) => Some(Require), | ||
(Allow, Require) => Some(Require), | ||
(Allow, Allow) => Some(Allow), | ||
(Allow, Omit) => Some(Omit), | ||
(Omit, Require) => None, | ||
(Omit, Allow) => Some(Omit), | ||
(Omit, Omit) => Some(Omit), |
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.
Slightly more concise:
(Require, Omit) => None, | |
(Require, Require) => Some(Require), | |
(Require, Allow) => Some(Require), | |
(Allow, Require) => Some(Require), | |
(Allow, Allow) => Some(Allow), | |
(Allow, Omit) => Some(Omit), | |
(Omit, Require) => None, | |
(Omit, Allow) => Some(Omit), | |
(Omit, Omit) => Some(Omit), | |
(Require, Omit) | (Omit, Require) => None, | |
(Require, _) | (_, Require) => Some(Require), | |
(Omit, _) | (_, Omit) => Some(Omit), | |
(Allow, Allow) => Some(Allow), |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1675 +/- ##
==========================================
- Coverage 52.30% 52.22% -0.09%
==========================================
Files 179 179
Lines 21343 21353 +10
==========================================
- Hits 11164 11152 -12
- Misses 10179 10201 +22 ☔ View full report in Codecov by Sentry. |
output_pool, | ||
}, | ||
#[cfg(feature = "transparent-inputs")] | ||
BuildRecipient::EphemeralTransparent { .. } => unreachable!(), |
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.
Why is this unreachable?
ephemeral_address, | ||
outpoint, | ||
}, | ||
BuildRecipient::InternalAccount { .. } => unreachable!(), |
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.
Why is this unreachable?
/// this UFVK. | ||
/// | ||
/// Returns `None` if the specified index does not produce a valid diversifier. | ||
/// Returns an error if the this key does not produce a valid receiver for a required receiver |
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.
Nit: "if the this"
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.
Post-hoc utACK with questions.
This is the preparatory work pulled out from #1673