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

View File

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