Drop TestRandom impl

This commit is contained in:
dapplion
2024-06-17 19:56:12 +02:00
parent f0492852f3
commit 5070ab254d

View File

@@ -2,7 +2,6 @@ use crate::slot_data::SlotData;
use crate::ForkName;
use crate::{test_utils::TestRandom, Hash256, Slot};
use derivative::Derivative;
use rand::RngCore;
use safe_arith::ArithError;
use serde::{Deserialize, Serialize};
use ssz_derive::{Decode, Encode};
@@ -77,23 +76,6 @@ pub struct Attestation<E: EthSpec> {
pub signature: AggregateSignature,
}
// TODO(electra): think about how to handle fork variants here
impl<E: EthSpec> TestRandom for Attestation<E> {
fn random_for_test(rng: &mut impl RngCore) -> Self {
let aggregation_bits = BitList::random_for_test(rng);
let data = AttestationData::random_for_test(rng);
let signature = AggregateSignature::random_for_test(rng);
let committee_bits = BitVector::random_for_test(rng);
Self::Electra(AttestationElectra {
aggregation_bits,
committee_bits,
data,
signature,
})
}
}
impl<E: EthSpec> Hash for Attestation<E> {
fn hash<H>(&self, state: &mut H)
where