key: Implement From<PublicKey> for XOnlyPublicKey

This commit is contained in:
Steven Roose 2023-06-06 20:24:28 +01:00
parent 0266e762bd
commit d990084481
No known key found for this signature in database
GPG Key ID: 2F2A88D7F8D68E87
1 changed files with 6 additions and 0 deletions

View File

@ -253,6 +253,12 @@ 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]);