-
Notifications
You must be signed in to change notification settings - Fork 7
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
Nostr Key Decoding #29
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.
looks good
@@ -84,7 +84,7 @@ pub fn decode( | |||
padding: u32, | |||
format: u8, | |||
) -> Result<Vec<u8>, CarbonadoError> { | |||
let format = Format::try_from(format)?; | |||
let format = Format::from(format); |
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.
Interesting you dropped "try_from" to "from", isn't that a downgrade.
Just wondering the logic for 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.
No, that's better. The library we're using can guarantee infallibility at the type level.
@@ -1,7 +1,7 @@ | |||
use std::sync::Once; | |||
|
|||
use bao::Hash; | |||
use bech32::{decode, encode, FromBase32, ToBase32, Variant}; | |||
use bech32::{decode, encode, Bech32m, Hrp}; |
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 will need to review the bao::Hask to understand the minus of "FromBase32, etc.and what is Hrp"
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 is for bech32 encoding. HRP stands for Human Readable Part. You can read more in the BIP:
https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki
No description provided.