Introduce Fork struct to block_producer

It's a pretty crappy solution, IMO. It shouldn't really belong in
"duties" but this gets the job done for now.
This commit is contained in:
Paul Hauner
2019-03-07 13:54:56 +11:00
parent 20ac1bf1f0
commit db3b6cba6d
6 changed files with 54 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
use crate::{DutiesReader, DutiesReaderError};
use std::collections::HashMap;
use types::{Epoch, Slot};
use types::{Epoch, Fork, Slot};
pub struct EpochMap {
slots_per_epoch: u64,
@@ -25,4 +25,12 @@ impl DutiesReader for EpochMap {
_ => Err(DutiesReaderError::UnknownEpoch),
}
}
fn fork(&self) -> Result<Fork, DutiesReaderError> {
Ok(Fork {
previous_version: 0,
current_version: 0,
epoch: Epoch::new(0),
})
}
}