prysm-pulse/validator/client/testutil/helper.go
Raul Jordan 84916672c6
Remove Eth2-Types Dependency in Prysm (#10578)
* replace eth2 types

* replace protos

* regen proto

* replace

* gaz

* deps

* amend

* regen proto

* mod

* gaz

* gaz

* ensure build

* ssz

* add dep

* no more eth2 types

* no more eth2

* remg

* all builds

* buidl

* tidy

* clean

* fmt

* val serv

* gaz

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2022-04-29 10:32:11 -04:00

29 lines
968 B
Go

package testutil
import (
types "github.com/prysmaticlabs/prysm/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/encoding/bytesutil"
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
)
// ActiveKey represents a public key whose status is ACTIVE.
var ActiveKey = bytesutil.ToBytes48([]byte("active"))
// GenerateMultipleValidatorStatusResponse prepares a response from the passed in keys.
func GenerateMultipleValidatorStatusResponse(pubkeys [][]byte) *ethpb.MultipleValidatorStatusResponse {
resp := &ethpb.MultipleValidatorStatusResponse{
PublicKeys: make([][]byte, len(pubkeys)),
Statuses: make([]*ethpb.ValidatorStatusResponse, len(pubkeys)),
Indices: make([]types.ValidatorIndex, len(pubkeys)),
}
for i, key := range pubkeys {
resp.PublicKeys[i] = key
resp.Statuses[i] = &ethpb.ValidatorStatusResponse{
Status: ethpb.ValidatorStatus_UNKNOWN_STATUS,
}
resp.Indices[i] = types.ValidatorIndex(i)
}
return resp
}