From 071e099203a8ed86a447fb712830c1f4e989211f Mon Sep 17 00:00:00 2001 From: Grant Wuerker Date: Wed, 12 Dec 2018 17:56:44 -0600 Subject: [PATCH] validator registration removed --- beacon_chain/types/src/chain_config.rs | 5 ++-- beacon_chain/types/src/lib.rs | 2 -- .../types/src/validator_registration.rs | 26 ------------------- 3 files changed, 3 insertions(+), 30 deletions(-) delete mode 100644 beacon_chain/types/src/validator_registration.rs diff --git a/beacon_chain/types/src/chain_config.rs b/beacon_chain/types/src/chain_config.rs index bcc565a75..68a2f5406 100644 --- a/beacon_chain/types/src/chain_config.rs +++ b/beacon_chain/types/src/chain_config.rs @@ -1,4 +1,4 @@ -use super::ValidatorRegistration; +use super::ValidatorRecord; #[derive(Debug, Clone, PartialEq)] pub struct ChainConfig { @@ -9,7 +9,8 @@ pub struct ChainConfig { pub max_validator_churn_quotient: u64, pub genesis_time: u64, pub slot_duration_millis: u64, - pub initial_validators: Vec, + // TODO: revisit this + pub initial_validators: Vec, } /* diff --git a/beacon_chain/types/src/lib.rs b/beacon_chain/types/src/lib.rs index 6ef752e04..4e883668c 100644 --- a/beacon_chain/types/src/lib.rs +++ b/beacon_chain/types/src/lib.rs @@ -18,7 +18,6 @@ pub mod shard_and_committee; pub mod shard_reassignment_record; pub mod special_record; pub mod validator_record; -pub mod validator_registration; use self::ethereum_types::{H160, H256, U256}; use std::collections::HashMap; @@ -36,7 +35,6 @@ pub use pending_attestation_record::PendingAttestationRecord; pub use shard_and_committee::ShardAndCommittee; pub use special_record::{SpecialRecord, SpecialRecordKind}; pub use validator_record::{ValidatorRecord, ValidatorStatus}; -pub use validator_registration::ValidatorRegistration; pub type Hash256 = H256; pub type Address = H160; diff --git a/beacon_chain/types/src/validator_registration.rs b/beacon_chain/types/src/validator_registration.rs deleted file mode 100644 index 139885b1c..000000000 --- a/beacon_chain/types/src/validator_registration.rs +++ /dev/null @@ -1,26 +0,0 @@ -use super::{Address, Hash256}; -use bls::{create_proof_of_possession, Keypair, PublicKey, Signature}; - -/// The information gathered from the PoW chain validator registration function. -#[derive(Debug, Clone, PartialEq)] -pub struct ValidatorRegistration { - pub pubkey: PublicKey, - pub withdrawal_shard: u16, - pub withdrawal_address: Address, - pub randao_commitment: Hash256, - pub proof_of_possession: Signature, -} - -impl ValidatorRegistration { - pub fn random() -> Self { - let keypair = Keypair::random(); - - Self { - pubkey: keypair.pk.clone(), - withdrawal_shard: 0, - withdrawal_address: Address::random(), - randao_commitment: Hash256::random(), - proof_of_possession: create_proof_of_possession(&keypair), - } - } -}