mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 10:41:19 +00:00
5aac06f04e
* begin move * use same import path * imports * regen protos * regen * no rename * generate ssz * gaz * fmt * edit build file * imports * modify * remove generated files * remove protos * edit imports in prysm * beacon chain all builds * edit script * add generated pbs * add replace rules * license for ethereumapis protos * change visibility * fmt * update build files to gaz ignore * use proper form * edit imports * wrap block * revert scripts * revert go mod
29 lines
942 B
Go
29 lines
942 B
Go
package testutil
|
|
|
|
import (
|
|
types "github.com/prysmaticlabs/eth2-types"
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/shared/bytesutil"
|
|
)
|
|
|
|
// 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([]types.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] = types.ValidatorIndex(i)
|
|
}
|
|
|
|
return resp
|
|
}
|