Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Substantial VC cleanup #13593

Merged
merged 13 commits into from
May 21, 2024
Merged
40 changes: 20 additions & 20 deletions cmd/validator/accounts/exit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
func TestExitAccountsCli_OK(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockValidatorClient := validatormock.NewMockValidatorClient(ctrl)
coord := validatormock.NewMockCoordinator(ctrl)
mockNodeClient := validatormock.NewMockNodeClient(ctrl)

mockValidatorClient.EXPECT().
coord.EXPECT().
ValidatorIndex(gomock.Any(), gomock.Any()).
Return(&ethpb.ValidatorIndexResponse{Index: 1}, nil)

Expand All @@ -40,11 +40,11 @@ func TestExitAccountsCli_OK(t *testing.T) {
GetGenesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)

mockValidatorClient.EXPECT().
coord.EXPECT().
DomainData(gomock.Any(), gomock.Any()).
Return(&ethpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil)

mockValidatorClient.EXPECT().
coord.EXPECT().
ProposeExit(gomock.Any(), gomock.AssignableToTypeOf(&ethpb.SignedVoluntaryExit{})).
Return(&ethpb.ProposeExitResponse{}, nil)

Expand Down Expand Up @@ -99,7 +99,7 @@ func TestExitAccountsCli_OK(t *testing.T) {
require.NotNil(t, formattedPubKeys)

cfg := accounts.PerformExitCfg{
ValidatorClient: mockValidatorClient,
Coordinator: coord,
NodeClient: mockNodeClient,
Keymanager: km,
RawPubKeys: rawPubKeys,
Expand All @@ -116,14 +116,14 @@ func TestExitAccountsCli_OK(t *testing.T) {
func TestExitAccountsCli_OK_AllPublicKeys(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockValidatorClient := validatormock.NewMockValidatorClient(ctrl)
coord := validatormock.NewMockCoordinator(ctrl)
mockNodeClient := validatormock.NewMockNodeClient(ctrl)

mockValidatorClient.EXPECT().
coord.EXPECT().
ValidatorIndex(gomock.Any(), gomock.Any()).
Return(&ethpb.ValidatorIndexResponse{Index: 0}, nil)

mockValidatorClient.EXPECT().
coord.EXPECT().
ValidatorIndex(gomock.Any(), gomock.Any()).
Return(&ethpb.ValidatorIndexResponse{Index: 1}, nil)

Expand All @@ -136,12 +136,12 @@ func TestExitAccountsCli_OK_AllPublicKeys(t *testing.T) {
GetGenesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)

mockValidatorClient.EXPECT().
coord.EXPECT().
DomainData(gomock.Any(), gomock.Any()).
Times(2).
Return(&ethpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil)

mockValidatorClient.EXPECT().
coord.EXPECT().
ProposeExit(gomock.Any(), gomock.AssignableToTypeOf(&ethpb.SignedVoluntaryExit{})).
Times(2).
Return(&ethpb.ProposeExitResponse{}, nil)
Expand Down Expand Up @@ -199,7 +199,7 @@ func TestExitAccountsCli_OK_AllPublicKeys(t *testing.T) {
require.NotNil(t, formattedPubKeys)

cfg := accounts.PerformExitCfg{
ValidatorClient: mockValidatorClient,
Coordinator: coord,
NodeClient: mockNodeClient,
Keymanager: km,
RawPubKeys: rawPubKeys,
Expand All @@ -222,10 +222,10 @@ func TestExitAccountsCli_OK_AllPublicKeys(t *testing.T) {
func TestExitAccountsCli_OK_ForceExit(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockValidatorClient := validatormock.NewMockValidatorClient(ctrl)
coord := validatormock.NewMockCoordinator(ctrl)
mockNodeClient := validatormock.NewMockNodeClient(ctrl)

mockValidatorClient.EXPECT().
coord.EXPECT().
ValidatorIndex(gomock.Any(), gomock.Any()).
Return(&ethpb.ValidatorIndexResponse{Index: 1}, nil)

Expand All @@ -238,11 +238,11 @@ func TestExitAccountsCli_OK_ForceExit(t *testing.T) {
GetGenesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)

mockValidatorClient.EXPECT().
coord.EXPECT().
DomainData(gomock.Any(), gomock.Any()).
Return(&ethpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil)

mockValidatorClient.EXPECT().
coord.EXPECT().
ProposeExit(gomock.Any(), gomock.AssignableToTypeOf(&ethpb.SignedVoluntaryExit{})).
Return(&ethpb.ProposeExitResponse{}, nil)

Expand Down Expand Up @@ -294,7 +294,7 @@ func TestExitAccountsCli_OK_ForceExit(t *testing.T) {
require.NotNil(t, formattedPubKeys)

cfg := accounts.PerformExitCfg{
ValidatorClient: mockValidatorClient,
Coordinator: coord,
NodeClient: mockNodeClient,
Keymanager: km,
RawPubKeys: rawPubKeys,
Expand All @@ -311,10 +311,10 @@ func TestExitAccountsCli_OK_ForceExit(t *testing.T) {
func TestExitAccountsCli_WriteJSON_NoBroadcast(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockValidatorClient := validatormock.NewMockValidatorClient(ctrl)
coord := validatormock.NewMockCoordinator(ctrl)
mockNodeClient := validatormock.NewMockNodeClient(ctrl)

mockValidatorClient.EXPECT().
coord.EXPECT().
ValidatorIndex(gomock.Any(), gomock.Any()).
Return(&ethpb.ValidatorIndexResponse{Index: 1}, nil)

Expand All @@ -327,7 +327,7 @@ func TestExitAccountsCli_WriteJSON_NoBroadcast(t *testing.T) {
GetGenesis(gomock.Any(), gomock.Any()).
Return(&ethpb.Genesis{GenesisTime: genesisTime}, nil)

mockValidatorClient.EXPECT().
coord.EXPECT().
DomainData(gomock.Any(), gomock.Any()).
Return(&ethpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil)

Expand Down Expand Up @@ -381,7 +381,7 @@ func TestExitAccountsCli_WriteJSON_NoBroadcast(t *testing.T) {
out := path.Join(bazel.TestTmpDir(), "exits")

cfg := accounts.PerformExitCfg{
ValidatorClient: mockValidatorClient,
Coordinator: coord,
NodeClient: mockNodeClient,
Keymanager: km,
RawPubKeys: rawPubKeys,
Expand Down
4 changes: 2 additions & 2 deletions testing/validator-mock/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ package(default_testonly = True)
go_library(
name = "go_default_library",
srcs = [
"beacon_chain_client_mock.go",
"chain_client_mock.go",
"node_client_mock.go",
"prysm_beacon_chain_client_mock.go",
"prysm_chain_client_mock.go",
"validator_client_mock.go",
],
importpath = "github.com/prysmaticlabs/prysm/v4/testing/validator-mock",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 0 additions & 52 deletions testing/validator-mock/prysm_beacon_chain_client_mock.go

This file was deleted.

Loading
Loading