Remote Keymanager: Proto Definitions and Basic Client Implementation (#6526)

* begin on the proto definitions
* define remote signer service protos
* basic implementation
* remote keymanager docs
* finalize remote client doc
* amend response
* fix proto defs
* test new and begin test sign
* test sign done
* Merge branch 'master' into remote-keymanager-v2
* remote oneof
* rename
* Merge branch 'remote-keymanager-v2' of github.com:prysmaticlabs/prysm into remote-keymanager-v2
* fix build
* Merge refs/heads/master into remote-keymanager-v2
* viz
* Merge branch 'remote-keymanager-v2' of github.com:prysmaticlabs/prysm into remote-keymanager-v2
* Merge refs/heads/master into remote-keymanager-v2
* Merge refs/heads/master into remote-keymanager-v2
* Update validator/keymanager/v2/remote/remote_test.go

Co-authored-by: Ivan Martinez <ivanthegreatdev@gmail.com>
* Update validator/accounts/v2/wallet.go

Co-authored-by: Ivan Martinez <ivanthegreatdev@gmail.com>
* fmt
This commit is contained in:
Raul Jordan
2020-07-10 00:49:56 -05:00
committed by GitHub
parent ac79819077
commit 2c9474ab7f
23 changed files with 1809 additions and 203 deletions

View File

@@ -2,20 +2,26 @@ load("@prysm//tools/go:def.bzl", "go_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
# gazelle:ignore
proto_library(
name = "ethereum_validator_account_proto",
name = "ethereum_validator_accounts_v2_proto",
srcs = ["keymanager.proto"],
visibility = ["//visibility:public"],
deps = [
"@gogo_special_proto//github.com/gogo/protobuf/gogoproto",
"@com_google_protobuf//:empty_proto",
"@go_googleapis//google/api:annotations_proto",
],
)
go_proto_library(
name = "ethereum_validator_account_go_proto",
compilers = ["@prysm//:grpc_proto_compiler"],
importpath = "github.com/prysmaticlabs/prysm/proto/validator/accounts/v2",
proto = ":ethereum_validator_accounts_v2_proto",
visibility = ["//visibility:public"],
deps = [
"@go_googleapis//google/api:annotations_go_proto",
],
)
go_library(
@@ -24,9 +30,3 @@ go_library(
importpath = "github.com/prysmaticlabs/prysm/proto/validator/accounts/v2",
visibility = ["//visibility:public"],
)
proto_library(
name = "ethereum_validator_accounts_v2_proto",
srcs = ["keymanager.proto"],
visibility = ["//visibility:public"],
)

View File

@@ -1,12 +1,20 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: proto/validator/accounts/v2/keymanager.proto
package ethereum_validator_accounts_v2
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
@@ -18,11 +26,89 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type SignResponse_Status int32
const (
SignResponse_UNKNOWN SignResponse_Status = 0
SignResponse_SUCCEEDED SignResponse_Status = 1
SignResponse_DENIED SignResponse_Status = 2
SignResponse_FAILED SignResponse_Status = 3
)
var SignResponse_Status_name = map[int32]string{
0: "UNKNOWN",
1: "SUCCEEDED",
2: "DENIED",
3: "FAILED",
}
var SignResponse_Status_value = map[string]int32{
"UNKNOWN": 0,
"SUCCEEDED": 1,
"DENIED": 2,
"FAILED": 3,
}
func (x SignResponse_Status) String() string {
return proto.EnumName(SignResponse_Status_name, int32(x))
}
func (SignResponse_Status) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_795e98bd0a473d79, []int{2, 0}
}
type ListPublicKeysResponse struct {
ValidatingPublicKeys [][]byte `protobuf:"bytes,2,rep,name=validating_public_keys,json=validatingPublicKeys,proto3" json:"validating_public_keys,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListPublicKeysResponse) Reset() { *m = ListPublicKeysResponse{} }
func (m *ListPublicKeysResponse) String() string { return proto.CompactTextString(m) }
func (*ListPublicKeysResponse) ProtoMessage() {}
func (*ListPublicKeysResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_795e98bd0a473d79, []int{0}
}
func (m *ListPublicKeysResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ListPublicKeysResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ListPublicKeysResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ListPublicKeysResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListPublicKeysResponse.Merge(m, src)
}
func (m *ListPublicKeysResponse) XXX_Size() int {
return m.Size()
}
func (m *ListPublicKeysResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ListPublicKeysResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ListPublicKeysResponse proto.InternalMessageInfo
func (m *ListPublicKeysResponse) GetValidatingPublicKeys() [][]byte {
if m != nil {
return m.ValidatingPublicKeys
}
return nil
}
type SignRequest struct {
PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
SigningRoot []byte `protobuf:"bytes,2,opt,name=signing_root,json=signingRoot,proto3" json:"signing_root,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -32,20 +118,28 @@ func (m *SignRequest) Reset() { *m = SignRequest{} }
func (m *SignRequest) String() string { return proto.CompactTextString(m) }
func (*SignRequest) ProtoMessage() {}
func (*SignRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_795e98bd0a473d79, []int{0}
return fileDescriptor_795e98bd0a473d79, []int{1}
}
func (m *SignRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SignRequest.Unmarshal(m, b)
return m.Unmarshal(b)
}
func (m *SignRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SignRequest.Marshal(b, m, deterministic)
if deterministic {
return xxx_messageInfo_SignRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *SignRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SignRequest.Merge(m, src)
}
func (m *SignRequest) XXX_Size() int {
return xxx_messageInfo_SignRequest.Size(m)
return m.Size()
}
func (m *SignRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SignRequest.DiscardUnknown(m)
@@ -60,15 +154,73 @@ func (m *SignRequest) GetPublicKey() []byte {
return nil
}
func (m *SignRequest) GetData() []byte {
func (m *SignRequest) GetSigningRoot() []byte {
if m != nil {
return m.Data
return m.SigningRoot
}
return nil
}
type SignResponse struct {
Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"`
Status SignResponse_Status `protobuf:"varint,2,opt,name=status,proto3,enum=ethereum.validator.accounts.v2.SignResponse_Status" json:"status,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SignResponse) Reset() { *m = SignResponse{} }
func (m *SignResponse) String() string { return proto.CompactTextString(m) }
func (*SignResponse) ProtoMessage() {}
func (*SignResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_795e98bd0a473d79, []int{2}
}
func (m *SignResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SignResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SignResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *SignResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_SignResponse.Merge(m, src)
}
func (m *SignResponse) XXX_Size() int {
return m.Size()
}
func (m *SignResponse) XXX_DiscardUnknown() {
xxx_messageInfo_SignResponse.DiscardUnknown(m)
}
var xxx_messageInfo_SignResponse proto.InternalMessageInfo
func (m *SignResponse) GetSignature() []byte {
if m != nil {
return m.Signature
}
return nil
}
func (m *SignResponse) GetStatus() SignResponse_Status {
if m != nil {
return m.Status
}
return SignResponse_UNKNOWN
}
func init() {
proto.RegisterEnum("ethereum.validator.accounts.v2.SignResponse_Status", SignResponse_Status_name, SignResponse_Status_value)
proto.RegisterType((*ListPublicKeysResponse)(nil), "ethereum.validator.accounts.v2.ListPublicKeysResponse")
proto.RegisterType((*SignRequest)(nil), "ethereum.validator.accounts.v2.SignRequest")
proto.RegisterType((*SignResponse)(nil), "ethereum.validator.accounts.v2.SignResponse")
}
func init() {
@@ -76,15 +228,740 @@ func init() {
}
var fileDescriptor_795e98bd0a473d79 = []byte{
// 147 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x29, 0x28, 0xca, 0x2f,
0xc9, 0xd7, 0x2f, 0x4b, 0xcc, 0xc9, 0x4c, 0x49, 0x2c, 0xc9, 0x2f, 0xd2, 0x4f, 0x4c, 0x4e, 0xce,
0x2f, 0xcd, 0x2b, 0x29, 0xd6, 0x2f, 0x33, 0xd2, 0xcf, 0x4e, 0xad, 0xcc, 0x4d, 0xcc, 0x4b, 0x4c,
0x4f, 0x2d, 0xd2, 0x03, 0x2b, 0x13, 0x92, 0x4b, 0x2d, 0xc9, 0x48, 0x2d, 0x4a, 0x2d, 0xcd, 0xd5,
0x83, 0x6b, 0xd0, 0x83, 0x69, 0xd0, 0x2b, 0x33, 0x52, 0x72, 0xe0, 0xe2, 0x0e, 0xce, 0x4c, 0xcf,
0x0b, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0x92, 0xe5, 0xe2, 0x2a, 0x28, 0x4d, 0xca, 0xc9,
0x4c, 0x8e, 0xcf, 0x4e, 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x09, 0xe2, 0x84, 0x88, 0x78,
0xa7, 0x56, 0x0a, 0x09, 0x71, 0xb1, 0xa4, 0x24, 0x96, 0x24, 0x4a, 0x30, 0x81, 0x25, 0xc0, 0xec,
0x24, 0x36, 0xb0, 0x45, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xec, 0x94, 0x24, 0x3b, 0x98,
0x00, 0x00, 0x00,
// 450 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xdd, 0x8a, 0xd3, 0x40,
0x18, 0x75, 0xb2, 0x52, 0xe9, 0xd7, 0x28, 0x65, 0x90, 0x12, 0x62, 0x0d, 0x35, 0x78, 0xb1, 0xe0,
0x32, 0x81, 0xae, 0x78, 0xe5, 0x8d, 0x6e, 0x22, 0x2c, 0x5d, 0xb2, 0x92, 0xb2, 0x7a, 0xb9, 0x4c,
0xeb, 0x67, 0x0c, 0xdb, 0xce, 0xc4, 0xcc, 0xa4, 0xd0, 0x5b, 0x7d, 0x01, 0xc1, 0x87, 0xf0, 0x11,
0x7c, 0x05, 0x2f, 0x05, 0x5f, 0x40, 0x8a, 0x0f, 0x22, 0x99, 0x24, 0xad, 0x42, 0xf1, 0xe7, 0x2e,
0xf9, 0xbe, 0x73, 0xce, 0x77, 0x72, 0x4e, 0xe0, 0x28, 0x2f, 0xa4, 0x96, 0xc1, 0x8a, 0x2f, 0xb2,
0x57, 0x5c, 0xcb, 0x22, 0xe0, 0xf3, 0xb9, 0x2c, 0x85, 0x56, 0xc1, 0x6a, 0x1c, 0x5c, 0xe1, 0x7a,
0xc9, 0x05, 0x4f, 0xb1, 0x60, 0x06, 0x46, 0x3d, 0xd4, 0x6f, 0xb0, 0xc0, 0x72, 0xc9, 0xb6, 0x04,
0xd6, 0x12, 0xd8, 0x6a, 0xec, 0x0e, 0x53, 0x29, 0xd3, 0x05, 0x06, 0x3c, 0xcf, 0x02, 0x2e, 0x84,
0xd4, 0x5c, 0x67, 0x52, 0xa8, 0x9a, 0xed, 0xde, 0x69, 0xb6, 0xe6, 0x6d, 0x56, 0xbe, 0x0e, 0x70,
0x99, 0xeb, 0x75, 0xbd, 0xf4, 0x63, 0x18, 0x9c, 0x65, 0x4a, 0x3f, 0x2f, 0x67, 0x8b, 0x6c, 0x3e,
0xc1, 0xb5, 0x4a, 0x50, 0xe5, 0x52, 0x28, 0xa4, 0x0f, 0x61, 0xd0, 0x5c, 0xcb, 0x44, 0x7a, 0x99,
0x1b, 0xc0, 0xe5, 0x15, 0xae, 0x95, 0x63, 0x8d, 0x0e, 0x0e, 0xed, 0xe4, 0xf6, 0x6e, 0xbb, 0x63,
0xfb, 0xe7, 0xd0, 0x9b, 0x66, 0xa9, 0x48, 0xf0, 0x6d, 0x89, 0x4a, 0xd3, 0xbb, 0x00, 0x3b, 0xa6,
0x43, 0x46, 0xe4, 0xd0, 0x4e, 0xba, 0x79, 0x0b, 0xa7, 0xf7, 0xc0, 0x56, 0x59, 0x2a, 0xaa, 0x03,
0x85, 0x94, 0xda, 0xb1, 0x0c, 0xa0, 0xd7, 0xcc, 0x12, 0x29, 0xb5, 0xff, 0x99, 0x80, 0x5d, 0x2b,
0x36, 0xbe, 0x86, 0xd0, 0xad, 0xf6, 0x5c, 0x97, 0x05, 0xb6, 0x8a, 0xdb, 0x01, 0x9d, 0x40, 0x47,
0x69, 0xae, 0x4b, 0x65, 0xb4, 0x6e, 0x8d, 0x8f, 0xd9, 0x9f, 0xb3, 0x63, 0xbf, 0x6a, 0xb3, 0xa9,
0xa1, 0x26, 0x8d, 0x84, 0xff, 0x18, 0x3a, 0xf5, 0x84, 0xf6, 0xe0, 0xc6, 0x45, 0x3c, 0x89, 0xcf,
0x5f, 0xc6, 0xfd, 0x6b, 0xf4, 0x26, 0x74, 0xa7, 0x17, 0x27, 0x27, 0x51, 0x14, 0x46, 0x61, 0x9f,
0x50, 0x80, 0x4e, 0x18, 0xc5, 0xa7, 0x51, 0xd8, 0xb7, 0xaa, 0xe7, 0x67, 0x4f, 0x4e, 0xcf, 0xa2,
0xb0, 0x7f, 0x30, 0xfe, 0x64, 0x81, 0x9d, 0xe0, 0x52, 0x6a, 0xac, 0x6e, 0x60, 0x41, 0x3f, 0x10,
0x70, 0xaa, 0xb0, 0x5f, 0xec, 0x09, 0x8e, 0x0e, 0x58, 0x5d, 0x13, 0x6b, 0x6b, 0x62, 0x51, 0x55,
0x93, 0xfb, 0xe8, 0x6f, 0x1f, 0xb0, 0xbf, 0x3e, 0xff, 0xfe, 0xbb, 0x6f, 0x3f, 0x3e, 0x5a, 0x1e,
0x1d, 0xfe, 0xf6, 0x6b, 0x15, 0xc6, 0xcf, 0x76, 0x44, 0xdf, 0x13, 0xb8, 0x5e, 0xb9, 0xa3, 0x0f,
0xfe, 0x2d, 0x27, 0xd3, 0xaa, 0x7b, 0xf4, 0x3f, 0xa1, 0xfa, 0x23, 0xe3, 0xc4, 0xf5, 0x9d, 0x7d,
0x4e, 0xaa, 0xe6, 0x9e, 0xda, 0x5f, 0x36, 0x1e, 0xf9, 0xba, 0xf1, 0xc8, 0xf7, 0x8d, 0x47, 0x66,
0x1d, 0x93, 0xc0, 0xf1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x49, 0x89, 0x51, 0x24, 0x03,
0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// RemoteSignerClient is the client API for RemoteSigner service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type RemoteSignerClient interface {
ListValidatingPublicKeys(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*ListPublicKeysResponse, error)
Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*SignResponse, error)
}
type remoteSignerClient struct {
cc *grpc.ClientConn
}
func NewRemoteSignerClient(cc *grpc.ClientConn) RemoteSignerClient {
return &remoteSignerClient{cc}
}
func (c *remoteSignerClient) ListValidatingPublicKeys(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*ListPublicKeysResponse, error) {
out := new(ListPublicKeysResponse)
err := c.cc.Invoke(ctx, "/ethereum.validator.accounts.v2.RemoteSigner/ListValidatingPublicKeys", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *remoteSignerClient) Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*SignResponse, error) {
out := new(SignResponse)
err := c.cc.Invoke(ctx, "/ethereum.validator.accounts.v2.RemoteSigner/Sign", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// RemoteSignerServer is the server API for RemoteSigner service.
type RemoteSignerServer interface {
ListValidatingPublicKeys(context.Context, *types.Empty) (*ListPublicKeysResponse, error)
Sign(context.Context, *SignRequest) (*SignResponse, error)
}
// UnimplementedRemoteSignerServer can be embedded to have forward compatible implementations.
type UnimplementedRemoteSignerServer struct {
}
func (*UnimplementedRemoteSignerServer) ListValidatingPublicKeys(ctx context.Context, req *types.Empty) (*ListPublicKeysResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListValidatingPublicKeys not implemented")
}
func (*UnimplementedRemoteSignerServer) Sign(ctx context.Context, req *SignRequest) (*SignResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Sign not implemented")
}
func RegisterRemoteSignerServer(s *grpc.Server, srv RemoteSignerServer) {
s.RegisterService(&_RemoteSigner_serviceDesc, srv)
}
func _RemoteSigner_ListValidatingPublicKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(types.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RemoteSignerServer).ListValidatingPublicKeys(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethereum.validator.accounts.v2.RemoteSigner/ListValidatingPublicKeys",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RemoteSignerServer).ListValidatingPublicKeys(ctx, req.(*types.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _RemoteSigner_Sign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RemoteSignerServer).Sign(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethereum.validator.accounts.v2.RemoteSigner/Sign",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RemoteSignerServer).Sign(ctx, req.(*SignRequest))
}
return interceptor(ctx, in, info, handler)
}
var _RemoteSigner_serviceDesc = grpc.ServiceDesc{
ServiceName: "ethereum.validator.accounts.v2.RemoteSigner",
HandlerType: (*RemoteSignerServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ListValidatingPublicKeys",
Handler: _RemoteSigner_ListValidatingPublicKeys_Handler,
},
{
MethodName: "Sign",
Handler: _RemoteSigner_Sign_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "proto/validator/accounts/v2/keymanager.proto",
}
func (m *ListPublicKeysResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ListPublicKeysResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ListPublicKeysResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.ValidatingPublicKeys) > 0 {
for iNdEx := len(m.ValidatingPublicKeys) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.ValidatingPublicKeys[iNdEx])
copy(dAtA[i:], m.ValidatingPublicKeys[iNdEx])
i = encodeVarintKeymanager(dAtA, i, uint64(len(m.ValidatingPublicKeys[iNdEx])))
i--
dAtA[i] = 0x12
}
}
return len(dAtA) - i, nil
}
func (m *SignRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *SignRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SignRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.SigningRoot) > 0 {
i -= len(m.SigningRoot)
copy(dAtA[i:], m.SigningRoot)
i = encodeVarintKeymanager(dAtA, i, uint64(len(m.SigningRoot)))
i--
dAtA[i] = 0x12
}
if len(m.PublicKey) > 0 {
i -= len(m.PublicKey)
copy(dAtA[i:], m.PublicKey)
i = encodeVarintKeymanager(dAtA, i, uint64(len(m.PublicKey)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *SignResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *SignResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SignResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.Status != 0 {
i = encodeVarintKeymanager(dAtA, i, uint64(m.Status))
i--
dAtA[i] = 0x10
}
if len(m.Signature) > 0 {
i -= len(m.Signature)
copy(dAtA[i:], m.Signature)
i = encodeVarintKeymanager(dAtA, i, uint64(len(m.Signature)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintKeymanager(dAtA []byte, offset int, v uint64) int {
offset -= sovKeymanager(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *ListPublicKeysResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.ValidatingPublicKeys) > 0 {
for _, b := range m.ValidatingPublicKeys {
l = len(b)
n += 1 + l + sovKeymanager(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *SignRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.PublicKey)
if l > 0 {
n += 1 + l + sovKeymanager(uint64(l))
}
l = len(m.SigningRoot)
if l > 0 {
n += 1 + l + sovKeymanager(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *SignResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Signature)
if l > 0 {
n += 1 + l + sovKeymanager(uint64(l))
}
if m.Status != 0 {
n += 1 + sovKeymanager(uint64(m.Status))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovKeymanager(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozKeymanager(x uint64) (n int) {
return sovKeymanager(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *ListPublicKeysResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowKeymanager
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ListPublicKeysResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ListPublicKeysResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ValidatingPublicKeys", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowKeymanager
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthKeymanager
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthKeymanager
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ValidatingPublicKeys = append(m.ValidatingPublicKeys, make([]byte, postIndex-iNdEx))
copy(m.ValidatingPublicKeys[len(m.ValidatingPublicKeys)-1], dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipKeymanager(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthKeymanager
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthKeymanager
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SignRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowKeymanager
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: SignRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SignRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowKeymanager
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthKeymanager
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthKeymanager
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...)
if m.PublicKey == nil {
m.PublicKey = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SigningRoot", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowKeymanager
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthKeymanager
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthKeymanager
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.SigningRoot = append(m.SigningRoot[:0], dAtA[iNdEx:postIndex]...)
if m.SigningRoot == nil {
m.SigningRoot = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipKeymanager(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthKeymanager
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthKeymanager
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SignResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowKeymanager
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: SignResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SignResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowKeymanager
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthKeymanager
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthKeymanager
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...)
if m.Signature == nil {
m.Signature = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
}
m.Status = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowKeymanager
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Status |= SignResponse_Status(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipKeymanager(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthKeymanager
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthKeymanager
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipKeymanager(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowKeymanager
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowKeymanager
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowKeymanager
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthKeymanager
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupKeymanager
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthKeymanager
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthKeymanager = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowKeymanager = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupKeymanager = fmt.Errorf("proto: unexpected end of group")
)

View File

@@ -2,6 +2,36 @@ syntax = "proto3";
package ethereum.validator.accounts.v2;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
// RemoteSigner service API.
//
// Defines a remote-signing keymanager which manages eth2
// validator accounts and can sign respective messages.
service RemoteSigner {
// ListPublicKeysResponse managed by a remote signer.
rpc ListValidatingPublicKeys(google.protobuf.Empty) returns (ListPublicKeysResponse) {
option (google.api.http) = {
get: "/accounts/v2/remote/accounts"
};
}
// Sign a remote request via gRPC.
rpc Sign(SignRequest) returns (SignResponse) {
option (google.api.http) = {
post: "/accounts/v2/remote/sign"
};
}
}
// ListPublicKeysResponse contains public keys
// for the validator secrets managed by the remote signer.
message ListPublicKeysResponse {
// List of 48 byte, BLS12-381 validating public keys.
repeated bytes validating_public_keys = 2;
}
// SignRequest is a message type used by a keymanager
// as part of Prysm's accounts v2 implementation.
message SignRequest {
@@ -9,6 +39,27 @@ message SignRequest {
// being requested to sign data.
bytes public_key = 1;
// Raw bytes data the client is requesting to sign.
bytes data = 2;
// Raw bytes signing root the client is requesting to sign. The client is
// expected to determine these raw bytes from the appropriate BLS
// signing domain as well as the signing root of the data structure
// the bytes represent.
bytes signing_root = 2;
}
// SignResponse returned by a RemoteSigner gRPC service.
message SignResponse {
enum Status {
UNKNOWN = 0;
SUCCEEDED = 1;
DENIED = 2;
FAILED = 3;
}
// BLS12-381 signature for the data specified in the request.
bytes signature = 1;
// Status of the signing response, standardized as an enum
// to ensure different remote signing servers follow the
// same conventions.
Status status = 2;
}

View File

@@ -10,6 +10,7 @@ mocks=(
"$mock_path/beacon_validator_server_mock.go BeaconNodeValidatorServer,BeaconNodeValidator_WaitForSyncedServer,BeaconNodeValidator_WaitForActivationServer,BeaconNodeValidator_WaitForChainStartServer,BeaconNodeValidator_StreamDutiesServer"
"$mock_path/beacon_validator_client_mock.go BeaconNodeValidatorClient,BeaconNodeValidator_WaitForSyncedClient,BeaconNodeValidator_WaitForChainStartClient,BeaconNodeValidator_WaitForActivationClient,BeaconNodeValidator_StreamDutiesClient"
"$mock_path/node_service_mock.go NodeClient"
"$mock_path/keymanager_mock.go RemoteSignerClient"
)
for ((i = 0; i < ${#mocks[@]}; i++)); do
@@ -17,6 +18,7 @@ for ((i = 0; i < ${#mocks[@]}; i++)); do
interfaces=${mocks[i]#* };
echo "generating $file for interfaces: $interfaces";
GO11MODULE=on mockgen -package=mock -destination=$file github.com/prysmaticlabs/ethereumapis/eth/v1alpha1 $interfaces
GO11MODULE=on mockgen -package=mock -destination=$file github.com/prysmaticlabs/prysm/proto/validator/accounts/v2 $interfaces
done
goimports -w "$mock_path/."

View File

@@ -9,11 +9,13 @@ go_library(
"beacon_service_mock.go",
"beacon_validator_client_mock.go",
"beacon_validator_server_mock.go",
"keymanager_mock.go",
"node_service_mock.go",
],
importpath = "github.com/prysmaticlabs/prysm/shared/mock",
visibility = ["//visibility:public"],
deps = [
"//proto/validator/accounts/v2:go_default_library",
"@com_github_gogo_protobuf//types:go_default_library",
"@com_github_golang_mock//gomock:go_default_library",
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",

View File

@@ -9,7 +9,7 @@ import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
v1alpha1 "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
eth "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
metadata "google.golang.org/grpc/metadata"
)
@@ -65,7 +65,7 @@ func (mr *MockBeaconChain_StreamChainHeadServerMockRecorder) RecvMsg(arg0 interf
}
// Send mocks base method
func (m *MockBeaconChain_StreamChainHeadServer) Send(arg0 *v1alpha1.ChainHead) error {
func (m *MockBeaconChain_StreamChainHeadServer) Send(arg0 *eth.ChainHead) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
@@ -184,7 +184,7 @@ func (mr *MockBeaconChain_StreamAttestationsServerMockRecorder) RecvMsg(arg0 int
}
// Send mocks base method
func (m *MockBeaconChain_StreamAttestationsServer) Send(arg0 *v1alpha1.Attestation) error {
func (m *MockBeaconChain_StreamAttestationsServer) Send(arg0 *eth.Attestation) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
@@ -303,7 +303,7 @@ func (mr *MockBeaconChain_StreamBlocksServerMockRecorder) RecvMsg(arg0 interface
}
// Send mocks base method
func (m *MockBeaconChain_StreamBlocksServer) Send(arg0 *v1alpha1.SignedBeaconBlock) error {
func (m *MockBeaconChain_StreamBlocksServer) Send(arg0 *eth.SignedBeaconBlock) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
@@ -408,10 +408,10 @@ func (mr *MockBeaconChain_StreamValidatorsInfoServerMockRecorder) Context() *gom
}
// Recv mocks base method
func (m *MockBeaconChain_StreamValidatorsInfoServer) Recv() (*v1alpha1.ValidatorChangeSet, error) {
func (m *MockBeaconChain_StreamValidatorsInfoServer) Recv() (*eth.ValidatorChangeSet, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*v1alpha1.ValidatorChangeSet)
ret0, _ := ret[0].(*eth.ValidatorChangeSet)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -437,7 +437,7 @@ func (mr *MockBeaconChain_StreamValidatorsInfoServerMockRecorder) RecvMsg(arg0 i
}
// Send mocks base method
func (m *MockBeaconChain_StreamValidatorsInfoServer) Send(arg0 *v1alpha1.ValidatorInfo) error {
func (m *MockBeaconChain_StreamValidatorsInfoServer) Send(arg0 *eth.ValidatorInfo) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
@@ -556,7 +556,7 @@ func (mr *MockBeaconChain_StreamIndexedAttestationsServerMockRecorder) RecvMsg(a
}
// Send mocks base method
func (m *MockBeaconChain_StreamIndexedAttestationsServer) Send(arg0 *v1alpha1.IndexedAttestation) error {
func (m *MockBeaconChain_StreamIndexedAttestationsServer) Send(arg0 *eth.IndexedAttestation) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)

View File

@@ -10,7 +10,7 @@ import (
types "github.com/gogo/protobuf/types"
gomock "github.com/golang/mock/gomock"
v1alpha1 "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
eth "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
)
@@ -39,14 +39,14 @@ func (m *MockBeaconChainClient) EXPECT() *MockBeaconChainClientMockRecorder {
}
// AttestationPool mocks base method
func (m *MockBeaconChainClient) AttestationPool(arg0 context.Context, arg1 *v1alpha1.AttestationPoolRequest, arg2 ...grpc.CallOption) (*v1alpha1.AttestationPoolResponse, error) {
func (m *MockBeaconChainClient) AttestationPool(arg0 context.Context, arg1 *eth.AttestationPoolRequest, arg2 ...grpc.CallOption) (*eth.AttestationPoolResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "AttestationPool", varargs...)
ret0, _ := ret[0].(*v1alpha1.AttestationPoolResponse)
ret0, _ := ret[0].(*eth.AttestationPoolResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -59,14 +59,14 @@ func (mr *MockBeaconChainClientMockRecorder) AttestationPool(arg0, arg1 interfac
}
// GetBeaconConfig mocks base method
func (m *MockBeaconChainClient) GetBeaconConfig(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*v1alpha1.BeaconConfig, error) {
func (m *MockBeaconChainClient) GetBeaconConfig(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*eth.BeaconConfig, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetBeaconConfig", varargs...)
ret0, _ := ret[0].(*v1alpha1.BeaconConfig)
ret0, _ := ret[0].(*eth.BeaconConfig)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -79,14 +79,14 @@ func (mr *MockBeaconChainClientMockRecorder) GetBeaconConfig(arg0, arg1 interfac
}
// GetChainHead mocks base method
func (m *MockBeaconChainClient) GetChainHead(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*v1alpha1.ChainHead, error) {
func (m *MockBeaconChainClient) GetChainHead(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*eth.ChainHead, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetChainHead", varargs...)
ret0, _ := ret[0].(*v1alpha1.ChainHead)
ret0, _ := ret[0].(*eth.ChainHead)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -99,14 +99,14 @@ func (mr *MockBeaconChainClientMockRecorder) GetChainHead(arg0, arg1 interface{}
}
// GetIndividualVotes mocks base method
func (m *MockBeaconChainClient) GetIndividualVotes(arg0 context.Context, arg1 *v1alpha1.IndividualVotesRequest, arg2 ...grpc.CallOption) (*v1alpha1.IndividualVotesRespond, error) {
func (m *MockBeaconChainClient) GetIndividualVotes(arg0 context.Context, arg1 *eth.IndividualVotesRequest, arg2 ...grpc.CallOption) (*eth.IndividualVotesRespond, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetIndividualVotes", varargs...)
ret0, _ := ret[0].(*v1alpha1.IndividualVotesRespond)
ret0, _ := ret[0].(*eth.IndividualVotesRespond)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -119,14 +119,14 @@ func (mr *MockBeaconChainClientMockRecorder) GetIndividualVotes(arg0, arg1 inter
}
// GetValidator mocks base method
func (m *MockBeaconChainClient) GetValidator(arg0 context.Context, arg1 *v1alpha1.GetValidatorRequest, arg2 ...grpc.CallOption) (*v1alpha1.Validator, error) {
func (m *MockBeaconChainClient) GetValidator(arg0 context.Context, arg1 *eth.GetValidatorRequest, arg2 ...grpc.CallOption) (*eth.Validator, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetValidator", varargs...)
ret0, _ := ret[0].(*v1alpha1.Validator)
ret0, _ := ret[0].(*eth.Validator)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -139,14 +139,14 @@ func (mr *MockBeaconChainClientMockRecorder) GetValidator(arg0, arg1 interface{}
}
// GetValidatorActiveSetChanges mocks base method
func (m *MockBeaconChainClient) GetValidatorActiveSetChanges(arg0 context.Context, arg1 *v1alpha1.GetValidatorActiveSetChangesRequest, arg2 ...grpc.CallOption) (*v1alpha1.ActiveSetChanges, error) {
func (m *MockBeaconChainClient) GetValidatorActiveSetChanges(arg0 context.Context, arg1 *eth.GetValidatorActiveSetChangesRequest, arg2 ...grpc.CallOption) (*eth.ActiveSetChanges, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetValidatorActiveSetChanges", varargs...)
ret0, _ := ret[0].(*v1alpha1.ActiveSetChanges)
ret0, _ := ret[0].(*eth.ActiveSetChanges)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -159,14 +159,14 @@ func (mr *MockBeaconChainClientMockRecorder) GetValidatorActiveSetChanges(arg0,
}
// GetValidatorParticipation mocks base method
func (m *MockBeaconChainClient) GetValidatorParticipation(arg0 context.Context, arg1 *v1alpha1.GetValidatorParticipationRequest, arg2 ...grpc.CallOption) (*v1alpha1.ValidatorParticipationResponse, error) {
func (m *MockBeaconChainClient) GetValidatorParticipation(arg0 context.Context, arg1 *eth.GetValidatorParticipationRequest, arg2 ...grpc.CallOption) (*eth.ValidatorParticipationResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetValidatorParticipation", varargs...)
ret0, _ := ret[0].(*v1alpha1.ValidatorParticipationResponse)
ret0, _ := ret[0].(*eth.ValidatorParticipationResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -179,14 +179,14 @@ func (mr *MockBeaconChainClientMockRecorder) GetValidatorParticipation(arg0, arg
}
// GetValidatorPerformance mocks base method
func (m *MockBeaconChainClient) GetValidatorPerformance(arg0 context.Context, arg1 *v1alpha1.ValidatorPerformanceRequest, arg2 ...grpc.CallOption) (*v1alpha1.ValidatorPerformanceResponse, error) {
func (m *MockBeaconChainClient) GetValidatorPerformance(arg0 context.Context, arg1 *eth.ValidatorPerformanceRequest, arg2 ...grpc.CallOption) (*eth.ValidatorPerformanceResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetValidatorPerformance", varargs...)
ret0, _ := ret[0].(*v1alpha1.ValidatorPerformanceResponse)
ret0, _ := ret[0].(*eth.ValidatorPerformanceResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -199,14 +199,14 @@ func (mr *MockBeaconChainClientMockRecorder) GetValidatorPerformance(arg0, arg1
}
// GetValidatorQueue mocks base method
func (m *MockBeaconChainClient) GetValidatorQueue(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*v1alpha1.ValidatorQueue, error) {
func (m *MockBeaconChainClient) GetValidatorQueue(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*eth.ValidatorQueue, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetValidatorQueue", varargs...)
ret0, _ := ret[0].(*v1alpha1.ValidatorQueue)
ret0, _ := ret[0].(*eth.ValidatorQueue)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -219,14 +219,14 @@ func (mr *MockBeaconChainClientMockRecorder) GetValidatorQueue(arg0, arg1 interf
}
// ListAttestations mocks base method
func (m *MockBeaconChainClient) ListAttestations(arg0 context.Context, arg1 *v1alpha1.ListAttestationsRequest, arg2 ...grpc.CallOption) (*v1alpha1.ListAttestationsResponse, error) {
func (m *MockBeaconChainClient) ListAttestations(arg0 context.Context, arg1 *eth.ListAttestationsRequest, arg2 ...grpc.CallOption) (*eth.ListAttestationsResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListAttestations", varargs...)
ret0, _ := ret[0].(*v1alpha1.ListAttestationsResponse)
ret0, _ := ret[0].(*eth.ListAttestationsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -239,14 +239,14 @@ func (mr *MockBeaconChainClientMockRecorder) ListAttestations(arg0, arg1 interfa
}
// ListBeaconCommittees mocks base method
func (m *MockBeaconChainClient) ListBeaconCommittees(arg0 context.Context, arg1 *v1alpha1.ListCommitteesRequest, arg2 ...grpc.CallOption) (*v1alpha1.BeaconCommittees, error) {
func (m *MockBeaconChainClient) ListBeaconCommittees(arg0 context.Context, arg1 *eth.ListCommitteesRequest, arg2 ...grpc.CallOption) (*eth.BeaconCommittees, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListBeaconCommittees", varargs...)
ret0, _ := ret[0].(*v1alpha1.BeaconCommittees)
ret0, _ := ret[0].(*eth.BeaconCommittees)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -259,14 +259,14 @@ func (mr *MockBeaconChainClientMockRecorder) ListBeaconCommittees(arg0, arg1 int
}
// ListBlocks mocks base method
func (m *MockBeaconChainClient) ListBlocks(arg0 context.Context, arg1 *v1alpha1.ListBlocksRequest, arg2 ...grpc.CallOption) (*v1alpha1.ListBlocksResponse, error) {
func (m *MockBeaconChainClient) ListBlocks(arg0 context.Context, arg1 *eth.ListBlocksRequest, arg2 ...grpc.CallOption) (*eth.ListBlocksResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListBlocks", varargs...)
ret0, _ := ret[0].(*v1alpha1.ListBlocksResponse)
ret0, _ := ret[0].(*eth.ListBlocksResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -279,14 +279,14 @@ func (mr *MockBeaconChainClientMockRecorder) ListBlocks(arg0, arg1 interface{},
}
// ListIndexedAttestations mocks base method
func (m *MockBeaconChainClient) ListIndexedAttestations(arg0 context.Context, arg1 *v1alpha1.ListIndexedAttestationsRequest, arg2 ...grpc.CallOption) (*v1alpha1.ListIndexedAttestationsResponse, error) {
func (m *MockBeaconChainClient) ListIndexedAttestations(arg0 context.Context, arg1 *eth.ListIndexedAttestationsRequest, arg2 ...grpc.CallOption) (*eth.ListIndexedAttestationsResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListIndexedAttestations", varargs...)
ret0, _ := ret[0].(*v1alpha1.ListIndexedAttestationsResponse)
ret0, _ := ret[0].(*eth.ListIndexedAttestationsResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -299,14 +299,14 @@ func (mr *MockBeaconChainClientMockRecorder) ListIndexedAttestations(arg0, arg1
}
// ListValidatorAssignments mocks base method
func (m *MockBeaconChainClient) ListValidatorAssignments(arg0 context.Context, arg1 *v1alpha1.ListValidatorAssignmentsRequest, arg2 ...grpc.CallOption) (*v1alpha1.ValidatorAssignments, error) {
func (m *MockBeaconChainClient) ListValidatorAssignments(arg0 context.Context, arg1 *eth.ListValidatorAssignmentsRequest, arg2 ...grpc.CallOption) (*eth.ValidatorAssignments, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListValidatorAssignments", varargs...)
ret0, _ := ret[0].(*v1alpha1.ValidatorAssignments)
ret0, _ := ret[0].(*eth.ValidatorAssignments)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -319,14 +319,14 @@ func (mr *MockBeaconChainClientMockRecorder) ListValidatorAssignments(arg0, arg1
}
// ListValidatorBalances mocks base method
func (m *MockBeaconChainClient) ListValidatorBalances(arg0 context.Context, arg1 *v1alpha1.ListValidatorBalancesRequest, arg2 ...grpc.CallOption) (*v1alpha1.ValidatorBalances, error) {
func (m *MockBeaconChainClient) ListValidatorBalances(arg0 context.Context, arg1 *eth.ListValidatorBalancesRequest, arg2 ...grpc.CallOption) (*eth.ValidatorBalances, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListValidatorBalances", varargs...)
ret0, _ := ret[0].(*v1alpha1.ValidatorBalances)
ret0, _ := ret[0].(*eth.ValidatorBalances)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -339,14 +339,14 @@ func (mr *MockBeaconChainClientMockRecorder) ListValidatorBalances(arg0, arg1 in
}
// ListValidators mocks base method
func (m *MockBeaconChainClient) ListValidators(arg0 context.Context, arg1 *v1alpha1.ListValidatorsRequest, arg2 ...grpc.CallOption) (*v1alpha1.Validators, error) {
func (m *MockBeaconChainClient) ListValidators(arg0 context.Context, arg1 *eth.ListValidatorsRequest, arg2 ...grpc.CallOption) (*eth.Validators, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListValidators", varargs...)
ret0, _ := ret[0].(*v1alpha1.Validators)
ret0, _ := ret[0].(*eth.Validators)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -359,14 +359,14 @@ func (mr *MockBeaconChainClientMockRecorder) ListValidators(arg0, arg1 interface
}
// StreamAttestations mocks base method
func (m *MockBeaconChainClient) StreamAttestations(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (v1alpha1.BeaconChain_StreamAttestationsClient, error) {
func (m *MockBeaconChainClient) StreamAttestations(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (eth.BeaconChain_StreamAttestationsClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamAttestations", varargs...)
ret0, _ := ret[0].(v1alpha1.BeaconChain_StreamAttestationsClient)
ret0, _ := ret[0].(eth.BeaconChain_StreamAttestationsClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -379,14 +379,14 @@ func (mr *MockBeaconChainClientMockRecorder) StreamAttestations(arg0, arg1 inter
}
// StreamBlocks mocks base method
func (m *MockBeaconChainClient) StreamBlocks(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (v1alpha1.BeaconChain_StreamBlocksClient, error) {
func (m *MockBeaconChainClient) StreamBlocks(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (eth.BeaconChain_StreamBlocksClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamBlocks", varargs...)
ret0, _ := ret[0].(v1alpha1.BeaconChain_StreamBlocksClient)
ret0, _ := ret[0].(eth.BeaconChain_StreamBlocksClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -399,14 +399,14 @@ func (mr *MockBeaconChainClientMockRecorder) StreamBlocks(arg0, arg1 interface{}
}
// StreamChainHead mocks base method
func (m *MockBeaconChainClient) StreamChainHead(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (v1alpha1.BeaconChain_StreamChainHeadClient, error) {
func (m *MockBeaconChainClient) StreamChainHead(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (eth.BeaconChain_StreamChainHeadClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamChainHead", varargs...)
ret0, _ := ret[0].(v1alpha1.BeaconChain_StreamChainHeadClient)
ret0, _ := ret[0].(eth.BeaconChain_StreamChainHeadClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -419,14 +419,14 @@ func (mr *MockBeaconChainClientMockRecorder) StreamChainHead(arg0, arg1 interfac
}
// StreamIndexedAttestations mocks base method
func (m *MockBeaconChainClient) StreamIndexedAttestations(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (v1alpha1.BeaconChain_StreamIndexedAttestationsClient, error) {
func (m *MockBeaconChainClient) StreamIndexedAttestations(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (eth.BeaconChain_StreamIndexedAttestationsClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamIndexedAttestations", varargs...)
ret0, _ := ret[0].(v1alpha1.BeaconChain_StreamIndexedAttestationsClient)
ret0, _ := ret[0].(eth.BeaconChain_StreamIndexedAttestationsClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -439,14 +439,14 @@ func (mr *MockBeaconChainClientMockRecorder) StreamIndexedAttestations(arg0, arg
}
// StreamValidatorsInfo mocks base method
func (m *MockBeaconChainClient) StreamValidatorsInfo(arg0 context.Context, arg1 ...grpc.CallOption) (v1alpha1.BeaconChain_StreamValidatorsInfoClient, error) {
func (m *MockBeaconChainClient) StreamValidatorsInfo(arg0 context.Context, arg1 ...grpc.CallOption) (eth.BeaconChain_StreamValidatorsInfoClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0}
for _, a := range arg1 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamValidatorsInfo", varargs...)
ret0, _ := ret[0].(v1alpha1.BeaconChain_StreamValidatorsInfoClient)
ret0, _ := ret[0].(eth.BeaconChain_StreamValidatorsInfoClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -459,14 +459,14 @@ func (mr *MockBeaconChainClientMockRecorder) StreamValidatorsInfo(arg0 interface
}
// SubmitAttesterSlashing mocks base method
func (m *MockBeaconChainClient) SubmitAttesterSlashing(arg0 context.Context, arg1 *v1alpha1.AttesterSlashing, arg2 ...grpc.CallOption) (*v1alpha1.SubmitSlashingResponse, error) {
func (m *MockBeaconChainClient) SubmitAttesterSlashing(arg0 context.Context, arg1 *eth.AttesterSlashing, arg2 ...grpc.CallOption) (*eth.SubmitSlashingResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "SubmitAttesterSlashing", varargs...)
ret0, _ := ret[0].(*v1alpha1.SubmitSlashingResponse)
ret0, _ := ret[0].(*eth.SubmitSlashingResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -479,14 +479,14 @@ func (mr *MockBeaconChainClientMockRecorder) SubmitAttesterSlashing(arg0, arg1 i
}
// SubmitProposerSlashing mocks base method
func (m *MockBeaconChainClient) SubmitProposerSlashing(arg0 context.Context, arg1 *v1alpha1.ProposerSlashing, arg2 ...grpc.CallOption) (*v1alpha1.SubmitSlashingResponse, error) {
func (m *MockBeaconChainClient) SubmitProposerSlashing(arg0 context.Context, arg1 *eth.ProposerSlashing, arg2 ...grpc.CallOption) (*eth.SubmitSlashingResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "SubmitProposerSlashing", varargs...)
ret0, _ := ret[0].(*v1alpha1.SubmitSlashingResponse)
ret0, _ := ret[0].(*eth.SubmitSlashingResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -565,10 +565,10 @@ func (mr *MockBeaconChain_StreamChainHeadClientMockRecorder) Header() *gomock.Ca
}
// Recv mocks base method
func (m *MockBeaconChain_StreamChainHeadClient) Recv() (*v1alpha1.ChainHead, error) {
func (m *MockBeaconChain_StreamChainHeadClient) Recv() (*eth.ChainHead, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*v1alpha1.ChainHead)
ret0, _ := ret[0].(*eth.ChainHead)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -688,10 +688,10 @@ func (mr *MockBeaconChain_StreamAttestationsClientMockRecorder) Header() *gomock
}
// Recv mocks base method
func (m *MockBeaconChain_StreamAttestationsClient) Recv() (*v1alpha1.Attestation, error) {
func (m *MockBeaconChain_StreamAttestationsClient) Recv() (*eth.Attestation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*v1alpha1.Attestation)
ret0, _ := ret[0].(*eth.Attestation)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -811,10 +811,10 @@ func (mr *MockBeaconChain_StreamBlocksClientMockRecorder) Header() *gomock.Call
}
// Recv mocks base method
func (m *MockBeaconChain_StreamBlocksClient) Recv() (*v1alpha1.SignedBeaconBlock, error) {
func (m *MockBeaconChain_StreamBlocksClient) Recv() (*eth.SignedBeaconBlock, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*v1alpha1.SignedBeaconBlock)
ret0, _ := ret[0].(*eth.SignedBeaconBlock)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -934,10 +934,10 @@ func (mr *MockBeaconChain_StreamValidatorsInfoClientMockRecorder) Header() *gomo
}
// Recv mocks base method
func (m *MockBeaconChain_StreamValidatorsInfoClient) Recv() (*v1alpha1.ValidatorInfo, error) {
func (m *MockBeaconChain_StreamValidatorsInfoClient) Recv() (*eth.ValidatorInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*v1alpha1.ValidatorInfo)
ret0, _ := ret[0].(*eth.ValidatorInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -963,7 +963,7 @@ func (mr *MockBeaconChain_StreamValidatorsInfoClientMockRecorder) RecvMsg(arg0 i
}
// Send mocks base method
func (m *MockBeaconChain_StreamValidatorsInfoClient) Send(arg0 *v1alpha1.ValidatorChangeSet) error {
func (m *MockBeaconChain_StreamValidatorsInfoClient) Send(arg0 *eth.ValidatorChangeSet) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
@@ -1071,10 +1071,10 @@ func (mr *MockBeaconChain_StreamIndexedAttestationsClientMockRecorder) Header()
}
// Recv mocks base method
func (m *MockBeaconChain_StreamIndexedAttestationsClient) Recv() (*v1alpha1.IndexedAttestation, error) {
func (m *MockBeaconChain_StreamIndexedAttestationsClient) Recv() (*eth.IndexedAttestation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*v1alpha1.IndexedAttestation)
ret0, _ := ret[0].(*eth.IndexedAttestation)
ret1, _ := ret[1].(error)
return ret0, ret1
}

View File

@@ -10,7 +10,7 @@ import (
types "github.com/gogo/protobuf/types"
gomock "github.com/golang/mock/gomock"
v1alpha1 "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
eth "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
)
@@ -39,14 +39,14 @@ func (m *MockBeaconNodeValidatorClient) EXPECT() *MockBeaconNodeValidatorClientM
}
// DomainData mocks base method
func (m *MockBeaconNodeValidatorClient) DomainData(arg0 context.Context, arg1 *v1alpha1.DomainRequest, arg2 ...grpc.CallOption) (*v1alpha1.DomainResponse, error) {
func (m *MockBeaconNodeValidatorClient) DomainData(arg0 context.Context, arg1 *eth.DomainRequest, arg2 ...grpc.CallOption) (*eth.DomainResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "DomainData", varargs...)
ret0, _ := ret[0].(*v1alpha1.DomainResponse)
ret0, _ := ret[0].(*eth.DomainResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -59,14 +59,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) DomainData(arg0, arg1 inter
}
// GetAttestationData mocks base method
func (m *MockBeaconNodeValidatorClient) GetAttestationData(arg0 context.Context, arg1 *v1alpha1.AttestationDataRequest, arg2 ...grpc.CallOption) (*v1alpha1.AttestationData, error) {
func (m *MockBeaconNodeValidatorClient) GetAttestationData(arg0 context.Context, arg1 *eth.AttestationDataRequest, arg2 ...grpc.CallOption) (*eth.AttestationData, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetAttestationData", varargs...)
ret0, _ := ret[0].(*v1alpha1.AttestationData)
ret0, _ := ret[0].(*eth.AttestationData)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -79,14 +79,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) GetAttestationData(arg0, ar
}
// GetBlock mocks base method
func (m *MockBeaconNodeValidatorClient) GetBlock(arg0 context.Context, arg1 *v1alpha1.BlockRequest, arg2 ...grpc.CallOption) (*v1alpha1.BeaconBlock, error) {
func (m *MockBeaconNodeValidatorClient) GetBlock(arg0 context.Context, arg1 *eth.BlockRequest, arg2 ...grpc.CallOption) (*eth.BeaconBlock, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetBlock", varargs...)
ret0, _ := ret[0].(*v1alpha1.BeaconBlock)
ret0, _ := ret[0].(*eth.BeaconBlock)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -99,14 +99,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) GetBlock(arg0, arg1 interfa
}
// GetDuties mocks base method
func (m *MockBeaconNodeValidatorClient) GetDuties(arg0 context.Context, arg1 *v1alpha1.DutiesRequest, arg2 ...grpc.CallOption) (*v1alpha1.DutiesResponse, error) {
func (m *MockBeaconNodeValidatorClient) GetDuties(arg0 context.Context, arg1 *eth.DutiesRequest, arg2 ...grpc.CallOption) (*eth.DutiesResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetDuties", varargs...)
ret0, _ := ret[0].(*v1alpha1.DutiesResponse)
ret0, _ := ret[0].(*eth.DutiesResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -119,14 +119,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) GetDuties(arg0, arg1 interf
}
// MultipleValidatorStatus mocks base method
func (m *MockBeaconNodeValidatorClient) MultipleValidatorStatus(arg0 context.Context, arg1 *v1alpha1.MultipleValidatorStatusRequest, arg2 ...grpc.CallOption) (*v1alpha1.MultipleValidatorStatusResponse, error) {
func (m *MockBeaconNodeValidatorClient) MultipleValidatorStatus(arg0 context.Context, arg1 *eth.MultipleValidatorStatusRequest, arg2 ...grpc.CallOption) (*eth.MultipleValidatorStatusResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "MultipleValidatorStatus", varargs...)
ret0, _ := ret[0].(*v1alpha1.MultipleValidatorStatusResponse)
ret0, _ := ret[0].(*eth.MultipleValidatorStatusResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -139,14 +139,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) MultipleValidatorStatus(arg
}
// ProposeAttestation mocks base method
func (m *MockBeaconNodeValidatorClient) ProposeAttestation(arg0 context.Context, arg1 *v1alpha1.Attestation, arg2 ...grpc.CallOption) (*v1alpha1.AttestResponse, error) {
func (m *MockBeaconNodeValidatorClient) ProposeAttestation(arg0 context.Context, arg1 *eth.Attestation, arg2 ...grpc.CallOption) (*eth.AttestResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ProposeAttestation", varargs...)
ret0, _ := ret[0].(*v1alpha1.AttestResponse)
ret0, _ := ret[0].(*eth.AttestResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -159,14 +159,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) ProposeAttestation(arg0, ar
}
// ProposeBlock mocks base method
func (m *MockBeaconNodeValidatorClient) ProposeBlock(arg0 context.Context, arg1 *v1alpha1.SignedBeaconBlock, arg2 ...grpc.CallOption) (*v1alpha1.ProposeResponse, error) {
func (m *MockBeaconNodeValidatorClient) ProposeBlock(arg0 context.Context, arg1 *eth.SignedBeaconBlock, arg2 ...grpc.CallOption) (*eth.ProposeResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ProposeBlock", varargs...)
ret0, _ := ret[0].(*v1alpha1.ProposeResponse)
ret0, _ := ret[0].(*eth.ProposeResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -179,7 +179,7 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) ProposeBlock(arg0, arg1 int
}
// ProposeExit mocks base method
func (m *MockBeaconNodeValidatorClient) ProposeExit(arg0 context.Context, arg1 *v1alpha1.SignedVoluntaryExit, arg2 ...grpc.CallOption) (*types.Empty, error) {
func (m *MockBeaconNodeValidatorClient) ProposeExit(arg0 context.Context, arg1 *eth.SignedVoluntaryExit, arg2 ...grpc.CallOption) (*types.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
@@ -199,14 +199,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) ProposeExit(arg0, arg1 inte
}
// StreamDuties mocks base method
func (m *MockBeaconNodeValidatorClient) StreamDuties(arg0 context.Context, arg1 *v1alpha1.DutiesRequest, arg2 ...grpc.CallOption) (v1alpha1.BeaconNodeValidator_StreamDutiesClient, error) {
func (m *MockBeaconNodeValidatorClient) StreamDuties(arg0 context.Context, arg1 *eth.DutiesRequest, arg2 ...grpc.CallOption) (eth.BeaconNodeValidator_StreamDutiesClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamDuties", varargs...)
ret0, _ := ret[0].(v1alpha1.BeaconNodeValidator_StreamDutiesClient)
ret0, _ := ret[0].(eth.BeaconNodeValidator_StreamDutiesClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -219,14 +219,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) StreamDuties(arg0, arg1 int
}
// SubmitAggregateSelectionProof mocks base method
func (m *MockBeaconNodeValidatorClient) SubmitAggregateSelectionProof(arg0 context.Context, arg1 *v1alpha1.AggregateSelectionRequest, arg2 ...grpc.CallOption) (*v1alpha1.AggregateSelectionResponse, error) {
func (m *MockBeaconNodeValidatorClient) SubmitAggregateSelectionProof(arg0 context.Context, arg1 *eth.AggregateSelectionRequest, arg2 ...grpc.CallOption) (*eth.AggregateSelectionResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "SubmitAggregateSelectionProof", varargs...)
ret0, _ := ret[0].(*v1alpha1.AggregateSelectionResponse)
ret0, _ := ret[0].(*eth.AggregateSelectionResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -239,14 +239,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) SubmitAggregateSelectionPro
}
// SubmitSignedAggregateSelectionProof mocks base method
func (m *MockBeaconNodeValidatorClient) SubmitSignedAggregateSelectionProof(arg0 context.Context, arg1 *v1alpha1.SignedAggregateSubmitRequest, arg2 ...grpc.CallOption) (*v1alpha1.SignedAggregateSubmitResponse, error) {
func (m *MockBeaconNodeValidatorClient) SubmitSignedAggregateSelectionProof(arg0 context.Context, arg1 *eth.SignedAggregateSubmitRequest, arg2 ...grpc.CallOption) (*eth.SignedAggregateSubmitResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "SubmitSignedAggregateSelectionProof", varargs...)
ret0, _ := ret[0].(*v1alpha1.SignedAggregateSubmitResponse)
ret0, _ := ret[0].(*eth.SignedAggregateSubmitResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -259,7 +259,7 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) SubmitSignedAggregateSelect
}
// SubscribeCommitteeSubnets mocks base method
func (m *MockBeaconNodeValidatorClient) SubscribeCommitteeSubnets(arg0 context.Context, arg1 *v1alpha1.CommitteeSubnetsSubscribeRequest, arg2 ...grpc.CallOption) (*types.Empty, error) {
func (m *MockBeaconNodeValidatorClient) SubscribeCommitteeSubnets(arg0 context.Context, arg1 *eth.CommitteeSubnetsSubscribeRequest, arg2 ...grpc.CallOption) (*types.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
@@ -279,14 +279,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) SubscribeCommitteeSubnets(a
}
// ValidatorIndex mocks base method
func (m *MockBeaconNodeValidatorClient) ValidatorIndex(arg0 context.Context, arg1 *v1alpha1.ValidatorIndexRequest, arg2 ...grpc.CallOption) (*v1alpha1.ValidatorIndexResponse, error) {
func (m *MockBeaconNodeValidatorClient) ValidatorIndex(arg0 context.Context, arg1 *eth.ValidatorIndexRequest, arg2 ...grpc.CallOption) (*eth.ValidatorIndexResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ValidatorIndex", varargs...)
ret0, _ := ret[0].(*v1alpha1.ValidatorIndexResponse)
ret0, _ := ret[0].(*eth.ValidatorIndexResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -299,14 +299,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) ValidatorIndex(arg0, arg1 i
}
// ValidatorStatus mocks base method
func (m *MockBeaconNodeValidatorClient) ValidatorStatus(arg0 context.Context, arg1 *v1alpha1.ValidatorStatusRequest, arg2 ...grpc.CallOption) (*v1alpha1.ValidatorStatusResponse, error) {
func (m *MockBeaconNodeValidatorClient) ValidatorStatus(arg0 context.Context, arg1 *eth.ValidatorStatusRequest, arg2 ...grpc.CallOption) (*eth.ValidatorStatusResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ValidatorStatus", varargs...)
ret0, _ := ret[0].(*v1alpha1.ValidatorStatusResponse)
ret0, _ := ret[0].(*eth.ValidatorStatusResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -319,14 +319,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) ValidatorStatus(arg0, arg1
}
// WaitForActivation mocks base method
func (m *MockBeaconNodeValidatorClient) WaitForActivation(arg0 context.Context, arg1 *v1alpha1.ValidatorActivationRequest, arg2 ...grpc.CallOption) (v1alpha1.BeaconNodeValidator_WaitForActivationClient, error) {
func (m *MockBeaconNodeValidatorClient) WaitForActivation(arg0 context.Context, arg1 *eth.ValidatorActivationRequest, arg2 ...grpc.CallOption) (eth.BeaconNodeValidator_WaitForActivationClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "WaitForActivation", varargs...)
ret0, _ := ret[0].(v1alpha1.BeaconNodeValidator_WaitForActivationClient)
ret0, _ := ret[0].(eth.BeaconNodeValidator_WaitForActivationClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -339,14 +339,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) WaitForActivation(arg0, arg
}
// WaitForChainStart mocks base method
func (m *MockBeaconNodeValidatorClient) WaitForChainStart(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (v1alpha1.BeaconNodeValidator_WaitForChainStartClient, error) {
func (m *MockBeaconNodeValidatorClient) WaitForChainStart(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (eth.BeaconNodeValidator_WaitForChainStartClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "WaitForChainStart", varargs...)
ret0, _ := ret[0].(v1alpha1.BeaconNodeValidator_WaitForChainStartClient)
ret0, _ := ret[0].(eth.BeaconNodeValidator_WaitForChainStartClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -359,14 +359,14 @@ func (mr *MockBeaconNodeValidatorClientMockRecorder) WaitForChainStart(arg0, arg
}
// WaitForSynced mocks base method
func (m *MockBeaconNodeValidatorClient) WaitForSynced(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (v1alpha1.BeaconNodeValidator_WaitForSyncedClient, error) {
func (m *MockBeaconNodeValidatorClient) WaitForSynced(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (eth.BeaconNodeValidator_WaitForSyncedClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "WaitForSynced", varargs...)
ret0, _ := ret[0].(v1alpha1.BeaconNodeValidator_WaitForSyncedClient)
ret0, _ := ret[0].(eth.BeaconNodeValidator_WaitForSyncedClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -445,10 +445,10 @@ func (mr *MockBeaconNodeValidator_WaitForSyncedClientMockRecorder) Header() *gom
}
// Recv mocks base method
func (m *MockBeaconNodeValidator_WaitForSyncedClient) Recv() (*v1alpha1.SyncedResponse, error) {
func (m *MockBeaconNodeValidator_WaitForSyncedClient) Recv() (*eth.SyncedResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*v1alpha1.SyncedResponse)
ret0, _ := ret[0].(*eth.SyncedResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -568,10 +568,10 @@ func (mr *MockBeaconNodeValidator_WaitForChainStartClientMockRecorder) Header()
}
// Recv mocks base method
func (m *MockBeaconNodeValidator_WaitForChainStartClient) Recv() (*v1alpha1.ChainStartResponse, error) {
func (m *MockBeaconNodeValidator_WaitForChainStartClient) Recv() (*eth.ChainStartResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*v1alpha1.ChainStartResponse)
ret0, _ := ret[0].(*eth.ChainStartResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -691,10 +691,10 @@ func (mr *MockBeaconNodeValidator_WaitForActivationClientMockRecorder) Header()
}
// Recv mocks base method
func (m *MockBeaconNodeValidator_WaitForActivationClient) Recv() (*v1alpha1.ValidatorActivationResponse, error) {
func (m *MockBeaconNodeValidator_WaitForActivationClient) Recv() (*eth.ValidatorActivationResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*v1alpha1.ValidatorActivationResponse)
ret0, _ := ret[0].(*eth.ValidatorActivationResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -814,10 +814,10 @@ func (mr *MockBeaconNodeValidator_StreamDutiesClientMockRecorder) Header() *gomo
}
// Recv mocks base method
func (m *MockBeaconNodeValidator_StreamDutiesClient) Recv() (*v1alpha1.DutiesResponse, error) {
func (m *MockBeaconNodeValidator_StreamDutiesClient) Recv() (*eth.DutiesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*v1alpha1.DutiesResponse)
ret0, _ := ret[0].(*eth.DutiesResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}

View File

@@ -10,7 +10,7 @@ import (
types "github.com/gogo/protobuf/types"
gomock "github.com/golang/mock/gomock"
v1alpha1 "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
eth "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
metadata "google.golang.org/grpc/metadata"
)
@@ -38,10 +38,10 @@ func (m *MockBeaconNodeValidatorServer) EXPECT() *MockBeaconNodeValidatorServerM
}
// DomainData mocks base method
func (m *MockBeaconNodeValidatorServer) DomainData(arg0 context.Context, arg1 *v1alpha1.DomainRequest) (*v1alpha1.DomainResponse, error) {
func (m *MockBeaconNodeValidatorServer) DomainData(arg0 context.Context, arg1 *eth.DomainRequest) (*eth.DomainResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DomainData", arg0, arg1)
ret0, _ := ret[0].(*v1alpha1.DomainResponse)
ret0, _ := ret[0].(*eth.DomainResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -53,10 +53,10 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) DomainData(arg0, arg1 inter
}
// GetAttestationData mocks base method
func (m *MockBeaconNodeValidatorServer) GetAttestationData(arg0 context.Context, arg1 *v1alpha1.AttestationDataRequest) (*v1alpha1.AttestationData, error) {
func (m *MockBeaconNodeValidatorServer) GetAttestationData(arg0 context.Context, arg1 *eth.AttestationDataRequest) (*eth.AttestationData, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAttestationData", arg0, arg1)
ret0, _ := ret[0].(*v1alpha1.AttestationData)
ret0, _ := ret[0].(*eth.AttestationData)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -68,10 +68,10 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) GetAttestationData(arg0, ar
}
// GetBlock mocks base method
func (m *MockBeaconNodeValidatorServer) GetBlock(arg0 context.Context, arg1 *v1alpha1.BlockRequest) (*v1alpha1.BeaconBlock, error) {
func (m *MockBeaconNodeValidatorServer) GetBlock(arg0 context.Context, arg1 *eth.BlockRequest) (*eth.BeaconBlock, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBlock", arg0, arg1)
ret0, _ := ret[0].(*v1alpha1.BeaconBlock)
ret0, _ := ret[0].(*eth.BeaconBlock)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -83,10 +83,10 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) GetBlock(arg0, arg1 interfa
}
// GetDuties mocks base method
func (m *MockBeaconNodeValidatorServer) GetDuties(arg0 context.Context, arg1 *v1alpha1.DutiesRequest) (*v1alpha1.DutiesResponse, error) {
func (m *MockBeaconNodeValidatorServer) GetDuties(arg0 context.Context, arg1 *eth.DutiesRequest) (*eth.DutiesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetDuties", arg0, arg1)
ret0, _ := ret[0].(*v1alpha1.DutiesResponse)
ret0, _ := ret[0].(*eth.DutiesResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -98,10 +98,10 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) GetDuties(arg0, arg1 interf
}
// MultipleValidatorStatus mocks base method
func (m *MockBeaconNodeValidatorServer) MultipleValidatorStatus(arg0 context.Context, arg1 *v1alpha1.MultipleValidatorStatusRequest) (*v1alpha1.MultipleValidatorStatusResponse, error) {
func (m *MockBeaconNodeValidatorServer) MultipleValidatorStatus(arg0 context.Context, arg1 *eth.MultipleValidatorStatusRequest) (*eth.MultipleValidatorStatusResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MultipleValidatorStatus", arg0, arg1)
ret0, _ := ret[0].(*v1alpha1.MultipleValidatorStatusResponse)
ret0, _ := ret[0].(*eth.MultipleValidatorStatusResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -113,10 +113,10 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) MultipleValidatorStatus(arg
}
// ProposeAttestation mocks base method
func (m *MockBeaconNodeValidatorServer) ProposeAttestation(arg0 context.Context, arg1 *v1alpha1.Attestation) (*v1alpha1.AttestResponse, error) {
func (m *MockBeaconNodeValidatorServer) ProposeAttestation(arg0 context.Context, arg1 *eth.Attestation) (*eth.AttestResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ProposeAttestation", arg0, arg1)
ret0, _ := ret[0].(*v1alpha1.AttestResponse)
ret0, _ := ret[0].(*eth.AttestResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -128,10 +128,10 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) ProposeAttestation(arg0, ar
}
// ProposeBlock mocks base method
func (m *MockBeaconNodeValidatorServer) ProposeBlock(arg0 context.Context, arg1 *v1alpha1.SignedBeaconBlock) (*v1alpha1.ProposeResponse, error) {
func (m *MockBeaconNodeValidatorServer) ProposeBlock(arg0 context.Context, arg1 *eth.SignedBeaconBlock) (*eth.ProposeResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ProposeBlock", arg0, arg1)
ret0, _ := ret[0].(*v1alpha1.ProposeResponse)
ret0, _ := ret[0].(*eth.ProposeResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -143,7 +143,7 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) ProposeBlock(arg0, arg1 int
}
// ProposeExit mocks base method
func (m *MockBeaconNodeValidatorServer) ProposeExit(arg0 context.Context, arg1 *v1alpha1.SignedVoluntaryExit) (*types.Empty, error) {
func (m *MockBeaconNodeValidatorServer) ProposeExit(arg0 context.Context, arg1 *eth.SignedVoluntaryExit) (*types.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ProposeExit", arg0, arg1)
ret0, _ := ret[0].(*types.Empty)
@@ -158,7 +158,7 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) ProposeExit(arg0, arg1 inte
}
// StreamDuties mocks base method
func (m *MockBeaconNodeValidatorServer) StreamDuties(arg0 *v1alpha1.DutiesRequest, arg1 v1alpha1.BeaconNodeValidator_StreamDutiesServer) error {
func (m *MockBeaconNodeValidatorServer) StreamDuties(arg0 *eth.DutiesRequest, arg1 eth.BeaconNodeValidator_StreamDutiesServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StreamDuties", arg0, arg1)
ret0, _ := ret[0].(error)
@@ -172,10 +172,10 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) StreamDuties(arg0, arg1 int
}
// SubmitAggregateSelectionProof mocks base method
func (m *MockBeaconNodeValidatorServer) SubmitAggregateSelectionProof(arg0 context.Context, arg1 *v1alpha1.AggregateSelectionRequest) (*v1alpha1.AggregateSelectionResponse, error) {
func (m *MockBeaconNodeValidatorServer) SubmitAggregateSelectionProof(arg0 context.Context, arg1 *eth.AggregateSelectionRequest) (*eth.AggregateSelectionResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SubmitAggregateSelectionProof", arg0, arg1)
ret0, _ := ret[0].(*v1alpha1.AggregateSelectionResponse)
ret0, _ := ret[0].(*eth.AggregateSelectionResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -187,10 +187,10 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) SubmitAggregateSelectionPro
}
// SubmitSignedAggregateSelectionProof mocks base method
func (m *MockBeaconNodeValidatorServer) SubmitSignedAggregateSelectionProof(arg0 context.Context, arg1 *v1alpha1.SignedAggregateSubmitRequest) (*v1alpha1.SignedAggregateSubmitResponse, error) {
func (m *MockBeaconNodeValidatorServer) SubmitSignedAggregateSelectionProof(arg0 context.Context, arg1 *eth.SignedAggregateSubmitRequest) (*eth.SignedAggregateSubmitResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SubmitSignedAggregateSelectionProof", arg0, arg1)
ret0, _ := ret[0].(*v1alpha1.SignedAggregateSubmitResponse)
ret0, _ := ret[0].(*eth.SignedAggregateSubmitResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -202,7 +202,7 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) SubmitSignedAggregateSelect
}
// SubscribeCommitteeSubnets mocks base method
func (m *MockBeaconNodeValidatorServer) SubscribeCommitteeSubnets(arg0 context.Context, arg1 *v1alpha1.CommitteeSubnetsSubscribeRequest) (*types.Empty, error) {
func (m *MockBeaconNodeValidatorServer) SubscribeCommitteeSubnets(arg0 context.Context, arg1 *eth.CommitteeSubnetsSubscribeRequest) (*types.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SubscribeCommitteeSubnets", arg0, arg1)
ret0, _ := ret[0].(*types.Empty)
@@ -217,10 +217,10 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) SubscribeCommitteeSubnets(a
}
// ValidatorIndex mocks base method
func (m *MockBeaconNodeValidatorServer) ValidatorIndex(arg0 context.Context, arg1 *v1alpha1.ValidatorIndexRequest) (*v1alpha1.ValidatorIndexResponse, error) {
func (m *MockBeaconNodeValidatorServer) ValidatorIndex(arg0 context.Context, arg1 *eth.ValidatorIndexRequest) (*eth.ValidatorIndexResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ValidatorIndex", arg0, arg1)
ret0, _ := ret[0].(*v1alpha1.ValidatorIndexResponse)
ret0, _ := ret[0].(*eth.ValidatorIndexResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -232,10 +232,10 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) ValidatorIndex(arg0, arg1 i
}
// ValidatorStatus mocks base method
func (m *MockBeaconNodeValidatorServer) ValidatorStatus(arg0 context.Context, arg1 *v1alpha1.ValidatorStatusRequest) (*v1alpha1.ValidatorStatusResponse, error) {
func (m *MockBeaconNodeValidatorServer) ValidatorStatus(arg0 context.Context, arg1 *eth.ValidatorStatusRequest) (*eth.ValidatorStatusResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ValidatorStatus", arg0, arg1)
ret0, _ := ret[0].(*v1alpha1.ValidatorStatusResponse)
ret0, _ := ret[0].(*eth.ValidatorStatusResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -247,7 +247,7 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) ValidatorStatus(arg0, arg1
}
// WaitForActivation mocks base method
func (m *MockBeaconNodeValidatorServer) WaitForActivation(arg0 *v1alpha1.ValidatorActivationRequest, arg1 v1alpha1.BeaconNodeValidator_WaitForActivationServer) error {
func (m *MockBeaconNodeValidatorServer) WaitForActivation(arg0 *eth.ValidatorActivationRequest, arg1 eth.BeaconNodeValidator_WaitForActivationServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitForActivation", arg0, arg1)
ret0, _ := ret[0].(error)
@@ -261,7 +261,7 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) WaitForActivation(arg0, arg
}
// WaitForChainStart mocks base method
func (m *MockBeaconNodeValidatorServer) WaitForChainStart(arg0 *types.Empty, arg1 v1alpha1.BeaconNodeValidator_WaitForChainStartServer) error {
func (m *MockBeaconNodeValidatorServer) WaitForChainStart(arg0 *types.Empty, arg1 eth.BeaconNodeValidator_WaitForChainStartServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitForChainStart", arg0, arg1)
ret0, _ := ret[0].(error)
@@ -275,7 +275,7 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) WaitForChainStart(arg0, arg
}
// WaitForSynced mocks base method
func (m *MockBeaconNodeValidatorServer) WaitForSynced(arg0 *types.Empty, arg1 v1alpha1.BeaconNodeValidator_WaitForSyncedServer) error {
func (m *MockBeaconNodeValidatorServer) WaitForSynced(arg0 *types.Empty, arg1 eth.BeaconNodeValidator_WaitForSyncedServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "WaitForSynced", arg0, arg1)
ret0, _ := ret[0].(error)
@@ -340,7 +340,7 @@ func (mr *MockBeaconNodeValidator_WaitForSyncedServerMockRecorder) RecvMsg(arg0
}
// Send mocks base method
func (m *MockBeaconNodeValidator_WaitForSyncedServer) Send(arg0 *v1alpha1.SyncedResponse) error {
func (m *MockBeaconNodeValidator_WaitForSyncedServer) Send(arg0 *eth.SyncedResponse) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
@@ -459,7 +459,7 @@ func (mr *MockBeaconNodeValidator_WaitForActivationServerMockRecorder) RecvMsg(a
}
// Send mocks base method
func (m *MockBeaconNodeValidator_WaitForActivationServer) Send(arg0 *v1alpha1.ValidatorActivationResponse) error {
func (m *MockBeaconNodeValidator_WaitForActivationServer) Send(arg0 *eth.ValidatorActivationResponse) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
@@ -578,7 +578,7 @@ func (mr *MockBeaconNodeValidator_WaitForChainStartServerMockRecorder) RecvMsg(a
}
// Send mocks base method
func (m *MockBeaconNodeValidator_WaitForChainStartServer) Send(arg0 *v1alpha1.ChainStartResponse) error {
func (m *MockBeaconNodeValidator_WaitForChainStartServer) Send(arg0 *eth.ChainStartResponse) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
@@ -697,7 +697,7 @@ func (mr *MockBeaconNodeValidator_StreamDutiesServerMockRecorder) RecvMsg(arg0 i
}
// Send mocks base method
func (m *MockBeaconNodeValidator_StreamDutiesServer) Send(arg0 *v1alpha1.DutiesResponse) error {
func (m *MockBeaconNodeValidator_StreamDutiesServer) Send(arg0 *eth.DutiesResponse) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)

78
shared/mock/keymanager_mock.go generated Normal file
View File

@@ -0,0 +1,78 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/prysmaticlabs/prysm/proto/validator/accounts/v2 (interfaces: RemoteSignerClient)
// Package mock is a generated GoMock package.
package mock
import (
context "context"
reflect "reflect"
types "github.com/gogo/protobuf/types"
gomock "github.com/golang/mock/gomock"
ethereum_validator_accounts_v2 "github.com/prysmaticlabs/prysm/proto/validator/accounts/v2"
grpc "google.golang.org/grpc"
)
// MockRemoteSignerClient is a mock of RemoteSignerClient interface
type MockRemoteSignerClient struct {
ctrl *gomock.Controller
recorder *MockRemoteSignerClientMockRecorder
}
// MockRemoteSignerClientMockRecorder is the mock recorder for MockRemoteSignerClient
type MockRemoteSignerClientMockRecorder struct {
mock *MockRemoteSignerClient
}
// NewMockRemoteSignerClient creates a new mock instance
func NewMockRemoteSignerClient(ctrl *gomock.Controller) *MockRemoteSignerClient {
mock := &MockRemoteSignerClient{ctrl: ctrl}
mock.recorder = &MockRemoteSignerClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockRemoteSignerClient) EXPECT() *MockRemoteSignerClientMockRecorder {
return m.recorder
}
// ListValidatingPublicKeys mocks base method
func (m *MockRemoteSignerClient) ListValidatingPublicKeys(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*ethereum_validator_accounts_v2.ListPublicKeysResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListValidatingPublicKeys", varargs...)
ret0, _ := ret[0].(*ethereum_validator_accounts_v2.ListPublicKeysResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListValidatingPublicKeys indicates an expected call of ListValidatingPublicKeys
func (mr *MockRemoteSignerClientMockRecorder) ListValidatingPublicKeys(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidatingPublicKeys", reflect.TypeOf((*MockRemoteSignerClient)(nil).ListValidatingPublicKeys), varargs...)
}
// Sign mocks base method
func (m *MockRemoteSignerClient) Sign(arg0 context.Context, arg1 *ethereum_validator_accounts_v2.SignRequest, arg2 ...grpc.CallOption) (*ethereum_validator_accounts_v2.SignResponse, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Sign", varargs...)
ret0, _ := ret[0].(*ethereum_validator_accounts_v2.SignResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Sign indicates an expected call of Sign
func (mr *MockRemoteSignerClientMockRecorder) Sign(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sign", reflect.TypeOf((*MockRemoteSignerClient)(nil).Sign), varargs...)
}

View File

@@ -10,7 +10,7 @@ import (
types "github.com/gogo/protobuf/types"
gomock "github.com/golang/mock/gomock"
v1alpha1 "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
eth "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
grpc "google.golang.org/grpc"
)
@@ -38,14 +38,14 @@ func (m *MockNodeClient) EXPECT() *MockNodeClientMockRecorder {
}
// GetGenesis mocks base method
func (m *MockNodeClient) GetGenesis(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*v1alpha1.Genesis, error) {
func (m *MockNodeClient) GetGenesis(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*eth.Genesis, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetGenesis", varargs...)
ret0, _ := ret[0].(*v1alpha1.Genesis)
ret0, _ := ret[0].(*eth.Genesis)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -58,14 +58,14 @@ func (mr *MockNodeClientMockRecorder) GetGenesis(arg0, arg1 interface{}, arg2 ..
}
// GetHost mocks base method
func (m *MockNodeClient) GetHost(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*v1alpha1.HostData, error) {
func (m *MockNodeClient) GetHost(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*eth.HostData, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetHost", varargs...)
ret0, _ := ret[0].(*v1alpha1.HostData)
ret0, _ := ret[0].(*eth.HostData)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -78,14 +78,14 @@ func (mr *MockNodeClientMockRecorder) GetHost(arg0, arg1 interface{}, arg2 ...in
}
// GetPeer mocks base method
func (m *MockNodeClient) GetPeer(arg0 context.Context, arg1 *v1alpha1.PeerRequest, arg2 ...grpc.CallOption) (*v1alpha1.Peer, error) {
func (m *MockNodeClient) GetPeer(arg0 context.Context, arg1 *eth.PeerRequest, arg2 ...grpc.CallOption) (*eth.Peer, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetPeer", varargs...)
ret0, _ := ret[0].(*v1alpha1.Peer)
ret0, _ := ret[0].(*eth.Peer)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -98,14 +98,14 @@ func (mr *MockNodeClientMockRecorder) GetPeer(arg0, arg1 interface{}, arg2 ...in
}
// GetSyncStatus mocks base method
func (m *MockNodeClient) GetSyncStatus(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*v1alpha1.SyncStatus, error) {
func (m *MockNodeClient) GetSyncStatus(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*eth.SyncStatus, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetSyncStatus", varargs...)
ret0, _ := ret[0].(*v1alpha1.SyncStatus)
ret0, _ := ret[0].(*eth.SyncStatus)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -118,14 +118,14 @@ func (mr *MockNodeClientMockRecorder) GetSyncStatus(arg0, arg1 interface{}, arg2
}
// GetVersion mocks base method
func (m *MockNodeClient) GetVersion(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*v1alpha1.Version, error) {
func (m *MockNodeClient) GetVersion(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*eth.Version, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetVersion", varargs...)
ret0, _ := ret[0].(*v1alpha1.Version)
ret0, _ := ret[0].(*eth.Version)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -138,14 +138,14 @@ func (mr *MockNodeClientMockRecorder) GetVersion(arg0, arg1 interface{}, arg2 ..
}
// ListImplementedServices mocks base method
func (m *MockNodeClient) ListImplementedServices(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*v1alpha1.ImplementedServices, error) {
func (m *MockNodeClient) ListImplementedServices(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*eth.ImplementedServices, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListImplementedServices", varargs...)
ret0, _ := ret[0].(*v1alpha1.ImplementedServices)
ret0, _ := ret[0].(*eth.ImplementedServices)
ret1, _ := ret[1].(error)
return ret0, ret1
}
@@ -158,14 +158,14 @@ func (mr *MockNodeClientMockRecorder) ListImplementedServices(arg0, arg1 interfa
}
// ListPeers mocks base method
func (m *MockNodeClient) ListPeers(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*v1alpha1.Peers, error) {
func (m *MockNodeClient) ListPeers(arg0 context.Context, arg1 *types.Empty, arg2 ...grpc.CallOption) (*eth.Peers, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ListPeers", varargs...)
ret0, _ := ret[0].(*v1alpha1.Peers)
ret0, _ := ret[0].(*eth.Peers)
ret1, _ := ret[1].(error)
return ret0, ret1
}

View File

@@ -186,13 +186,13 @@ func (w *Wallet) AccountNames() ([]string, error) {
func (w *Wallet) ExistingKeyManager(
ctx context.Context,
) (v2keymanager.IKeymanager, error) {
configFile, err := w.ReadKeymanagerConfigFromDisk(ctx)
if err != nil {
return nil, errors.Wrap(err, "could not read keymanager config")
}
var keymanager v2keymanager.IKeymanager
switch w.KeymanagerKind() {
case v2keymanager.Direct:
configFile, err := w.ReadKeymanagerConfigFromDisk(ctx)
if err != nil {
return nil, errors.Wrap(err, "could not read keymanager config")
}
cfg, err := direct.UnmarshalConfigFile(configFile)
if err != nil {
return nil, errors.Wrap(err, "could not unmarshal keymanager config file")

View File

@@ -179,8 +179,8 @@ func (v *validator) signAtt(ctx context.Context, pubKey [48]byte, data *ethpb.At
var sig bls.Signature
if featureconfig.Get().EnableAccountsV2 {
sig, err = v.keyManagerV2.Sign(ctx, &validatorpb.SignRequest{
PublicKey: pubKey[:],
Data: root[:],
PublicKey: pubKey[:],
SigningRoot: root[:],
})
} else {
if protectingKeymanager, supported := v.keyManager.(keymanager.ProtectingKeyManager); supported {

View File

@@ -147,8 +147,8 @@ func (v *validator) signBlock(ctx context.Context, pubKey [48]byte, epoch uint64
return nil, errors.Wrap(err, "could not get signing root")
}
sig, err = v.keyManagerV2.Sign(ctx, &validatorpb.SignRequest{
PublicKey: pubKey[:],
Data: blockRoot[:],
PublicKey: pubKey[:],
SigningRoot: blockRoot[:],
})
if err != nil {
return nil, errors.Wrap(err, "could not sign block proposal")

View File

@@ -198,8 +198,8 @@ func (v *validator) signObject(
return nil, err
}
return v.keyManagerV2.Sign(ctx, &validatorpb.SignRequest{
PublicKey: pubKey[:],
Data: root[:],
PublicKey: pubKey[:],
SigningRoot: root[:],
})
}
if protectingKeymanager, supported := v.keyManager.(keymanager.ProtectingKeyManager); supported {

View File

@@ -26,7 +26,7 @@ import (
keystorev4 "github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4"
)
var log = logrus.WithField("prefix", "keymanager-v2")
var log = logrus.WithField("prefix", "direct-keymanager-v2")
const (
// DepositTransactionFileName for the encoded, eth1 raw deposit tx data
@@ -252,7 +252,7 @@ func (dr *Keymanager) Sign(ctx context.Context, req *validatorpb.SignRequest) (b
if !ok {
return nil, errors.New("no signing key found in keys cache")
}
return secretKey.Sign(req.Data), nil
return secretKey.Sign(req.SigningRoot), nil
}
func (dr *Keymanager) initializeSecretKeysCache() error {

View File

@@ -186,8 +186,8 @@ func TestKeymanager_Sign(t *testing.T) {
// We prepare naive data to sign.
data := []byte("hello world")
signRequest := &validatorpb.SignRequest{
PublicKey: publicKeys[0][:],
Data: data,
PublicKey: publicKeys[0][:],
SigningRoot: data,
}
sig, err := dr.Sign(ctx, signRequest)
if err != nil {

View File

@@ -40,7 +40,7 @@ This direct keymanager can be customized via a keymanageropts.json file, which h
JSON schema as its options:
{
direct_eip_version: string
"direct_eip_version": "EIP-2335"
}
Currently, the only supported value for `direct_eip_version` is "EIP-2335".

View File

@@ -0,0 +1,39 @@
load("@io_bazel_rules_go//go:def.bzl", "go_test")
load("@prysm//tools/go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"remote.go",
],
importpath = "github.com/prysmaticlabs/prysm/validator/keymanager/v2/remote",
visibility = [
"//validator:__pkg__",
"//validator:__subpackages__",
],
deps = [
"//proto/validator/accounts/v2:go_default_library",
"//shared/bls:go_default_library",
"//shared/bytesutil:go_default_library",
"@com_github_gogo_protobuf//types:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//credentials:go_default_library",
],
)
go_test(
name = "go_default_test",
srcs = ["remote_test.go"],
embed = [":go_default_library"],
deps = [
"//proto/validator/accounts/v2:go_default_library",
"//shared/bls:go_default_library",
"//shared/mock:go_default_library",
"//shared/params:go_default_library",
"//shared/testutil:go_default_library",
"@com_github_golang_mock//gomock:go_default_library",
],
)

View File

@@ -0,0 +1,59 @@
/*
Package remote defines an implementation of an on-disk, EIP-2335 keystore.json
approach towards defining validator accounts in Prysm. A validating private key is
encrypted using a passphrase and its resulting encrypted file is stored as a
keystore.json file under a unique, human-readable, account namespace. This direct keymanager approach
relies on storing account information on-disk, making it trivial to import, export and
list all associated accounts for a user.
Package remote defines a keymanager implementation which connects to a remote signer
server via gRPC. The connection is established via TLS using supplied paths to
certificates and key files and allows for submitting remote signing requests for
eth2 data structures as well as retrieving the available signing public keys from
the remote server.
Remote sign requests are defined by the following protobuf schema:
// SignRequest is a message type used by a keymanager
// as part of Prysm's accounts implementation.
message SignRequest {
// 48 byte public key corresponding to an associated private key
// being requested to sign data.
bytes public_key = 1;
// Raw bytes signing root the client is requesting to sign. The client is
// expected to determine these raw bytes from the appropriate BLS
// signing domain as well as the signing root of the data structure
// the bytes represent.
bytes signing_root = 2;
}
Remote signing responses will contain a BLS12-381 signature along with the
status of the signing response from the remote server, signifying the
request either failed, was denied, or completed successfully.
message SignResponse {
enum Status {
UNKNOWN = 0;
SUCCEEDED = 1;
DENIED = 2;
FAILED = 3;
}
// BLS12-381 signature for the data specified in the request.
bytes signature = 1;
}
The remote keymanager can be customized via a keymanageropts.json file
which requires the following schema:
{
"remote_address": "remoteserver.com:4000", // Remote gRPC server address.
"remote_cert": {
"crt_path": "/home/eth2/certs/client.crt", // Client certificate path.
"ca_crt_path": "/home/eth2/certs/ca.crt", // Certificate authority cert path.
"key_path": "/home/eth2/certs/client.key", // Client key path.
}
}
*/
package remote

View File

@@ -0,0 +1,162 @@
package remote
import (
"context"
"crypto/tls"
"crypto/x509"
"encoding/json"
"io"
"io/ioutil"
ptypes "github.com/gogo/protobuf/types"
"github.com/pkg/errors"
validatorpb "github.com/prysmaticlabs/prysm/proto/validator/accounts/v2"
"github.com/prysmaticlabs/prysm/shared/bls"
"github.com/prysmaticlabs/prysm/shared/bytesutil"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)
var (
log = logrus.WithField("prefix", "remote-keymanager-v2")
// ErrSigningFailed defines a failure from the remote server
// when performing a signing operation.
ErrSigningFailed = errors.New("signing failed in the remote server")
// ErrSigningDenied defines a failure from the remote server when
// performing a signing operation was denied by a remote server.
ErrSigningDenied = errors.New("signing request was denied by remote server")
)
// Config for a remote keymanager.
type Config struct {
RemoteCertificate *CertificateConfig `json:"remote_cert"`
RemoteAddr string `json:"remote_address"`
}
// CertificateConfig defines configuration options for
// certificate authority certs, client certs, and client keys
// for TLS gRPC connections.
type CertificateConfig struct {
ClientCertPath string `json:"crt_path"`
ClientKeyPath string `json:"key_path"`
CACertPath string `json:"ca_crt_path"`
}
// Keymanager implementation using remote signing keys via gRPC.
type Keymanager struct {
cfg *Config
client validatorpb.RemoteSignerClient
accountsByPubkey map[[48]byte]string
}
// NewKeymanager instantiates a new direct keymanager from configuration options.
func NewKeymanager(ctx context.Context, maxMessageSize int, cfg *Config) (*Keymanager, error) {
// Load the client certificates.
if cfg.RemoteCertificate == nil {
return nil, errors.New("certificates are required")
}
if cfg.RemoteCertificate.ClientCertPath == "" {
return nil, errors.New("client certificate is required")
}
if cfg.RemoteCertificate.ClientKeyPath == "" {
return nil, errors.New("client key is required")
}
clientPair, err := tls.LoadX509KeyPair(cfg.RemoteCertificate.ClientCertPath, cfg.RemoteCertificate.ClientKeyPath)
if err != nil {
return nil, errors.Wrap(err, "failed to obtain client's certificate and/or key")
}
// Load the CA for the server certificate if present.
cp := x509.NewCertPool()
if cfg.RemoteCertificate.CACertPath != "" {
serverCA, err := ioutil.ReadFile(cfg.RemoteCertificate.CACertPath)
if err != nil {
return nil, errors.Wrap(err, "failed to obtain server's CA certificate")
}
if !cp.AppendCertsFromPEM(serverCA) {
return nil, errors.Wrap(err, "failed to add server's CA certificate to pool")
}
}
tlsCfg := &tls.Config{
Certificates: []tls.Certificate{clientPair},
RootCAs: cp,
}
clientCreds := credentials.NewTLS(tlsCfg)
grpcOpts := []grpc.DialOption{
// Require TLS with client certificate.
grpc.WithTransportCredentials(clientCreds),
// Receive large messages without erroring.
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxMessageSize)),
}
conn, err := grpc.Dial(cfg.RemoteAddr, grpcOpts...)
if err != nil {
return nil, errors.New("failed to connect to remote wallet")
}
client := validatorpb.NewRemoteSignerClient(conn)
k := &Keymanager{
cfg: cfg,
client: client,
accountsByPubkey: make(map[[48]byte]string),
}
return k, nil
}
// UnmarshalConfigFile attempts to JSON unmarshal a direct keymanager
// configuration file into the *Config{} struct.
func UnmarshalConfigFile(r io.ReadCloser) (*Config, error) {
enc, err := ioutil.ReadAll(r)
if err != nil {
return nil, err
}
defer func() {
if err := r.Close(); err != nil {
log.Errorf("Could not close keymanager config file: %v", err)
}
}()
cfg := &Config{}
if err := json.Unmarshal(enc, cfg); err != nil {
return nil, err
}
return cfg, nil
}
// CreateAccount based on the keymanager's logic. Returns the account name.
func (k *Keymanager) CreateAccount(ctx context.Context, password string) (string, error) {
return "", errors.New("a remote validator account cannot be created from the client")
}
// MarshalConfigFile for the keymanager's options.
func (k *Keymanager) MarshalConfigFile(ctx context.Context) ([]byte, error) {
return json.MarshalIndent(k.cfg, "", "\t")
}
// FetchValidatingPublicKeys fetches the list of public keys that should be used to validate with.
func (k *Keymanager) FetchValidatingPublicKeys(ctx context.Context) ([][48]byte, error) {
resp, err := k.client.ListValidatingPublicKeys(ctx, &ptypes.Empty{})
if err != nil {
return nil, errors.Wrap(err, "could not list accounts from remote server")
}
pubKeys := make([][48]byte, len(resp.ValidatingPublicKeys))
for i := range resp.ValidatingPublicKeys {
pubKeys[i] = bytesutil.ToBytes48(resp.ValidatingPublicKeys[i])
}
return pubKeys, nil
}
// Sign signs a message for a validator key via a gRPC request.
func (k *Keymanager) Sign(ctx context.Context, req *validatorpb.SignRequest) (bls.Signature, error) {
resp, err := k.client.Sign(ctx, req)
if err != nil {
return nil, err
}
switch resp.Status {
case validatorpb.SignResponse_DENIED:
return nil, ErrSigningDenied
case validatorpb.SignResponse_FAILED:
return nil, ErrSigningFailed
}
return bls.SignatureFromBytes(resp.Signature)
}

View File

@@ -0,0 +1,336 @@
package remote
import (
"bytes"
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"reflect"
"strconv"
"strings"
"testing"
"github.com/golang/mock/gomock"
validatorpb "github.com/prysmaticlabs/prysm/proto/validator/accounts/v2"
"github.com/prysmaticlabs/prysm/shared/bls"
"github.com/prysmaticlabs/prysm/shared/mock"
"github.com/prysmaticlabs/prysm/shared/params"
"github.com/prysmaticlabs/prysm/shared/testutil"
)
var validClientCert = `-----BEGIN CERTIFICATE-----
MIIEITCCAgmgAwIBAgIQXUJWQZgVO4IX+zlWGI1/mTANBgkqhkiG9w0BAQsFADAU
MRIwEAYDVQQDEwlBdHRlc3RhbnQwHhcNMjAwMzE3MDgwNjU3WhcNMjEwOTE3MDc1
OTUyWjASMRAwDgYDVQQDEwdjbGllbnQxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
MIIBCgKCAQEAsc977g16Tan2j7YuA+zQOlDntb4Bkfs4sDOznOEvnozHwRZOgfcP
jVcA9AS5eZOGIRrsTssptrgVNDPoIHWoKk7LAKyyLM3dGp5PWeyMBoQA5cq+yPAT
4JkJpDnBFfwxXB99osJH0z3jSTRa62CSVvPRBisK4B9AlLQfcleEQlKJugy9tOAj
G7zodwEi+J4AYQHmOiwL38ZsKq9We5y4HMQ0E7de0FoU5QHrtuPNrTuwVwrq825l
cEAAFey6Btngx+sziysPHWHYOq4xOZ1UPBApeaAFLguzusc/4VwM7kzRNr4VOD8a
eC3CtKLhBBVVxHI5ZlaHS+YylNGYD4+FxQIDAQABo3EwbzAOBgNVHQ8BAf8EBAMC
A7gwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB0GA1UdDgQWBBQDGCE0
3k4rHzB+Ycf3pt1MzeDPgzAfBgNVHSMEGDAWgBScIYZa4dQBIW/gVwR0ctGCuHhe
9jANBgkqhkiG9w0BAQsFAAOCAgEAHG/EfvqIwbhYfci+zRCYC7aQPuvhivJblBwN
mbXo2qsxvje1hcKm0ptJLOy/cjJzeLJYREhQlXDPRJC/xgELnbXRjgag82r35+pf
wVJwP6Yw53VCM3o0QKsUrKyMm4sAijOBrJyqpB5untAieZsry5Bfj0S4YobbtdJa
VsEioU07fVVczf5lYN0XrLgRnXq3LMkTiZ6drFiqLkwmXQZVxNujmcaFSm7yCALl
EdhYNmaqedS5me5UOGxwPacrsZwWF9dvMsl3OswgTcaGdsUtx2/q+S2vbZUAM/Gw
qaTanDfvVtVTF7KzVN9hiqKe4mO0HHHK2HWJYBLdRJjInOgRW+53hCmUhLxD+Dq+
31jLKxn/Y4hyH9E+55b1sJHCFpsbEtVD53fojiH2C/uLbhq4Wr1PXgOoxzf2KeSQ
B3ENu8C4b6AlNhqOnz5zeDcx8Ug0vMfVDAwf6RAYMG5b/MoWNKcLNXhk8H1nbVkt
16ppjh6I27JqfNqfP2J/p3BF++ZugZuWfN9DRaJ6UPz+yyF7eW8fyDAQNl7LS0Kh
8PlF5cYvyIIKVHe38Mn8ZAWboKUs0xNv2vhA9V/4Q1ZzAEkXjmbk8H26sjGvJnvg
Lgm/+6LVWR4EnUlU8aEWASEpTWq2lSRF3ZOvNstHnufyiDfcwDcl/IKKQiVQQ3mX
tw8Jf74=
-----END CERTIFICATE-----`
var validClientKey = `-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAsc977g16Tan2j7YuA+zQOlDntb4Bkfs4sDOznOEvnozHwRZO
gfcPjVcA9AS5eZOGIRrsTssptrgVNDPoIHWoKk7LAKyyLM3dGp5PWeyMBoQA5cq+
yPAT4JkJpDnBFfwxXB99osJH0z3jSTRa62CSVvPRBisK4B9AlLQfcleEQlKJugy9
tOAjG7zodwEi+J4AYQHmOiwL38ZsKq9We5y4HMQ0E7de0FoU5QHrtuPNrTuwVwrq
825lcEAAFey6Btngx+sziysPHWHYOq4xOZ1UPBApeaAFLguzusc/4VwM7kzRNr4V
OD8aeC3CtKLhBBVVxHI5ZlaHS+YylNGYD4+FxQIDAQABAoIBAQCjV2MVcDQmHDhw
FH95A5bVu3TgM8flfs64rwYU25iPIexuqDs+kOMsh/xMLfrkgGz7BGyIhYGwZLK1
3ekjyHHPS8qYuAyFtCelSEDE7tRDOAhLEFDq7gCUloGQ561EsQP3CMa1OZwZpgSh
PwM2ruRAFIK0E95NvOfqsv0gYN0Svo7hYjNsvW6ok/ZGMyN2ikcRR04wGOFOGjfT
xTmfURc9ejnOjHAOqLTpToPwM1/gWWR2iMQefC4njy4MO2BXqOPUmHxmmR4PYhu2
8EcKbyRs+/fvL3GgD3VAlOe5vnkfBzssQhHmexgSk5lHZrcSxUGXYGrYKPAeV2mk
5HRBWp0RAoGBAOUn5w+NCAugcTGP0hfNlyGXsXqUZvnMyFWvUcxgzgPlJyEyDnKn
aIb1DFOF2HckCfLZdrHqqgaF6K3TDvW9BgSKIsvISpo1S95ZPD6DKUo6YQ10CQRW
q/ZZVbxtFksVgFRGYpCVmPNULmx7CiXDT1b/suwNMAwCZwiNPTSvKQVLAoGBAMaj
zDo1/eepRslqnz5s8hh7dGEjfG/ZJcLgAJAxCyAgnIP4Tls7QkNhCVp9LcN6i1bc
CnT6AIuZRXSJWEdp4k2QnVFUmh9Q5MGgwrKYSY5M/1puTISlF1yQ8J6FX8BlDVmy
4dyaSyC0RIvgBzF9/KBDxxmJcHgGQ0awLeeyl4cvAoGBAN83FS3itLmOmXQrofyp
uNNyDeFXeU9OmL5OPqGUkljc+Favib9JLtp3DIC3WfoD0uUJy0LXULN18QaRFnts
mtYFMIvMGE9KJxL5XWOPI8M4Rp1yL+5X9r3Km2cl45dT5GMzBIPOFOTBVU86MtJC
A6C9Bi5FUk4AcRi1a69MB+stAoGAWNiwoyS9IV38dGCFQ4W1LzAg2MXnhZuJoUVR
2yykfkU33Gs2mOXDeKGxblDpJDLumfYnkzSzA72VbE92NdLtTqYtR1Bg8zraZqTC
EOG+nLBh0o/dF8ND1LpbdXvQXRyVwRYaofI9Qi5/LlUQwplIYmKObiSkMnsSok5w
6d5emi8CgYBjtUihOFaAmgqkTHOn4j4eKS1O7/H8QQSVe5M0bocmAIbgJ4At3GnI
E1JcIY2SZtSwAWs6aQPGE42gwsNCCsQWdJNtViO23JbCwlcPToC4aDfc0JJNaYqp
oVV7C5jmJh9VRd2tXIXIZMMNOfThfNf2qDQuJ1S2t5KugozFiRsHUg==
-----END RSA PRIVATE KEY-----`
func TestNewRemoteKeymanager(t *testing.T) {
tests := []struct {
name string
opts *Config
clientCert string
clientKey string
caCert string
err string
}{
{
name: "NoCertificates",
opts: &Config{
RemoteCertificate: nil,
},
err: "certificates are required",
},
{
name: "NoClientCertificate",
opts: &Config{
RemoteCertificate: &CertificateConfig{},
},
err: "client certificate is required",
},
{
name: "NoClientKey",
opts: &Config{
RemoteCertificate: &CertificateConfig{
ClientCertPath: "/foo/client.crt",
ClientKeyPath: "",
},
},
err: "client key is required",
},
{
name: "MissingClientKey",
opts: &Config{
RemoteCertificate: &CertificateConfig{
ClientCertPath: "/foo/client.crt",
ClientKeyPath: "/foo/client.key",
CACertPath: "",
},
},
err: "failed to obtain client's certificate and/or key",
},
{
name: "BadClientCert",
clientCert: `bad`,
clientKey: validClientKey,
opts: &Config{
RemoteCertificate: &CertificateConfig{},
},
err: "failed to obtain client's certificate and/or key: tls: failed to find any PEM data in certificate input",
},
{
name: "BadClientKey",
clientCert: validClientCert,
clientKey: `bad`,
opts: &Config{
RemoteCertificate: &CertificateConfig{},
},
err: "failed to obtain client's certificate and/or key: tls: failed to find any PEM data in key input",
},
{
name: "MissingCACert",
clientCert: validClientCert,
clientKey: validClientKey,
opts: &Config{
RemoteCertificate: &CertificateConfig{
CACertPath: `bad`,
},
},
err: "failed to obtain server's CA certificate: open bad: no such file or directory",
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
if test.caCert != "" || test.clientCert != "" || test.clientKey != "" {
dir := fmt.Sprintf("%s/%s", testutil.TempDir(), test.name)
if err := os.MkdirAll(dir, 0777); err != nil {
t.Fatal(err)
}
if test.caCert != "" {
caCertPath := fmt.Sprintf("%s/ca.crt", dir)
if err := ioutil.WriteFile(
caCertPath,
[]byte(test.caCert),
params.BeaconIoConfig().ReadWritePermissions,
); err != nil {
t.Fatalf("Failed to write CA certificate: %v", err)
}
test.opts.RemoteCertificate.CACertPath = caCertPath
}
if test.clientCert != "" {
clientCertPath := fmt.Sprintf("%s/client.crt", dir)
if err := ioutil.WriteFile(
clientCertPath,
[]byte(test.clientCert),
params.BeaconIoConfig().ReadWritePermissions,
); err != nil {
t.Fatalf("Failed to write client certificate: %v", err)
}
test.opts.RemoteCertificate.ClientCertPath = clientCertPath
}
if test.clientKey != "" {
clientKeyPath := fmt.Sprintf("%s/client.key", dir)
if err := ioutil.WriteFile(
clientKeyPath,
[]byte(test.clientKey),
params.BeaconIoConfig().ReadWritePermissions,
); err != nil {
t.Fatalf("Failed to write client key: %v", err)
}
test.opts.RemoteCertificate.ClientKeyPath = clientKeyPath
}
}
_, err := NewKeymanager(context.Background(), 1, test.opts)
if test.err == "" {
if err != nil {
t.Fatalf("Received unexpected error: %v", err.Error())
}
} else {
if err == nil {
t.Fatal("Did not receive an error")
}
if !strings.Contains(err.Error(), test.err) {
t.Fatalf("Did not received expected error: expected %v, received %v", test.err, err.Error())
}
}
})
}
}
func TestRemoteKeymanager_Sign(t *testing.T) {
ctrl := gomock.NewController(t)
m := mock.NewMockRemoteSignerClient(ctrl)
k := &Keymanager{
client: m,
}
// Expect error handling to work.
m.EXPECT().Sign(
gomock.Any(), // ctx
gomock.Any(), // epoch
).Return(nil, errors.New("could not sign"))
_, err := k.Sign(context.Background(), nil)
if err == nil {
t.Fatal("Expected error, received nil")
}
if !strings.Contains(err.Error(), "could not sign") {
t.Errorf("Unexpected error %v", err)
}
// Expected proper error handling for signing response statuses.
m.EXPECT().Sign(
gomock.Any(), // ctx
gomock.Any(), // epoch
).Return(&validatorpb.SignResponse{
Status: validatorpb.SignResponse_FAILED,
}, nil /*err*/)
_, err = k.Sign(context.Background(), nil)
if err == nil {
t.Fatal(err)
}
if err != ErrSigningFailed {
t.Errorf("Expected %v, received %v", ErrSigningFailed, err)
}
m.EXPECT().Sign(
gomock.Any(), // ctx
gomock.Any(), // epoch
).Return(&validatorpb.SignResponse{
Status: validatorpb.SignResponse_DENIED,
}, nil /*err*/)
_, err = k.Sign(context.Background(), nil)
if err == nil {
t.Fatal(err)
}
if err != ErrSigningDenied {
t.Errorf("Expected %v, received %v", ErrSigningDenied, err)
}
// Expected signing success.
randKey := bls.RandKey()
data := []byte("hello-world")
sig := randKey.Sign(data)
m.EXPECT().Sign(
gomock.Any(), // ctx
gomock.Any(), // epoch
).Return(&validatorpb.SignResponse{
Status: validatorpb.SignResponse_SUCCEEDED,
Signature: sig.Marshal(),
}, nil /*err*/)
resp, err := k.Sign(context.Background(), nil)
if err != nil {
t.Fatal(err)
}
if !bytes.Equal(sig.Marshal(), resp.Marshal()) {
t.Errorf("Expected %#x, received %#x", sig.Marshal(), resp.Marshal())
}
}
func TestRemoteKeymanager_FetchValidatingPublicKeys(t *testing.T) {
ctrl := gomock.NewController(t)
m := mock.NewMockRemoteSignerClient(ctrl)
k := &Keymanager{
client: m,
}
// Expect error handling to work.
m.EXPECT().ListValidatingPublicKeys(
gomock.Any(), // ctx
gomock.Any(), // epoch
).Return(nil, errors.New("could not fetch keys"))
_, err := k.FetchValidatingPublicKeys(context.Background())
if err == nil {
t.Fatal("Expected error, received nil")
}
if !strings.Contains(err.Error(), "could not fetch keys") {
t.Errorf("Unexpected error %v", err)
}
// Expect an empty response to return empty keys.
m.EXPECT().ListValidatingPublicKeys(
gomock.Any(), // ctx
gomock.Any(), // epoch
).Return(&validatorpb.ListPublicKeysResponse{
ValidatingPublicKeys: make([][]byte, 0),
}, nil /*err*/)
keys, err := k.FetchValidatingPublicKeys(context.Background())
if err != nil {
t.Fatal(err)
}
if len(keys) != 0 {
t.Errorf("Expected empty response, received %v", keys)
}
numKeys := 10
pubKeys := make([][]byte, numKeys)
for i := 0; i < numKeys; i++ {
key := make([]byte, 48)
copy(key, strconv.Itoa(i))
pubKeys[i] = key
}
m.EXPECT().ListValidatingPublicKeys(
gomock.Any(), // ctx
gomock.Any(), // epoch
).Return(&validatorpb.ListPublicKeysResponse{
ValidatingPublicKeys: pubKeys,
}, nil /*err*/)
keys, err = k.FetchValidatingPublicKeys(context.Background())
if err != nil {
t.Fatal(err)
}
rawKeys := make([][]byte, len(keys))
for i := 0; i < len(rawKeys); i++ {
rawKeys[i] = keys[i][:]
}
if !reflect.DeepEqual(pubKeys, rawKeys) {
t.Errorf("Wanted %v, received %v", pubKeys, rawKeys)
}
}

View File

@@ -38,5 +38,5 @@ func (m *MockKeymanager) Sign(ctx context.Context, req *validatorpb.SignRequest)
if !ok {
return nil, errors.New("no secret key found")
}
return secretKey.Sign(req.Data), nil
return secretKey.Sign(req.SigningRoot), nil
}