Skip to content

Commit

Permalink
build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rkapka committed May 27, 2024
1 parent 0218c98 commit 5d2eca5
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 48 deletions.
8 changes: 4 additions & 4 deletions cmd/validator/accounts/exit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestExitAccountsCli_OK(t *testing.T) {
}

mockNodeClient.EXPECT().
GetGenesis(gomock.Any(), gomock.Any()).
Genesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)

mockValidatorClient.EXPECT().
Expand Down Expand Up @@ -133,7 +133,7 @@ func TestExitAccountsCli_OK_AllPublicKeys(t *testing.T) {
}

mockNodeClient.EXPECT().
GetGenesis(gomock.Any(), gomock.Any()).
Genesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)

mockValidatorClient.EXPECT().
Expand Down Expand Up @@ -235,7 +235,7 @@ func TestExitAccountsCli_OK_ForceExit(t *testing.T) {
}

mockNodeClient.EXPECT().
GetGenesis(gomock.Any(), gomock.Any()).
Genesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)

mockValidatorClient.EXPECT().
Expand Down Expand Up @@ -324,7 +324,7 @@ func TestExitAccountsCli_WriteJSON_NoBroadcast(t *testing.T) {
}

mockNodeClient.EXPECT().
GetGenesis(gomock.Any(), gomock.Any()).
Genesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)

