Merge rust-bitcoin/rust-bitcoin#1949: key: Impl From<secp256k1::PublicKey> for bitcoin::PublicKey

ebcce38b4f run cargo fmt (Andrew Poelstra)
b3ac00b8b3 key: Impl From<secp256k1::PublicKey> for bitcoin::PublicKey (Steven Roose)

Pull request description:

ACKs for top commit:
  apoelstra:
    ACK ebcce38b4f
  tcharding:
    ACK ebcce38b4f

Tree-SHA512: 9b862f0bb75e74780e935e5292c6a67ae479f699f0ee2f90515f972698dc06af5ea7d1725908fb435cafd6c0bab7263570d780607e507d6127efaea97f2464c8
This commit is contained in:
Andrew Poelstra 2023-07-21 13:52:24 +00:00
commit f50bb05e99
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 4 additions and 0 deletions

View File

@ -264,6 +264,10 @@ 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() }
} }