mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 12:28:24 +00:00
Do project-wide s/epoch_length/slots_per_epoch/g
This commit is contained in:
@@ -3,14 +3,14 @@ use std::collections::HashMap;
|
||||
use types::{Epoch, Slot};
|
||||
|
||||
pub struct EpochMap {
|
||||
epoch_length: u64,
|
||||
slots_per_epoch: u64,
|
||||
pub map: HashMap<Epoch, Slot>,
|
||||
}
|
||||
|
||||
impl EpochMap {
|
||||
pub fn new(epoch_length: u64) -> Self {
|
||||
pub fn new(slots_per_epoch: u64) -> Self {
|
||||
Self {
|
||||
epoch_length,
|
||||
slots_per_epoch,
|
||||
map: HashMap::new(),
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ impl EpochMap {
|
||||
|
||||
impl DutiesReader for EpochMap {
|
||||
fn is_block_production_slot(&self, slot: Slot) -> Result<bool, DutiesReaderError> {
|
||||
let epoch = slot.epoch(self.epoch_length);
|
||||
let epoch = slot.epoch(self.slots_per_epoch);
|
||||
match self.map.get(&epoch) {
|
||||
Some(s) if *s == slot => Ok(true),
|
||||
Some(s) if *s != slot => Ok(false),
|
||||
|
||||
Reference in New Issue
Block a user