diff --git a/beacon_chain/utils/bls/src/public_key.rs b/beacon_chain/utils/bls/src/public_key.rs index 62543589f..be260bf79 100644 --- a/beacon_chain/utils/bls/src/public_key.rs +++ b/beacon_chain/utils/bls/src/public_key.rs @@ -7,7 +7,7 @@ use std::hash::{Hash, Hasher}; /// /// This struct is a wrapper upon a base type and provides helper functions (e.g., SSZ /// serialization). -#[derive(Debug, PartialEq, Clone, Eq)] +#[derive(Debug, Clone, Eq)] pub struct PublicKey(RawPublicKey); impl PublicKey { @@ -35,6 +35,12 @@ impl Decodable for PublicKey { } } +impl PartialEq for PublicKey { + fn eq(&self, other: &PublicKey) -> bool { + ssz_encode(self) == ssz_encode(other) + } +} + impl Hash for PublicKey { fn hash(&self, state: &mut H) { ssz_encode(self).hash(state)