mockValidatorClient.EXPECT().
Expand Down
24 changes: 12 additions & 12 deletions validator/client/attest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestAttestToBlockHead_SubmitAttestation_RequestFailure(t *testing.T) {
Committee: make([]primitives.ValidatorIndex, 111),
ValidatorIndex: 0,
}}}
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
Expand Down Expand Up @@ -128,7 +128,7 @@ func TestAttestToBlockHead_AttestsCorrectly(t *testing.T) {
beaconBlockRoot := bytesutil.ToBytes32([]byte("A"))
targetRoot := bytesutil.ToBytes32([]byte("B"))
sourceRoot := bytesutil.ToBytes32([]byte("C"))
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
Expand Down Expand Up @@ -206,15 +206,15 @@ func TestAttestToBlockHead_BlocksDoubleAtt(t *testing.T) {
sourceRoot := bytesutil.ToBytes32([]byte("C"))
beaconBlockRoot2 := bytesutil.ToBytes32([]byte("D"))

m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
BeaconBlockRoot: beaconBlockRoot[:],
Target: &ethpb.Checkpoint{Root: targetRoot[:], Epoch: 4},
Source: &ethpb.Checkpoint{Root: sourceRoot[:], Epoch: 3},
}, nil)
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
Expand Down Expand Up @@ -261,15 +261,15 @@ func TestAttestToBlockHead_BlocksSurroundAtt(t *testing.T) {
targetRoot := bytesutil.ToBytes32([]byte("B"))
sourceRoot := bytesutil.ToBytes32([]byte("C"))

m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
BeaconBlockRoot: beaconBlockRoot[:],
Target: &ethpb.Checkpoint{Root: targetRoot[:], Epoch: 2},
Source: &ethpb.Checkpoint{Root: sourceRoot[:], Epoch: 1},
}, nil)
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
Expand Down Expand Up @@ -317,7 +317,7 @@ func TestAttestToBlockHead_BlocksSurroundedAtt(t *testing.T) {
targetRoot := bytesutil.ToBytes32([]byte("B"))
sourceRoot := bytesutil.ToBytes32([]byte("C"))

m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
Expand All @@ -339,7 +339,7 @@ func TestAttestToBlockHead_BlocksSurroundedAtt(t *testing.T) {
validator.SubmitAttestation(context.Background(), 30, pubKey)
require.LogsDoNotContain(t, hook, failedAttLocalProtectionErr)

m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
Expand All @@ -363,12 +363,12 @@ func TestAttestToBlockHead_DoesNotAttestBeforeDelay(t *testing.T) {
var pubKey [fieldparams.BLSPubkeyLength]byte
copy(pubKey[:], validatorKey.PublicKey().Marshal())
validator.genesisTime = uint64(prysmTime.Now().Unix())
m.validatorClient.EXPECT().GetDuties(
m.validatorClient.EXPECT().Duties(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.DutiesRequest{}),
).Times(0)

m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Times(0)
Expand Down Expand Up @@ -408,7 +408,7 @@ func TestAttestToBlockHead_DoesAttestAfterDelay(t *testing.T) {
ValidatorIndex: validatorIndex,
}}}

m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
Expand Down Expand Up @@ -450,7 +450,7 @@ func TestAttestToBlockHead_CorrectBitfieldLength(t *testing.T) {
Committee: committee,
ValidatorIndex: validatorIndex,
}}}
m.validatorClient.EXPECT().GetAttestationData(
m.validatorClient.EXPECT().AttestationData(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.AttestationDataRequest{}),
).Return(&ethpb.AttestationData{
Expand Down
2 changes: 1 addition & 1 deletion validator/client/beacon-api/activation.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (c *beaconApiValidatorClient) waitForActivation(ctx context.Context, in *et
type waitForActivationClient struct {
grpc.ClientStream
ctx context.Context
beaconApiValidatorClient
*beaconApiValidatorClient
*ethpb.ValidatorActivationRequest
lastRecvTime time.Time
}
Expand Down
2 changes: 1 addition & 1 deletion validator/client/beacon-api/stream_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type abstractSignedBlockResponseJson struct {
type streamBlocksAltairClient struct {
grpc.ClientStream
ctx context.Context
beaconApiClient beaconApiValidatorClient
beaconApiClient *beaconApiValidatorClient
streamBlocksRequest *ethpb.StreamBlocksRequest
prevBlockSlot primitives.Slot
pingDelay time.Duration
Expand Down
18 changes: 9 additions & 9 deletions validator/client/propose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func TestProposeBlock_RequestBlockFailed(t *testing.T) {
gomock.Any(), // epoch
).Return(&ethpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/)

m.validatorClient.EXPECT().GetBeaconBlock(
m.validatorClient.EXPECT().BeaconBlock(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.BlockRequest{}),
).Return(nil /*response*/, errors.New("uh oh"))
Expand Down Expand Up @@ -255,7 +255,7 @@ func TestProposeBlock_ProposeBlockFailed(t *testing.T) {
gomock.Any(), // epoch
).Return(&ethpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/)

m.validatorClient.EXPECT().GetBeaconBlock(
m.validatorClient.EXPECT().BeaconBlock(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.BlockRequest{}),
).Return(tt.block, nil /*err*/)
Expand Down Expand Up @@ -362,12 +362,12 @@ func TestProposeBlock_BlocksDoubleProposal(t *testing.T) {
gomock.Any(), // epoch
).Times(1).Return(&ethpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/)

m.validatorClient.EXPECT().GetBeaconBlock(
m.validatorClient.EXPECT().BeaconBlock(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.BlockRequest{}),
).Return(tt.blocks[0], nil /*err*/)

m.validatorClient.EXPECT().GetBeaconBlock(
m.validatorClient.EXPECT().BeaconBlock(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.BlockRequest{}),
).Return(tt.blocks[1], nil /*err*/)
Expand Down Expand Up @@ -414,7 +414,7 @@ func TestProposeBlock_BlocksDoubleProposal_After54KEpochs(t *testing.T) {
testBlock := util.NewBeaconBlock()
farFuture := params.BeaconConfig().SlotsPerEpoch.Mul(uint64(params.BeaconConfig().WeakSubjectivityPeriod + 9))
testBlock.Block.Slot = farFuture
m.validatorClient.EXPECT().GetBeaconBlock(
m.validatorClient.EXPECT().BeaconBlock(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.BlockRequest{}),
).Return(&ethpb.GenericBeaconBlock{
Expand All @@ -428,7 +428,7 @@ func TestProposeBlock_BlocksDoubleProposal_After54KEpochs(t *testing.T) {
var blockGraffiti [32]byte
copy(blockGraffiti[:], "someothergraffiti")
secondTestBlock.Block.Body.Graffiti = blockGraffiti[:]
m.validatorClient.EXPECT().GetBeaconBlock(
m.validatorClient.EXPECT().BeaconBlock(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.BlockRequest{}),
).Return(&ethpb.GenericBeaconBlock{
Expand Down Expand Up @@ -491,7 +491,7 @@ func TestProposeBlock_AllowsOrNotPastProposals(t *testing.T) {

blk := util.NewBeaconBlock()
blk.Block.Slot = slot
m.validatorClient.EXPECT().GetBeaconBlock(
m.validatorClient.EXPECT().BeaconBlock(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.BlockRequest{}),
).Return(&ethpb.GenericBeaconBlock{
Expand Down Expand Up @@ -520,7 +520,7 @@ func TestProposeBlock_AllowsOrNotPastProposals(t *testing.T) {

blk2 := util.NewBeaconBlock()
blk2.Block.Slot = tt.pastSlot
m.validatorClient.EXPECT().GetBeaconBlock(
m.validatorClient.EXPECT().BeaconBlock(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.BlockRequest{}),
).Return(&ethpb.GenericBeaconBlock{
Expand Down Expand Up @@ -683,7 +683,7 @@ func testProposeBlock(t *testing.T, graffiti []byte) {
gomock.Any(), // epoch
).Return(&ethpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/)

m.validatorClient.EXPECT().GetBeaconBlock(
m.validatorClient.EXPECT().BeaconBlock(
gomock.Any(), // ctx
gomock.AssignableToTypeOf(&ethpb.BlockRequest{}),
).DoAndReturn(func(ctx context.Context, req *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) {
Expand Down
28 changes: 14 additions & 14 deletions validator/client/sync_committee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestSubmitSyncCommitteeMessage_ValidatorDutiesRequestFailure(t *testing.T)
validator.duties = &ethpb.DutiesResponse{CurrentEpochDuties: []*ethpb.DutiesResponse_Duty{}}
defer finish()

m.validatorClient.EXPECT().GetSyncMessageBlockRoot(
m.validatorClient.EXPECT().SyncMessageBlockRoot(
gomock.Any(), // ctx
&emptypb.Empty{},
).Return(&ethpb.SyncMessageBlockRootResponse{
Expand Down Expand Up @@ -60,7 +60,7 @@ func TestSubmitSyncCommitteeMessage_BadDomainData(t *testing.T) {
}}

r := []byte{'a'}
m.validatorClient.EXPECT().GetSyncMessageBlockRoot(
m.validatorClient.EXPECT().SyncMessageBlockRoot(
gomock.Any(), // ctx
&emptypb.Empty{},
).Return(&ethpb.SyncMessageBlockRootResponse{
Expand Down Expand Up @@ -96,7 +96,7 @@ func TestSubmitSyncCommitteeMessage_CouldNotSubmit(t *testing.T) {
}}

r := []byte{'a'}
m.validatorClient.EXPECT().GetSyncMessageBlockRoot(
m.validatorClient.EXPECT().SyncMessageBlockRoot(
gomock.Any(), // ctx
&emptypb.Empty{},
).Return(&ethpb.SyncMessageBlockRootResponse{
Expand Down Expand Up @@ -141,7 +141,7 @@ func TestSubmitSyncCommitteeMessage_OK(t *testing.T) {
}}

r := []byte{'a'}
m.validatorClient.EXPECT().GetSyncMessageBlockRoot(
m.validatorClient.EXPECT().SyncMessageBlockRoot(
gomock.Any(), // ctx
&emptypb.Empty{},
).Return(&ethpb.SyncMessageBlockRootResponse{
Expand Down Expand Up @@ -191,7 +191,7 @@ func TestSubmitSignedContributionAndProof_ValidatorDutiesRequestFailure(t *testi
}
}

func TestSubmitSignedContributionAndProof_GetSyncSubcommitteeIndexFailure(t *testing.T) {
func TestSubmitSignedContributionAndProof_SyncSubcommitteeIndexFailure(t *testing.T) {
for _, isSlashingProtectionMinimal := range [...]bool{false, true} {
t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) {
hook := logTest.NewGlobal()
Expand All @@ -209,7 +209,7 @@ func TestSubmitSignedContributionAndProof_GetSyncSubcommitteeIndexFailure(t *tes

var pubKey [fieldparams.BLSPubkeyLength]byte
copy(pubKey[:], validatorKey.PublicKey().Marshal())
m.validatorClient.EXPECT().GetSyncSubcommitteeIndex(
m.validatorClient.EXPECT().SyncSubcommitteeIndex(
gomock.Any(), // ctx
&ethpb.SyncSubcommitteeIndexRequest{
Slot: 1,
Expand Down Expand Up @@ -241,7 +241,7 @@ func TestSubmitSignedContributionAndProof_NothingToDo(t *testing.T) {

var pubKey [fieldparams.BLSPubkeyLength]byte
copy(pubKey[:], validatorKey.PublicKey().Marshal())
m.validatorClient.EXPECT().GetSyncSubcommitteeIndex(
m.validatorClient.EXPECT().SyncSubcommitteeIndex(
gomock.Any(), // ctx
&ethpb.SyncSubcommitteeIndexRequest{
Slot: 1,
Expand Down Expand Up @@ -273,7 +273,7 @@ func TestSubmitSignedContributionAndProof_BadDomain(t *testing.T) {

var pubKey [fieldparams.BLSPubkeyLength]byte
copy(pubKey[:], validatorKey.PublicKey().Marshal())
m.validatorClient.EXPECT().GetSyncSubcommitteeIndex(
m.validatorClient.EXPECT().SyncSubcommitteeIndex(
gomock.Any(), // ctx
&ethpb.SyncSubcommitteeIndexRequest{
Slot: 1,
Expand Down Expand Up @@ -319,7 +319,7 @@ func TestSubmitSignedContributionAndProof_CouldNotGetContribution(t *testing.T)

var pubKey [fieldparams.BLSPubkeyLength]byte
copy(pubKey[:], validatorKey.PublicKey().Marshal())
m.validatorClient.EXPECT().GetSyncSubcommitteeIndex(
m.validatorClient.EXPECT().SyncSubcommitteeIndex(
gomock.Any(), // ctx
&ethpb.SyncSubcommitteeIndexRequest{
Slot: 1,
Expand All @@ -334,7 +334,7 @@ func TestSubmitSignedContributionAndProof_CouldNotGetContribution(t *testing.T)
SignatureDomain: make([]byte, 32),
}, nil)

m.validatorClient.EXPECT().GetSyncCommitteeContribution(
m.validatorClient.EXPECT().SyncCommitteeContribution(
gomock.Any(), // ctx
&ethpb.SyncCommitteeContributionRequest{
Slot: 1,
Expand Down Expand Up @@ -373,7 +373,7 @@ func TestSubmitSignedContributionAndProof_CouldNotSubmitContribution(t *testing.

var pubKey [fieldparams.BLSPubkeyLength]byte
copy(pubKey[:], validatorKey.PublicKey().Marshal())
m.validatorClient.EXPECT().GetSyncSubcommitteeIndex(
m.validatorClient.EXPECT().SyncSubcommitteeIndex(
gomock.Any(), // ctx
&ethpb.SyncSubcommitteeIndexRequest{
Slot: 1,
Expand All @@ -390,7 +390,7 @@ func TestSubmitSignedContributionAndProof_CouldNotSubmitContribution(t *testing.

aggBits := bitfield.NewBitvector128()
aggBits.SetBitAt(0, true)
m.validatorClient.EXPECT().GetSyncCommitteeContribution(
m.validatorClient.EXPECT().SyncCommitteeContribution(
gomock.Any(), // ctx
&ethpb.SyncCommitteeContributionRequest{
Slot: 1,
Expand Down Expand Up @@ -455,7 +455,7 @@ func TestSubmitSignedContributionAndProof_Ok(t *testing.T) {

var pubKey [fieldparams.BLSPubkeyLength]byte
copy(pubKey[:], validatorKey.PublicKey().Marshal())
m.validatorClient.EXPECT().GetSyncSubcommitteeIndex(
m.validatorClient.EXPECT().SyncSubcommitteeIndex(
gomock.Any(), // ctx
&ethpb.SyncSubcommitteeIndexRequest{
Slot: 1,
Expand All @@ -472,7 +472,7 @@ func TestSubmitSignedContributionAndProof_Ok(t *testing.T) {

aggBits := bitfield.NewBitvector128()
aggBits.SetBitAt(0, true)
m.validatorClient.EXPECT().GetSyncCommitteeContribution(
m.validatorClient.EXPECT().SyncCommitteeContribution(
gomock.Any(), // ctx
&ethpb.SyncCommitteeContributionRequest{
Slot: 1,
Expand Down
2 changes: 1 addition & 1 deletion validator/rpc/handlers_accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func TestServer_VoluntaryExit(t *testing.T) {
}

mockNodeClient.EXPECT().
GetGenesis(gomock.Any(), gomock.Any()).
Genesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)

mockValidatorClient.EXPECT().
Expand Down
6 changes: 3 additions & 3 deletions validator/rpc/handlers_beacon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
func TestGetBeaconStatus_NotConnected(t *testing.T) {
ctrl := gomock.NewController(t)
nodeClient := validatormock.NewMockNodeClient(ctrl)
nodeClient.EXPECT().GetSyncStatus(
nodeClient.EXPECT().SyncStatus(
gomock.Any(), // ctx
gomock.Any(),
).Return(nil /*response*/, errors.New("uh oh"))
Expand All @@ -48,12 +48,12 @@ func TestGetBeaconStatus_OK(t *testing.T) {
ctrl := gomock.NewController(t)
nodeClient := validatormock.NewMockNodeClient(ctrl)
chainClient := validatormock.NewMockChainClient(ctrl)
nodeClient.EXPECT().GetSyncStatus(
nodeClient.EXPECT().SyncStatus(
gomock.Any(), // ctx
gomock.Any(),
).Return(&ethpb.SyncStatus{Syncing: true}, nil)
timeStamp := timestamppb.New(time.Unix(0, 0))
nodeClient.EXPECT().GetGenesis(
nodeClient.EXPECT().Genesis(
gomock.Any(), // ctx
gomock.Any(),
).Return(&ethpb.Genesis{
Expand Down
Loading

0 comments on commit 5d2eca5

Please sign in to comment.