-
Notifications
You must be signed in to change notification settings - Fork 299
Update hashes
to 0.16.0
#832
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
base: master
Are you sure you want to change the base?
Conversation
Thanks! Yeah, let's do this. I am tempted to cut a release of Was hoping to get #806 in first but it's blocked on lack of review, so let's just do it. |
fails claiming that I'm not sure why the |
The `0.15.0` was a massive release for `hashes` in terms of API clean up and also adding new HKDF support. ElligatorSwift in combination with HKDF are the primitives required for encrypted message passing on bitcoin, so exporting these in tandum would save an additional `hashes` dependency. I skip to `0.16.0` because `hashes` allows for `hex-conservative` as an optional dependency, and no listed changes elsewhere.
cfba077
to
20ba84c
Compare
Well, I came up with a solution lol. Using the |
Hah, thanks! I'd prefer to keep the PR here as-is as a canary, because I suspect that actually we broke |
Exploring |
I did #833 while reviewing this. |
f.debug_tuple(stringify!($thing)).field(&format_args!("#{:.16}", hash)).finish() | ||
f.debug_tuple(stringify!($thing)).field(&format_args!("{:?}", hash)).finish() |
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.
That 16 width was so its a fingerprint not the whole hash. But I cannot find a test for it. Can you add this and make it pass?
#[cfg(test)]
mod test {
use super::*;
#[test]
#[cfg(feature = "hashes")]
fn debug_secret_hashes_feature_enabled() {
let key = "0000000000000000000000000000000000000000000000000000000000000001".parse::<SecretKey>().unwrap();
// Normal debug hides value (`Display` is not implemented for `SecretKey`).
let want = "SecretKey(#2518682f7819fb2d)";
let got = format!("{:?}", key);
assert_eq!(got, want);
}
#[test]
#[cfg(not(feature = "hashes"))]
fn debug_secret_no_hashes() {
let key = "0000000000000000000000000000000000000000000000000000000000000001".parse::<SecretKey>().unwrap();
// With "hashes" feature we just output a message.
let want = "<secret key; enable `hashes` feature of `secp256k1` to display fingerprint>";
let got = format!("{:?}", key);
assert_eq!(got, want);
}
}
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.
Maybe the doc test was supposed to test it but it just includes a comment about it.
Rebasing on #833 works. I will wait for that to go in and then add the tests. |
The
0.15.0
was a massive release forhashes
in terms of API clean up and also adding new HKDF support. ElligatorSwift in combination with HKDF are the primitives required for encrypted message passing on bitcoin, so exporting these in tandum would save an additionalhashes
dependency.I skip to
0.16.0
becausehashes
allows forhex-conservative
as an optional dependency, and no listed changes elsewhere.Reducing the scope of #783 and will take a stab at
rand
later.