prysm-pulse/validator/client/testutil/helper.go
terencechain d17996f8b0
Update to V4 🚀 (#12134)
* Update V3 from V4

* Fix build v3 -> v4

* Update ssz

* Update beacon_chain.pb.go

* Fix formatter import

* Update update-mockgen.sh comment to v4

* Fix conflicts. Pass build and tests

* Fix test
2023-03-17 18:52:56 +00:00

29 lines
981 B
Go

package testutil
import (
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
ethpb "github.com/prysmaticlabs/prysm/v4/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([]primitives.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] = primitives.ValidatorIndex(i)
}
return resp
}