mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 11:57:18 +00:00
d17996f8b0
* 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
29 lines
981 B
Go
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 := ð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
|
|
}
|