Fix validator's activity api handler.
This commit is contained in:
parent
4ecda9a317
commit
c62a450802
|
@ -1937,7 +1937,12 @@ proc getValidatorsActivity*(
|
||||||
let resp = vc.onceToAll(RestPlainResponse, SlotDuration,
|
let resp = vc.onceToAll(RestPlainResponse, SlotDuration,
|
||||||
{BeaconNodeRole.Duties},
|
{BeaconNodeRole.Duties},
|
||||||
getValidatorsActivity(it, epoch, validators))
|
getValidatorsActivity(it, epoch, validators))
|
||||||
|
if len(resp.data) == 0:
|
||||||
case resp.status
|
case resp.status
|
||||||
|
of ApiOperation.Success:
|
||||||
|
# This should not be happened, there should be present at least one
|
||||||
|
# successfull response.
|
||||||
|
return GetValidatorsActivityResponse()
|
||||||
of ApiOperation.Timeout:
|
of ApiOperation.Timeout:
|
||||||
debug "Unable to perform validator's activity request in time",
|
debug "Unable to perform validator's activity request in time",
|
||||||
timeout = SlotDuration
|
timeout = SlotDuration
|
||||||
|
@ -1948,7 +1953,7 @@ proc getValidatorsActivity*(
|
||||||
of ApiOperation.Failure:
|
of ApiOperation.Failure:
|
||||||
debug "Unexpected error happened while receiving validator's activity"
|
debug "Unexpected error happened while receiving validator's activity"
|
||||||
return GetValidatorsActivityResponse()
|
return GetValidatorsActivityResponse()
|
||||||
of ApiOperation.Success:
|
else:
|
||||||
var activities: seq[RestActivityItem]
|
var activities: seq[RestActivityItem]
|
||||||
for apiResponse in resp.data:
|
for apiResponse in resp.data:
|
||||||
if apiResponse.data.isErr():
|
if apiResponse.data.isErr():
|
||||||
|
|
Loading…
Reference in New Issue