Merge branch 'update-block-and-state' into genesis_tests

This commit is contained in:
Kirk Baird
2019-01-15 11:09:26 +11:00
18 changed files with 137 additions and 70 deletions

View File

@@ -16,6 +16,9 @@ pub fn genesis_beacon_block(state_root: Hash256, spec: &ChainSpec) -> BeaconBloc
proposer_slashings: vec![],
casper_slashings: vec![],
attestations: vec![],
custody_reseeds: vec![],
custody_challenges: vec![],
custody_responses: vec![],
deposits: vec![],
exits: vec![],
},

View File

@@ -47,11 +47,16 @@ pub fn genesis_beacon_state(spec: &ChainSpec) -> Result<BeaconState, Error> {
/*
* Randomness and committees
*/
randao_mix: spec.zero_hash,
next_seed: spec.zero_hash,
latest_randao_mixes: vec![spec.zero_hash; spec.latest_randao_mixes_length as usize],
latest_vdf_outputs: vec![
spec.zero_hash;
(spec.latest_randao_mixes_length / spec.epoch_length) as usize
],
shard_committees_at_slots: vec![],
persistent_committees: vec![],
persistent_committee_reassignments: vec![],
/*
* Custody challenges
*/
custody_challenges: vec![],
/*
* Finality
*/
@@ -66,6 +71,7 @@ pub fn genesis_beacon_state(spec: &ChainSpec) -> Result<BeaconState, Error> {
latest_block_roots: vec![spec.zero_hash; spec.epoch_length as usize],
latest_penalized_exit_balances: vec![],
latest_attestations: vec![],
batched_block_roots: vec![],
/*
* PoW receipt root
*/

View File

@@ -3,8 +3,8 @@ extern crate types;
extern crate validator_induction;
extern crate validator_shuffling;
mod beacon_state;
mod beacon_block;
mod beacon_state;
pub use crate::beacon_block::genesis_beacon_block;
pub use crate::beacon_state::{genesis_beacon_state, Error as GenesisError};