Impl PartialEq for AuthorizingKey and FullViewingKey

This commit is contained in:
Deirdre Connolly 2020-04-17 04:04:39 -04:00 committed by Deirdre Connolly
parent 5d430cff12
commit 001b39c588
1 changed files with 7 additions and 0 deletions

View File

@ -416,6 +416,12 @@ impl From<SpendAuthorizingKey> 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,