-
Notifications
You must be signed in to change notification settings - Fork 252
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_keys: Add decode_extfvk_with_network
#1523
Conversation
9adc4ea
to
101e0b2
Compare
101e0b2
to
897018a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1523 +/- ##
==========================================
- Coverage 61.16% 61.06% -0.10%
==========================================
Files 141 141
Lines 16649 16675 +26
==========================================
Hits 10183 10183
- Misses 6466 6492 +26 ☔ View full report in Codecov by Sentry. |
e4dbf11
to
7c05fcb
Compare
7c05fcb
to
a732932
Compare
/// Decodes an [`ExtendedFullViewingKey`] and the [`NetworkType`] that it is intended for use with | ||
/// from a Bech32-encoded string. | ||
#[cfg(feature = "sapling")] | ||
pub fn decode_extfvk_with_network( |
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.
I know the other functions in this file don't explicitly say in their names that they're for Sapling, but that still seems odd. Non-blocking; I don't think we can do anything about it right now, but we should consider moving them to a zcash_keys::sapling::encoding
module if they are never going to be more general.
let (decoded_hrp, data, variant) = bech32::decode(s)?; | ||
if variant != Variant::Bech32 { | ||
Err(Bech32DecodeError::IncorrectVariant(variant)) | ||
} else { |
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.
Consider using CheckedHrpstring::new::<Bech32>
(although I'm not sure it really comes out any cleaner once error handling has been taken into account).
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
No description provided.