Fix some BeaconState API changes in state proc.

This commit is contained in:
Paul Hauner
2019-05-19 15:56:24 +10:00
parent 9eb8c7411f
commit 03849de319
11 changed files with 32 additions and 36 deletions

View File

@@ -19,7 +19,7 @@ pub fn initiate_validator_exit<T: EthSpec>(
}
// Compute exit queue epoch
let delayed_epoch = state.get_delayed_activation_exit_epoch(state.current_epoch(spec), spec);
let delayed_epoch = state.get_delayed_activation_exit_epoch(state.current_epoch(), spec);
let mut exit_queue_epoch = state
.exit_cache
.max_epoch()

View File

@@ -12,7 +12,7 @@ pub fn exit_validator<T: EthSpec>(
return Err(Error::UnknownValidator);
}
let delayed_epoch = state.get_delayed_activation_exit_epoch(state.current_epoch(spec), spec);
let delayed_epoch = state.get_delayed_activation_exit_epoch(state.current_epoch(), spec);
if state.validator_registry[validator_index].exit_epoch > delayed_epoch {
state.validator_registry[validator_index].exit_epoch = delayed_epoch;

View File

@@ -14,7 +14,7 @@ pub fn slash_validator<T: EthSpec>(
return Err(BeaconStateError::UnknownValidator);
}
let current_epoch = state.current_epoch(spec);
let current_epoch = state.current_epoch();
initiate_validator_exit(state, slashed_index, spec)?;