Update operations_pool for new BeaconStateTypes

This commit is contained in:
Paul Hauner
2019-05-08 17:07:26 +10:00
parent ae09a00090
commit 9fd8af8428
3 changed files with 65 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
use crate::*;
use fixed_len_vec::typenum::{Unsigned, U1024, U8, U8192};
pub trait BeaconStateTypes {
pub trait BeaconStateTypes: Default {
type ShardCount: Unsigned + Clone + Sync + Send;
type SlotsPerHistoricalRoot: Unsigned + Clone + Sync + Send;
type LatestRandaoMixesLength: Unsigned + Clone + Sync + Send;
@@ -11,7 +11,7 @@ pub trait BeaconStateTypes {
fn spec() -> ChainSpec;
}
#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Debug, Default)]
pub struct FoundationStateTypes;
impl BeaconStateTypes for FoundationStateTypes {
@@ -28,7 +28,7 @@ impl BeaconStateTypes for FoundationStateTypes {
pub type FoundationBeaconState = BeaconState<FoundationStateTypes>;
#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Debug, Default)]
pub struct FewValidatorsStateTypes;
impl BeaconStateTypes for FewValidatorsStateTypes {

View File

@@ -1,7 +1,6 @@
use crate::test_utils::TestRandom;
use crate::Hash256;
use crate::*;
use crate::beacon_state::BeaconStateTypes;
use fixed_len_vec::FixedLenVec;
use serde_derive::{Deserialize, Serialize};
use ssz_derive::{Decode, Encode};
@@ -31,7 +30,6 @@ pub struct HistoricalBatch<T: BeaconStateTypes> {
#[cfg(test)]
mod tests {
use super::*;
use crate::beacon_state::beacon_state_types::FoundationStateTypes;
pub type FoundationHistoricalBatch = HistoricalBatch<FoundationStateTypes>;