mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-30 03:03:45 +00:00
Disable use of system time in tests
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
#![cfg(not(debug_assertions))]
|
||||
|
||||
use beacon_chain::sync_committee_verification::Error as SyncCommitteeError;
|
||||
use beacon_chain::test_utils::{
|
||||
BeaconChainHarness, EphemeralTestingSlotClockHarnessType, RelativeSyncCommittee,
|
||||
};
|
||||
use beacon_chain::test_utils::{BeaconChainHarness, EphemeralHarnessType, RelativeSyncCommittee};
|
||||
use int_to_bytes::int_to_bytes32;
|
||||
use lazy_static::lazy_static;
|
||||
use safe_arith::SafeArith;
|
||||
@@ -25,9 +23,7 @@ lazy_static! {
|
||||
}
|
||||
|
||||
/// Returns a beacon chain harness.
|
||||
fn get_harness(
|
||||
validator_count: usize,
|
||||
) -> BeaconChainHarness<EphemeralTestingSlotClockHarnessType<E>> {
|
||||
fn get_harness(validator_count: usize) -> BeaconChainHarness<EphemeralHarnessType<E>> {
|
||||
let mut spec = E::default_spec();
|
||||
spec.altair_fork_epoch = Some(Epoch::new(0));
|
||||
let harness = BeaconChainHarness::builder(MainnetEthSpec)
|
||||
@@ -46,7 +42,7 @@ fn get_harness(
|
||||
///
|
||||
/// Also returns some info about who created it.
|
||||
fn get_valid_sync_committee_message(
|
||||
harness: &BeaconChainHarness<EphemeralTestingSlotClockHarnessType<E>>,
|
||||
harness: &BeaconChainHarness<EphemeralHarnessType<E>>,
|
||||
slot: Slot,
|
||||
relative_sync_committee: RelativeSyncCommittee,
|
||||
message_index: usize,
|
||||
@@ -72,7 +68,7 @@ fn get_valid_sync_committee_message(
|
||||
}
|
||||
|
||||
fn get_valid_sync_contribution(
|
||||
harness: &BeaconChainHarness<EphemeralTestingSlotClockHarnessType<E>>,
|
||||
harness: &BeaconChainHarness<EphemeralHarnessType<E>>,
|
||||
relative_sync_committee: RelativeSyncCommittee,
|
||||
) -> (SignedContributionAndProof<E>, usize, SecretKey) {
|
||||
let head_state = harness.chain.head_beacon_state_cloned();
|
||||
@@ -104,7 +100,7 @@ fn get_valid_sync_contribution(
|
||||
|
||||
/// Returns a proof and index for a validator that is **not** an aggregator for the current sync period.
|
||||
fn get_non_aggregator(
|
||||
harness: &BeaconChainHarness<EphemeralTestingSlotClockHarnessType<E>>,
|
||||
harness: &BeaconChainHarness<EphemeralHarnessType<E>>,
|
||||
slot: Slot,
|
||||
) -> (usize, SecretKey) {
|
||||
let state = &harness.chain.head_snapshot().beacon_state;
|
||||
|
||||
Reference in New Issue
Block a user