Merge branch 'master' into implement-shuffle

This commit is contained in:
Paul Hauner 2019-02-15 18:21:54 +11:00
commit 2affd305d9
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6

View File

@ -1,18 +1,20 @@
use crate::{ #[cfg(test)]
mod tests {
use crate::{
beacon_state::BeaconStateError, BeaconState, ChainSpec, Deposit, DepositData, DepositInput, beacon_state::BeaconStateError, BeaconState, ChainSpec, Deposit, DepositData, DepositInput,
Eth1Data, Hash256, Keypair, Eth1Data, Hash256, Keypair,
}; };
use bls::create_proof_of_possession; use bls::create_proof_of_possession;
struct BeaconStateTestBuilder { struct BeaconStateTestBuilder {
pub genesis_time: u64, pub genesis_time: u64,
pub initial_validator_deposits: Vec<Deposit>, pub initial_validator_deposits: Vec<Deposit>,
pub latest_eth1_data: Eth1Data, pub latest_eth1_data: Eth1Data,
pub spec: ChainSpec, pub spec: ChainSpec,
pub keypairs: Vec<Keypair>, pub keypairs: Vec<Keypair>,
} }
impl BeaconStateTestBuilder { impl BeaconStateTestBuilder {
pub fn with_random_validators(validator_count: usize) -> Self { pub fn with_random_validators(validator_count: usize) -> Self {
let genesis_time = 10_000_000; let genesis_time = 10_000_000;
let keypairs: Vec<Keypair> = (0..validator_count) let keypairs: Vec<Keypair> = (0..validator_count)
@ -59,11 +61,7 @@ impl BeaconStateTestBuilder {
&self.spec, &self.spec,
) )
} }
} }
#[cfg(test)]
mod tests {
use super::*;
#[test] #[test]
pub fn can_produce_genesis_block() { pub fn can_produce_genesis_block() {