mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-07 02:02:18 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
29 lines
981 B
Go
29 lines
981 B
Go
package testutil
|
|
|
|
import (
|
|
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
|
|
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
|
|
ethpb "github.com/prysmaticlabs/prysm/v5/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 := ðpb.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] = ðpb.ValidatorStatusResponse{
|
|
Status: ethpb.ValidatorStatus_UNKNOWN_STATUS,
|
|
}
|
|
resp.Indices[i] = primitives.ValidatorIndex(i)
|
|
}
|
|
|
|
return resp
|
|
}
|