mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-04 13:24:39 +00:00
Drop TestRandom impl
This commit is contained in:
@@ -2,7 +2,6 @@ use crate::slot_data::SlotData;
|
|||||||
use crate::ForkName;
|
use crate::ForkName;
|
||||||
use crate::{test_utils::TestRandom, Hash256, Slot};
|
use crate::{test_utils::TestRandom, Hash256, Slot};
|
||||||
use derivative::Derivative;
|
use derivative::Derivative;
|
||||||
use rand::RngCore;
|
|
||||||
use safe_arith::ArithError;
|
use safe_arith::ArithError;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ssz_derive::{Decode, Encode};
|
use ssz_derive::{Decode, Encode};
|
||||||
@@ -77,23 +76,6 @@ pub struct Attestation<E: EthSpec> {
|
|||||||
pub signature: AggregateSignature,
|
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> {
|
impl<E: EthSpec> Hash for Attestation<E> {
|
||||||
fn hash<H>(&self, state: &mut H)
|
fn hash<H>(&self, state: &mut H)
|
||||||
where
|
where
|
||||||
|
|||||||
Reference in New Issue
Block a user