From 001b39c588cfa68e3bd0453cb47f29ede737dae1 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Fri, 17 Apr 2020 04:04:39 -0400 Subject: [PATCH] Impl PartialEq for AuthorizingKey and FullViewingKey --- zebra-chain/src/keys/sapling.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zebra-chain/src/keys/sapling.rs b/zebra-chain/src/keys/sapling.rs index 1dfc6510..fadf860f 100644 --- a/zebra-chain/src/keys/sapling.rs +++ b/zebra-chain/src/keys/sapling.rs @@ -416,6 +416,12 @@ impl From for AuthorizingKey { } } +impl PartialEq for AuthorizingKey { + fn eq(&self, other: &Self) -> bool { + Into::<[u8; 32]>::into(self.0) == Into::<[u8; 32]>::into(other.0) + } +} + impl PartialEq<[u8; 32]> for AuthorizingKey { fn eq(&self, other: &[u8; 32]) -> bool { Into::<[u8; 32]>::into(self.0) == *other @@ -772,6 +778,7 @@ mod fvk_hrp { /// test network, the Human-Readable Part is “zviewtestsapling”. /// /// https://zips.z.cash/protocol/protocol.pdf#saplingfullviewingkeyencoding +#[derive(Copy, Clone, PartialEq)] pub struct FullViewingKey { network: Network, authorizing_key: AuthorizingKey,