mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 23:04:53 +00:00
Update beacon_chain as per test bugs
This commit is contained in:
@@ -2,15 +2,16 @@ use beacon_chain::{block_production::Error as BlockProductionError, BeaconChain}
|
||||
use block_producer::{DutiesReader, DutiesReaderError};
|
||||
use db::ClientDB;
|
||||
use slot_clock::SlotClock;
|
||||
use std::sync::Arc;
|
||||
use types::PublicKey;
|
||||
|
||||
pub struct DirectDuties<'a, T: ClientDB, U: SlotClock> {
|
||||
beacon_chain: &'a BeaconChain<T, U>,
|
||||
pub struct DirectDuties<T: ClientDB, U: SlotClock> {
|
||||
beacon_chain: Arc<BeaconChain<T, U>>,
|
||||
pubkey: PublicKey,
|
||||
}
|
||||
|
||||
impl<'a, T: ClientDB, U: SlotClock> DirectDuties<'a, T, U> {
|
||||
pub fn new(pubkey: PublicKey, beacon_chain: &'a BeaconChain<T, U>) -> Self {
|
||||
impl<T: ClientDB, U: SlotClock> DirectDuties<T, U> {
|
||||
pub fn new(pubkey: PublicKey, beacon_chain: Arc<BeaconChain<T, U>>) -> Self {
|
||||
Self {
|
||||
beacon_chain,
|
||||
pubkey,
|
||||
@@ -18,11 +19,11 @@ impl<'a, T: ClientDB, U: SlotClock> DirectDuties<'a, T, U> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T: ClientDB, U: SlotClock> DutiesReader for DirectDuties<'a, T, U>
|
||||
impl<T: ClientDB, U: SlotClock> DutiesReader for DirectDuties<T, U>
|
||||
where
|
||||
BlockProductionError: From<<U>::Error>,
|
||||
{
|
||||
fn is_block_production_slot(&self, _epoch: u64, slot: u64) -> Result<bool, DutiesReaderError> {
|
||||
fn is_block_production_slot(&self, slot: u64) -> Result<bool, DutiesReaderError> {
|
||||
let validator_index = self
|
||||
.beacon_chain
|
||||
.validator_index(&self.pubkey)
|
||||
|
||||
Reference in New Issue
Block a user