standardize slot numbers (#2475)

This commit is contained in:
Raul Jordan 2019-05-03 00:28:09 -05:00 committed by Nishant Das
parent 9fb5bbd662
commit 94a1aca640
2 changed files with 4 additions and 4 deletions

View File

@ -224,7 +224,7 @@ func (vs *ValidatorServer) ValidatorStatus(
if eth1BlockNumBigInt == nil {
return &pb.ValidatorStatusResponse{
Status: pb.ValidatorStatus_UNKNOWN_STATUS,
ActivationEpoch: params.BeaconConfig().FarFutureEpoch,
ActivationEpoch: params.BeaconConfig().FarFutureEpoch - params.BeaconConfig().GenesisEpoch,
Eth1DepositBlockNumber: eth1BlockNumBigInt.Uint64(),
}, nil
}
@ -254,7 +254,7 @@ func (vs *ValidatorServer) ValidatorStatus(
if helpers.IsActiveValidator(val, currEpoch) {
return &pb.ValidatorStatusResponse{
Status: pb.ValidatorStatus_ACTIVE,
ActivationEpoch: val.ActivationEpoch,
ActivationEpoch: val.ActivationEpoch - params.BeaconConfig().GenesisEpoch,
Eth1DepositBlockNumber: eth1BlockNum,
DepositInclusionSlot: depositBlockSlot,
}, nil
@ -288,7 +288,7 @@ func (vs *ValidatorServer) ValidatorStatus(
Eth1DepositBlockNumber: eth1BlockNum,
PositionInActivationQueue: positionInQueue,
DepositInclusionSlot: depositBlockSlot,
ActivationEpoch: params.BeaconConfig().FarFutureEpoch,
ActivationEpoch: params.BeaconConfig().FarFutureEpoch - params.BeaconConfig().GenesisEpoch,
}
return res, nil

View File

@ -418,7 +418,7 @@ func TestValidatorStatus_Active(t *testing.T) {
depositBlockSlot := uint64(1194)
expected := &pb.ValidatorStatusResponse{
Status: pb.ValidatorStatus_ACTIVE,
ActivationEpoch: params.BeaconConfig().GenesisEpoch,
ActivationEpoch: 0,
DepositInclusionSlot: depositBlockSlot,
Eth1DepositBlockNumber: 0,
}