mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-09 04:21:22 +00:00
21 lines
598 B
Rust
21 lines
598 B
Rust
|
use super::EpochDuties;
|
||
|
use bls::PublicKey;
|
||
|
use types::Epoch;
|
||
|
|
||
|
#[derive(Debug, PartialEq, Clone)]
|
||
|
pub enum BeaconNodeError {
|
||
|
RemoteFailure(String),
|
||
|
}
|
||
|
|
||
|
/// Defines the methods required to obtain a validators shuffling from a Beacon Node.
|
||
|
pub trait BeaconNode: Send + Sync {
|
||
|
/// Get the shuffling for the given epoch and public key.
|
||
|
///
|
||
|
/// Returns Ok(None) if the public key is unknown, or the shuffling for that epoch is unknown.
|
||
|
fn request_shuffling(
|
||
|
&self,
|
||
|
epoch: Epoch,
|
||
|
public_key: &PublicKey,
|
||
|
) -> Result<Option<EpochDuties>, BeaconNodeError>;
|
||
|
}
|