diff --git a/beacon_chain/types/src/beacon_block.rs b/beacon_chain/types/src/beacon_block.rs index 36b625eb5..a0c426233 100644 --- a/beacon_chain/types/src/beacon_block.rs +++ b/beacon_chain/types/src/beacon_block.rs @@ -4,7 +4,7 @@ use crate::test_utils::TestRandom; use bls::Signature; use rand::RngCore; -#[derive(Debug, PartialEq, Clone, Default)] +#[derive(Debug, PartialEq, Clone)] pub struct BeaconBlock { pub slot: u64, pub parent_root: Hash256, diff --git a/beacon_chain/types/src/casper_slashing.rs b/beacon_chain/types/src/casper_slashing.rs index a972f2248..f3c1b5d18 100644 --- a/beacon_chain/types/src/casper_slashing.rs +++ b/beacon_chain/types/src/casper_slashing.rs @@ -3,7 +3,7 @@ use super::SlashableVoteData; use crate::test_utils::TestRandom; use rand::RngCore; -#[derive(Debug, PartialEq, Clone, Default)] +#[derive(Debug, PartialEq, Clone)] pub struct CasperSlashing { pub slashable_vote_data_1: SlashableVoteData, pub slashable_vote_data_2: SlashableVoteData, diff --git a/beacon_chain/types/src/proposer_slashing.rs b/beacon_chain/types/src/proposer_slashing.rs index d2d353112..0ae1c6e66 100644 --- a/beacon_chain/types/src/proposer_slashing.rs +++ b/beacon_chain/types/src/proposer_slashing.rs @@ -4,7 +4,7 @@ use crate::test_utils::TestRandom; use bls::Signature; use rand::RngCore; -#[derive(Debug, PartialEq, Clone, Default)] +#[derive(Debug, PartialEq, Clone)] pub struct ProposerSlashing { pub proposer_index: u32, pub proposal_data_1: ProposalSignedData, diff --git a/beacon_chain/types/src/slashable_vote_data.rs b/beacon_chain/types/src/slashable_vote_data.rs index 9eb3d1984..4d8e2eab3 100644 --- a/beacon_chain/types/src/slashable_vote_data.rs +++ b/beacon_chain/types/src/slashable_vote_data.rs @@ -4,7 +4,7 @@ use crate::test_utils::TestRandom; use bls::AggregateSignature; use rand::RngCore; -#[derive(Debug, PartialEq, Clone, Default)] +#[derive(Debug, PartialEq, Clone)] pub struct SlashableVoteData { pub aggregate_signature_poc_0_indices: Vec, pub aggregate_signature_poc_1_indices: Vec, diff --git a/beacon_chain/utils/bls/src/aggregate_signature.rs b/beacon_chain/utils/bls/src/aggregate_signature.rs index 5cc9c3c21..2e3630268 100644 --- a/beacon_chain/utils/bls/src/aggregate_signature.rs +++ b/beacon_chain/utils/bls/src/aggregate_signature.rs @@ -24,15 +24,8 @@ impl AggregateSignature { /// /// Only returns `true` if the set of keys in the `AggregatePublicKey` match the set of keys /// that signed the `AggregateSignature`. - pub fn verify(&self, msg: &[u8], avk: &AggregatePublicKey) -> bool { - self.0.verify(msg, avk) - } -} - -impl Default for AggregateSignature { - /// A "default" signature is a signature across an empty message by a secret key of 48 zeros. - fn default() -> Self { - AggregateSignature::new() + pub fn verify(&self, msg: &[u8], aggregate_public_key: &AggregatePublicKey) -> bool { + self.0.verify(msg, aggregate_public_key) } } diff --git a/beacon_chain/utils/bls/src/signature.rs b/beacon_chain/utils/bls/src/signature.rs index bfeaca45e..ebdb5b817 100644 --- a/beacon_chain/utils/bls/src/signature.rs +++ b/beacon_chain/utils/bls/src/signature.rs @@ -36,17 +36,6 @@ impl Signature { } } -impl Default for Signature { - /// A "default" signature is a signature across an empty message by a secret key of 48 zeros. - fn default() -> Self { - let sk = match SecretKey::from_bytes(&[0; 48]) { - Ok(key) => key, - _ => unreachable!(), // Key is static, should not fail. - }; - Signature(RawSignature::new(&[], &sk)) - } -} - impl Encodable for Signature { fn ssz_append(&self, s: &mut SszStream) { s.append_vec(&self.0.as_bytes());