From 94a1aca640026070497b7b0506aaf6bbc579f03a Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Fri, 3 May 2019 00:28:09 -0500 Subject: [PATCH] standardize slot numbers (#2475) --- beacon-chain/rpc/validator_server.go | 6 +++--- beacon-chain/rpc/validator_server_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon-chain/rpc/validator_server.go b/beacon-chain/rpc/validator_server.go index b53086f12..7ff1dcefd 100644 --- a/beacon-chain/rpc/validator_server.go +++ b/beacon-chain/rpc/validator_server.go @@ -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 diff --git a/beacon-chain/rpc/validator_server_test.go b/beacon-chain/rpc/validator_server_test.go index 37de87786..d00588280 100644 --- a/beacon-chain/rpc/validator_server_test.go +++ b/beacon-chain/rpc/validator_server_test.go @@ -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, }