prysm-pulse/validator/accounts/v1/status_test.go
Victor Farazdagi 0006377aec
Applies assertion funcs to validator tests (#6694)
* Applies assertion funcs to validator/keymanager/v1 tests
* gazelle
* Applies assertion funcs to validator/keymanager/v2 tests
* Applies assertion funcs to validator/misc tests
* Applies assertion funcs to validator/misc tests
* Merge branch 'master' into validator-apply-testutils-assertions
* gazelle
* Merge branch 'master' into validator-apply-testutils-assertions
* Merge branch 'master' into validator-apply-testutils-assertions
* Merge refs/heads/master into validator-apply-testutils-assertions
2020-07-23 01:13:52 +00:00

32 lines
952 B
Go

package accounts
import (
"context"
"testing"
"github.com/golang/mock/gomock"
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
"github.com/prysmaticlabs/prysm/shared/mock"
"github.com/prysmaticlabs/prysm/shared/testutil/require"
)
func TestFetchAccountStatuses_OK(t *testing.T) {
ctx := context.Background()
ctrl := gomock.NewController(t)
defer ctrl.Finish()
pubkeys := make([][]byte, 10000)
indices := make([]uint64, 10000)
for i := 0; i < 10000; i++ {
pubkeys[i] = []byte{byte(i)}
indices[i] = uint64(i)
}
mockClient := mock.NewMockBeaconNodeValidatorClient(ctrl)
mockClient.EXPECT().MultipleValidatorStatus(
gomock.Any(),
&ethpb.MultipleValidatorStatusRequest{PublicKeys: pubkeys},
).Return(&ethpb.MultipleValidatorStatusResponse{PublicKeys: pubkeys, Indices: indices}, nil /*err*/)
_, err := FetchAccountStatuses(ctx, mockClient, pubkeys)
require.NoError(t, err, "FetchAccountStatuses failed with error")
}