Merge rust-bitcoin/rust-bitcoin#1901: key: Implement From<PublicKey> for XOnlyPublicKey

445aa84f8c cargo fmt (Andrew Poelstra)
d990084481 key: Implement From<PublicKey> for XOnlyPublicKey (Steven Roose)

Pull request description:

ACKs for top commit:
  tcharding:
    ACK 445aa84f8c
  apoelstra:
    ACK 445aa84f8c

Tree-SHA512: c27b23dcf66139720011dc8bee379a8e4be642f8f60e8982c643013e163ad1610d355c6f5de04efc57d0dc11ba4ff0e893d3f760d5662d8f0c7eaba87f0a89a0
This commit is contained in:
Andrew Poelstra 2023-06-12 23:00:38 +00:00
commit 79bd294476
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 4 additions and 0 deletions

View File

@ -253,6 +253,10 @@ impl PublicKey {
}
}
impl From<PublicKey> for XOnlyPublicKey {
fn from(pk: PublicKey) -> XOnlyPublicKey { pk.inner.into() }
}
/// An opaque return type for PublicKey::to_sort_key
#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
pub struct SortKey(u8, [u8; 32], [u8; 32]);