mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 18:32:42 +00:00
begin the transition to using ValidatorStatus as a distinct type
This commit is contained in:
@@ -62,7 +62,7 @@ pub fn update_validator_set(
|
||||
/*
|
||||
* Validator is pending activiation.
|
||||
*/
|
||||
x if x == ValidatorStatus::PendingActivation as u8 => {
|
||||
x if x == ValidatorStatus::PendingActivation => {
|
||||
let new_total_changed = total_changed
|
||||
.checked_add(deposit_size_gwei)
|
||||
.ok_or(UpdateValidatorSetError::ArithmeticOverflow)?;
|
||||
@@ -71,7 +71,7 @@ pub fn update_validator_set(
|
||||
* activate the validator.
|
||||
*/
|
||||
if new_total_changed <= max_allowable_change {
|
||||
v.status = ValidatorStatus::Active as u8;
|
||||
v.status = ValidatorStatus::Active;
|
||||
hasher.extend(i, &v.pubkey.as_bytes(), VALIDATOR_FLAG_ENTRY);
|
||||
total_changed = new_total_changed;
|
||||
} else {
|
||||
@@ -82,7 +82,7 @@ pub fn update_validator_set(
|
||||
/*
|
||||
* Validator is pending exit.
|
||||
*/
|
||||
x if x == ValidatorStatus::PendingExit as u8 => {
|
||||
x if x == ValidatorStatus::PendingExit => {
|
||||
let new_total_changed = total_changed
|
||||
.checked_add(v.balance)
|
||||
.ok_or(UpdateValidatorSetError::ArithmeticOverflow)?;
|
||||
@@ -91,7 +91,7 @@ pub fn update_validator_set(
|
||||
* exit the validator
|
||||
*/
|
||||
if new_total_changed <= max_allowable_change {
|
||||
v.status = ValidatorStatus::PendingWithdraw as u8;
|
||||
v.status = ValidatorStatus::PendingWithdraw;
|
||||
v.exit_slot = present_slot;
|
||||
hasher.extend(i, &v.pubkey.as_bytes(), VALIDATOR_FLAG_EXIT);
|
||||
total_changed = new_total_changed;
|
||||
|
||||
Reference in New Issue
Block a user