From b3ac00b8b30153335c62d269961a4e51fc68ae88 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Thu, 20 Jul 2023 17:09:37 +0100 Subject: [PATCH 1/2] key: Impl From for bitcoin::PublicKey --- bitcoin/src/crypto/key.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bitcoin/src/crypto/key.rs b/bitcoin/src/crypto/key.rs index 5108940e..50be0d27 100644 --- a/bitcoin/src/crypto/key.rs +++ b/bitcoin/src/crypto/key.rs @@ -264,6 +264,12 @@ impl PublicKey { } } +impl From for PublicKey { + fn from(pk: secp256k1::PublicKey) -> PublicKey { + PublicKey::new(pk) + } +} + impl From for XOnlyPublicKey { fn from(pk: PublicKey) -> XOnlyPublicKey { pk.inner.into() } } From ebcce38b4fddca0b4363ff6a9723976ea801fe21 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Thu, 20 Jul 2023 17:13:15 +0000 Subject: [PATCH 2/2] run cargo fmt --- bitcoin/src/crypto/key.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bitcoin/src/crypto/key.rs b/bitcoin/src/crypto/key.rs index 50be0d27..41c541c0 100644 --- a/bitcoin/src/crypto/key.rs +++ b/bitcoin/src/crypto/key.rs @@ -265,9 +265,7 @@ impl PublicKey { } impl From for PublicKey { - fn from(pk: secp256k1::PublicKey) -> PublicKey { - PublicKey::new(pk) - } + fn from(pk: secp256k1::PublicKey) -> PublicKey { PublicKey::new(pk) } } impl From for XOnlyPublicKey {