key: Impl From<secp256k1::PublicKey> for bitcoin::PublicKey

This commit is contained in:
Steven Roose 2023-07-20 17:09:37 +01:00
parent 8f4b57e3c5
commit b3ac00b8b3
No known key found for this signature in database
GPG Key ID: 2F2A88D7F8D68E87
1 changed files with 6 additions and 0 deletions

View File

@ -264,6 +264,12 @@ impl PublicKey {
} }
} }
impl From<secp256k1::PublicKey> for PublicKey {
fn from(pk: secp256k1::PublicKey) -> PublicKey {
PublicKey::new(pk)
}
}
impl From<PublicKey> for XOnlyPublicKey { impl From<PublicKey> for XOnlyPublicKey {
fn from(pk: PublicKey) -> XOnlyPublicKey { pk.inner.into() } fn from(pk: PublicKey) -> XOnlyPublicKey { pk.inner.into() }
} }