-
Notifications
You must be signed in to change notification settings - Fork 305
feat: Create keys from owned array values #781
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
feat: Create keys from owned array values #781
Conversation
a0c356c to
9b66c2a
Compare
|
Deprecation of a method is a candidate for the changelog. |
Update TupleVisitor{32,33} to pass its owned byte array to the parsing
function instead of a mere byte slice. This gives us more flexibility
inside the parsing function.
Construct KeyPair directly from [u8; 32]. Deprecate KeyPair::from_seckey_slice and replace all of its calls with the new method.
9b66c2a to
e7eea32
Compare
|
Fixed formatting |
|
Do we have serde regression tests here? I'm pretty nervous that the first commit changes the serialization format. |
|
This PR leaves the serialization format unchanged. The changes in |
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.
ACK e7eea32
I'm convinced this doesn't change serialization and whatever problems there are were there already.
|
I updated the other key constructors to take owned array values. I updated the PR title and added an entry to the changelog for a breaking change. @Kixunil I didn't see your approval until now; sorry. |
|
The lint failure is real, not sure about WASM. |
|
WASM we can ignore. We should probably just drop the CI job entirely until they fix my 18-month-old issue about wasm-pack not working at all in CI setups. |
|
Oh, crap. Side note: |
I updated the constructors to take owned array values of the form [u8; LEN] instead of taking array references of the form &[u8; LEN]. This makes the constructors more canonical. Already in this commit, I could remove a bunch of calls to `&` or `*`. Because this is a breaking change, I added an entry to the changelog.
8bd7f30 to
59cf7bd
Compare
|
WASM is already broken on In any case, I resolved the clippy lint. |
Thanks! I would appreciate that, though bear in mind that I will never test it locally until they fix |
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.
ACK 59cf7bd
Just FYI, deprecation is not a breaking change (yet), only removal is. Still, the changelog note is warranted.
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.
ACK 59cf7bd; successfully ran local tests; nice! the old function signatures were super weird. and the docs were wrong lol
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.
ACK 59cf7bd
…rray values
59cf7bd52c208a83d26ea16f2a27be2f8787b5d5 refactor: Create keys from owned array values (Christian Lewe)
e7eea32ffaf36172a03063b634a435ec937b7d21 feat: KeyPair::from_seckey_byte_array (Christian Lewe)
e723d80a1673841ba27b407fa289b351f41dc973 refactor: Parse byte array instead of byte slice (Christian Lewe)
Pull request description:
Construct KeyPair directly from [u8; 32]. I can change the parameter to &[u8; 32] depending on the discussion in #780.
ACKs for top commit:
Kixunil:
ACK 59cf7bd52c208a83d26ea16f2a27be2f8787b5d5
apoelstra:
ACK 59cf7bd52c208a83d26ea16f2a27be2f8787b5d5; successfully ran local tests; nice! the old function signatures were super weird. and the docs were wrong lol
tcharding:
ACK 59cf7bd52c208a83d26ea16f2a27be2f8787b5d5
Tree-SHA512: 64e3026984c79b2491b83775bd50b203ad0723f97ac02b4aa84bc5d0e1135c7fabb660a7d242beaa3f2799f16b169c6bbe3f24e31668518b59ed01839bb86c69
…rray values
59cf7bd52c208a83d26ea16f2a27be2f8787b5d5 refactor: Create keys from owned array values (Christian Lewe)
e7eea32ffaf36172a03063b634a435ec937b7d21 feat: KeyPair::from_seckey_byte_array (Christian Lewe)
e723d80a1673841ba27b407fa289b351f41dc973 refactor: Parse byte array instead of byte slice (Christian Lewe)
Pull request description:
Construct KeyPair directly from [u8; 32]. I can change the parameter to &[u8; 32] depending on the discussion in #780.
ACKs for top commit:
Kixunil:
ACK 59cf7bd52c208a83d26ea16f2a27be2f8787b5d5
apoelstra:
ACK 59cf7bd52c208a83d26ea16f2a27be2f8787b5d5; successfully ran local tests; nice! the old function signatures were super weird. and the docs were wrong lol
tcharding:
ACK 59cf7bd52c208a83d26ea16f2a27be2f8787b5d5
Tree-SHA512: 64e3026984c79b2491b83775bd50b203ad0723f97ac02b4aa84bc5d0e1135c7fabb660a7d242beaa3f2799f16b169c6bbe3f24e31668518b59ed01839bb86c69
Construct KeyPair directly from [u8; 32]. I can change the parameter to &[u8; 32] depending on the discussion in #780.