mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-29 02:33:48 +00:00
Add new fns to ForkChoice and SlotClock
This commit is contained in:
@@ -6,9 +6,14 @@ pub use crate::testing_slot_clock::{Error as TestingSlotClockError, TestingSlotC
|
||||
use std::time::Duration;
|
||||
pub use types::Slot;
|
||||
|
||||
pub trait SlotClock: Send + Sync {
|
||||
pub trait SlotClock: Send + Sync + Sized {
|
||||
type Error;
|
||||
|
||||
/// Create a new `SlotClock`.
|
||||
///
|
||||
/// Returns an Error if `slot_duration_seconds == 0`.
|
||||
fn new(genesis_slot: Slot, genesis_seconds: u64, slot_duration_seconds: u64) -> Self;
|
||||
|
||||
fn present_slot(&self) -> Result<Option<Slot>, Self::Error>;
|
||||
|
||||
fn duration_to_next_slot(&self) -> Result<Option<Duration>, Self::Error>;
|
||||
|
||||
Reference in New Issue
Block a user