From 174a99cd06a26d3ca6499a95e44e97f400c12362 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Mon, 28 Mar 2022 21:29:04 +0200 Subject: [PATCH] Implement serde for TweakedKeyPair --- src/util/schnorr.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/schnorr.rs b/src/util/schnorr.rs index b5bbe0f8..8542915f 100644 --- a/src/util/schnorr.rs +++ b/src/util/schnorr.rs @@ -60,8 +60,9 @@ impl fmt::Display for TweakedPublicKey { pub type UntweakedKeyPair = ::KeyPair; /// Tweaked BIP-340 key pair -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[cfg_attr(feature = "std", derive(Debug))] +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", serde(transparent))] pub struct TweakedKeyPair(::KeyPair); /// A trait for tweaking BIP340 key types (x-only public keys and key pairs).