Allow fork_choice and beacon_chain to compile

This commit is contained in:
Paul Hauner
2019-05-08 18:18:17 +10:00
parent 9fd8af8428
commit 51dc97ee42
8 changed files with 87 additions and 64 deletions

View File

@@ -1,22 +1,22 @@
use serde_derive::Serialize;
use types::{BeaconBlock, BeaconState, Hash256};
use types::{BeaconBlock, BeaconState, BeaconStateTypes, Hash256};
/// Represents some block and it's associated state. Generally, this will be used for tracking the
/// head, justified head and finalized head.
#[derive(Clone, Serialize, PartialEq, Debug)]
pub struct CheckPoint {
pub struct CheckPoint<B: BeaconStateTypes> {
pub beacon_block: BeaconBlock,
pub beacon_block_root: Hash256,
pub beacon_state: BeaconState,
pub beacon_state: BeaconState<B>,
pub beacon_state_root: Hash256,
}
impl CheckPoint {
impl<B: BeaconStateTypes> CheckPoint<B> {
/// Create a new checkpoint.
pub fn new(
beacon_block: BeaconBlock,
beacon_block_root: Hash256,
beacon_state: BeaconState,
beacon_state: BeaconState<B>,
beacon_state_root: Hash256,
) -> Self {
Self {
@@ -32,7 +32,7 @@ impl CheckPoint {
&mut self,
beacon_block: BeaconBlock,
beacon_block_root: Hash256,
beacon_state: BeaconState,
beacon_state: BeaconState<B>,
beacon_state_root: Hash256,
) {
self.beacon_block = beacon_block;