Update validator_inductor to use Slot newtype

This commit is contained in:
Paul Hauner 2019-02-07 09:54:45 +11:00
parent e7e8c20fff
commit b865768d3b
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6

View File

@ -1,5 +1,5 @@
use bls::verify_proof_of_possession; use bls::verify_proof_of_possession;
use types::{BeaconState, ChainSpec, Deposit, Validator}; use types::{BeaconState, ChainSpec, Deposit, Slot, Validator};
#[derive(Debug, PartialEq, Clone)] #[derive(Debug, PartialEq, Clone)]
pub enum ValidatorInductionError { pub enum ValidatorInductionError {
@ -41,15 +41,15 @@ pub fn process_deposit(
let validator = Validator { let validator = Validator {
pubkey: deposit_input.pubkey.clone(), pubkey: deposit_input.pubkey.clone(),
withdrawal_credentials: deposit_input.withdrawal_credentials, withdrawal_credentials: deposit_input.withdrawal_credentials,
proposer_slots: 0, proposer_slots: Slot::new(0),
activation_slot: spec.far_future_slot, activation_slot: spec.far_future_slot,
exit_slot: spec.far_future_slot, exit_slot: spec.far_future_slot,
withdrawal_slot: spec.far_future_slot, withdrawal_slot: spec.far_future_slot,
penalized_slot: spec.far_future_slot, penalized_slot: spec.far_future_slot,
exit_count: 0, exit_count: 0,
status_flags: None, status_flags: None,
latest_custody_reseed_slot: 0, latest_custody_reseed_slot: Slot::new(0),
penultimate_custody_reseed_slot: 0, penultimate_custody_reseed_slot: Slot::new(0),
}; };
let _index = state.validator_registry.len(); let _index = state.validator_registry.len();