mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 21:07:18 +00:00
31 lines
752 B
Go
31 lines
752 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"
|
||
|
)
|
||
|
|
||
|
func TestFetchAccountStatuses_OK(t *testing.T) {
|
||
|
ctx := context.Background()
|
||
|
ctrl := gomock.NewController(t)
|
||
|
defer ctrl.Finish()
|
||
|
pubkeys := make([][]byte, 10000)
|
||
|
for i := 0; i < 10000; i++ {
|
||
|
pubkeys[i] = []byte{byte(i)}
|
||
|
}
|
||
|
|
||
|
mockClient := mock.NewMockBeaconNodeValidatorClient(ctrl)
|
||
|
mockClient.EXPECT().MultipleValidatorStatus(
|
||
|
gomock.Any(),
|
||
|
ðpb.MultipleValidatorStatusRequest{PublicKeys: pubkeys},
|
||
|
)
|
||
|
_, err := FetchAccountStatuses(ctx, mockClient, pubkeys)
|
||
|
if err != nil {
|
||
|
t.Fatalf("FetchAccountStatuses failed with error: %v.", err)
|
||
|
}
|
||
|
}
|