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

View File

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