mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Replace INTERVALS_PER_SLOT with explicit slot component times (#7944)
https://github.com/ethereum/consensus-specs/pull/4476 Co-Authored-By: Barnabas Busa <barnabas.busa@ethereum.org> Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com> Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu> Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com> Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -174,7 +174,7 @@ async fn base_altair_bellatrix_with_terminal_block_after_fork() {
|
||||
.unwrap();
|
||||
|
||||
// Add a slot duration to get to the next slot
|
||||
let timestamp = harness.get_timestamp_at_slot() + harness.spec.seconds_per_slot;
|
||||
let timestamp = harness.get_timestamp_at_slot() + harness.spec.get_slot_duration().as_secs();
|
||||
|
||||
harness
|
||||
.execution_block_generator()
|
||||
|
||||
@@ -103,7 +103,7 @@ async fn base_altair_bellatrix_capella() {
|
||||
.unwrap();
|
||||
|
||||
// Add a slot duration to get to the next slot
|
||||
let timestamp = harness.get_timestamp_at_slot() + harness.spec.seconds_per_slot;
|
||||
let timestamp = harness.get_timestamp_at_slot() + harness.spec.get_slot_duration().as_secs();
|
||||
harness
|
||||
.execution_block_generator()
|
||||
.modify_last_block(|block| {
|
||||
|
||||
@@ -3011,7 +3011,6 @@ async fn weak_subjectivity_sync_test(
|
||||
let temp2 = tempdir().unwrap();
|
||||
let store = get_store(&temp2);
|
||||
let spec = test_spec::<E>();
|
||||
let seconds_per_slot = spec.seconds_per_slot;
|
||||
|
||||
let kzg = get_kzg(&spec);
|
||||
|
||||
@@ -3025,7 +3024,7 @@ async fn weak_subjectivity_sync_test(
|
||||
let slot_clock = TestingSlotClock::new(
|
||||
Slot::new(0),
|
||||
Duration::from_secs(harness.chain.genesis_time),
|
||||
Duration::from_secs(seconds_per_slot),
|
||||
spec.get_slot_duration(),
|
||||
);
|
||||
slot_clock.set_slot(harness.get_current_slot().as_u64());
|
||||
|
||||
@@ -3940,8 +3939,6 @@ async fn revert_minority_fork_on_resume() {
|
||||
let mut spec2 = MinimalEthSpec::default_spec();
|
||||
spec2.altair_fork_epoch = Some(fork_epoch);
|
||||
|
||||
let seconds_per_slot = spec1.seconds_per_slot;
|
||||
|
||||
let all_validators = (0..validator_count).collect::<Vec<usize>>();
|
||||
|
||||
// Chain with no fork epoch configured.
|
||||
@@ -4061,7 +4058,7 @@ async fn revert_minority_fork_on_resume() {
|
||||
builder = builder
|
||||
.resume_from_db()
|
||||
.unwrap()
|
||||
.testing_slot_clock(Duration::from_secs(seconds_per_slot))
|
||||
.testing_slot_clock(spec2.get_slot_duration())
|
||||
.unwrap();
|
||||
builder
|
||||
.get_slot_clock()
|
||||
|
||||
Reference in New Issue
Block a user