Fix a logical typo in beacon_api/validator.getStatus

This commit is contained in:
Zahary Karadjov 2020-12-03 21:24:01 +02:00
parent d302c1d8ee
commit 7363bf3c7c
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 5 additions and 5 deletions

View File

@ -113,15 +113,15 @@ proc createStatusQuery(status: openArray[string]): Result[StatusQuery, string] =
proc getStatus(validator: Validator,
current_epoch: Epoch): Result[string, string] =
let actual_status = if validator.activation_epoch > current_epoch:
if validator.activation_epoch > current_epoch:
# pending
if validator.activation_eligibility_epoch == FAR_FUTURE_EPOCH:
ok("pending_initialized")
else:
# validator.activation_eligibility_epoch < FAR_FUTURE_EPOCH:
ok("pending_queued")
elif validator.activation_epoch <= current_epoch and
current_epoch < validator.exit_epoch:
elif (validator.activation_epoch <= current_epoch) and
(current_epoch < validator.exit_epoch):
# active
if validator.exit_epoch == FAR_FUTURE_EPOCH:
ok("active_ongoing")
@ -131,8 +131,8 @@ proc getStatus(validator: Validator,
else:
# validator.exit_epoch < FAR_FUTURE_EPOCH and validator.slashed:
ok("active_slashed")
elif validator.exit_epoch <= current_epoch and
current_epoch < validator.withdrawable_epoch:
elif (validator.exit_epoch <= current_epoch) and
(current_epoch < validator.withdrawable_epoch):
# exited
if not validator.slashed:
ok("exited_unslashed")