lnrpc: update grpc-gateway library to v2
This commit is contained in:
70 files changed
+8799
-8287
No files matched your search
+1
-316
@@ -1,17 +1,12 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.23.0
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.6.1
|
||||
// source: signrpc/signer.proto
|
||||
|
||||
package signrpc
|
||||
|
||||
import (
|
||||
context "context"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -25,10 +20,6 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type KeyLocator struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -1255,309 +1246,3 @@ func file_signrpc_signer_proto_init() {
|
||||
file_signrpc_signer_proto_goTypes = nil
|
||||
file_signrpc_signer_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConnInterface
|
||||
|
||||
// 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.SupportPackageIsVersion6
|
||||
|
||||
// SignerClient is the client API for Signer service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type SignerClient interface {
|
||||
//
|
||||
//SignOutputRaw is a method that can be used to generated a signature for a
|
||||
//set of inputs/outputs to a transaction. Each request specifies details
|
||||
//concerning how the outputs should be signed, which keys they should be
|
||||
//signed with, and also any optional tweaks. The return value is a fixed
|
||||
//64-byte signature (the same format as we use on the wire in Lightning).
|
||||
//
|
||||
//If we are unable to sign using the specified keys, then an error will be
|
||||
//returned.
|
||||
SignOutputRaw(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*SignResp, error)
|
||||
//
|
||||
//ComputeInputScript generates a complete InputIndex for the passed
|
||||
//transaction with the signature as defined within the passed SignDescriptor.
|
||||
//This method should be capable of generating the proper input script for
|
||||
//both regular p2wkh output and p2wkh outputs nested within a regular p2sh
|
||||
//output.
|
||||
//
|
||||
//Note that when using this method to sign inputs belonging to the wallet,
|
||||
//the only items of the SignDescriptor that need to be populated are pkScript
|
||||
//in the TxOut field, the value in that same field, and finally the input
|
||||
//index.
|
||||
ComputeInputScript(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*InputScriptResp, error)
|
||||
//
|
||||
//SignMessage signs a message with the key specified in the key locator. The
|
||||
//returned signature is fixed-size LN wire format encoded.
|
||||
//
|
||||
//The main difference to SignMessage in the main RPC is that a specific key is
|
||||
//used to sign the message instead of the node identity private key.
|
||||
SignMessage(ctx context.Context, in *SignMessageReq, opts ...grpc.CallOption) (*SignMessageResp, error)
|
||||
//
|
||||
//VerifyMessage verifies a signature over a message using the public key
|
||||
//provided. The signature must be fixed-size LN wire format encoded.
|
||||
//
|
||||
//The main difference to VerifyMessage in the main RPC is that the public key
|
||||
//used to sign the message does not have to be a node known to the network.
|
||||
VerifyMessage(ctx context.Context, in *VerifyMessageReq, opts ...grpc.CallOption) (*VerifyMessageResp, error)
|
||||
//
|
||||
//DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key
|
||||
//derivation between the ephemeral public key in the request and the node's
|
||||
//key specified in the key_desc parameter. Either a key locator or a raw
|
||||
//public key is expected in the key_desc, if neither is supplied, defaults to
|
||||
//the node's identity private key:
|
||||
//P_shared = privKeyNode * ephemeralPubkey
|
||||
//The resulting shared public key is serialized in the compressed format and
|
||||
//hashed with sha256, resulting in the final key length of 256bit.
|
||||
DeriveSharedKey(ctx context.Context, in *SharedKeyRequest, opts ...grpc.CallOption) (*SharedKeyResponse, error)
|
||||
}
|
||||
|
||||
type signerClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSignerClient(cc grpc.ClientConnInterface) SignerClient {
|
||||
return &signerClient{cc}
|
||||
}
|
||||
|
||||
func (c *signerClient) SignOutputRaw(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*SignResp, error) {
|
||||
out := new(SignResp)
|
||||
err := c.cc.Invoke(ctx, "/signrpc.Signer/SignOutputRaw", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *signerClient) ComputeInputScript(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*InputScriptResp, error) {
|
||||
out := new(InputScriptResp)
|
||||
err := c.cc.Invoke(ctx, "/signrpc.Signer/ComputeInputScript", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *signerClient) SignMessage(ctx context.Context, in *SignMessageReq, opts ...grpc.CallOption) (*SignMessageResp, error) {
|
||||
out := new(SignMessageResp)
|
||||
err := c.cc.Invoke(ctx, "/signrpc.Signer/SignMessage", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *signerClient) VerifyMessage(ctx context.Context, in *VerifyMessageReq, opts ...grpc.CallOption) (*VerifyMessageResp, error) {
|
||||
out := new(VerifyMessageResp)
|
||||
err := c.cc.Invoke(ctx, "/signrpc.Signer/VerifyMessage", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *signerClient) DeriveSharedKey(ctx context.Context, in *SharedKeyRequest, opts ...grpc.CallOption) (*SharedKeyResponse, error) {
|
||||
out := new(SharedKeyResponse)
|
||||
err := c.cc.Invoke(ctx, "/signrpc.Signer/DeriveSharedKey", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SignerServer is the server API for Signer service.
|
||||
type SignerServer interface {
|
||||
//
|
||||
//SignOutputRaw is a method that can be used to generated a signature for a
|
||||
//set of inputs/outputs to a transaction. Each request specifies details
|
||||
//concerning how the outputs should be signed, which keys they should be
|
||||
//signed with, and also any optional tweaks. The return value is a fixed
|
||||
//64-byte signature (the same format as we use on the wire in Lightning).
|
||||
//
|
||||
//If we are unable to sign using the specified keys, then an error will be
|
||||
//returned.
|
||||
SignOutputRaw(context.Context, *SignReq) (*SignResp, error)
|
||||
//
|
||||
//ComputeInputScript generates a complete InputIndex for the passed
|
||||
//transaction with the signature as defined within the passed SignDescriptor.
|
||||
//This method should be capable of generating the proper input script for
|
||||
//both regular p2wkh output and p2wkh outputs nested within a regular p2sh
|
||||
//output.
|
||||
//
|
||||
//Note that when using this method to sign inputs belonging to the wallet,
|
||||
//the only items of the SignDescriptor that need to be populated are pkScript
|
||||
//in the TxOut field, the value in that same field, and finally the input
|
||||
//index.
|
||||
ComputeInputScript(context.Context, *SignReq) (*InputScriptResp, error)
|
||||
//
|
||||
//SignMessage signs a message with the key specified in the key locator. The
|
||||
//returned signature is fixed-size LN wire format encoded.
|
||||
//
|
||||
//The main difference to SignMessage in the main RPC is that a specific key is
|
||||
//used to sign the message instead of the node identity private key.
|
||||
SignMessage(context.Context, *SignMessageReq) (*SignMessageResp, error)
|
||||
//
|
||||
//VerifyMessage verifies a signature over a message using the public key
|
||||
//provided. The signature must be fixed-size LN wire format encoded.
|
||||
//
|
||||
//The main difference to VerifyMessage in the main RPC is that the public key
|
||||
//used to sign the message does not have to be a node known to the network.
|
||||
VerifyMessage(context.Context, *VerifyMessageReq) (*VerifyMessageResp, error)
|
||||
//
|
||||
//DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key
|
||||
//derivation between the ephemeral public key in the request and the node's
|
||||
//key specified in the key_desc parameter. Either a key locator or a raw
|
||||
//public key is expected in the key_desc, if neither is supplied, defaults to
|
||||
//the node's identity private key:
|
||||
//P_shared = privKeyNode * ephemeralPubkey
|
||||
//The resulting shared public key is serialized in the compressed format and
|
||||
//hashed with sha256, resulting in the final key length of 256bit.
|
||||
DeriveSharedKey(context.Context, *SharedKeyRequest) (*SharedKeyResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedSignerServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedSignerServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedSignerServer) SignOutputRaw(context.Context, *SignReq) (*SignResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SignOutputRaw not implemented")
|
||||
}
|
||||
func (*UnimplementedSignerServer) ComputeInputScript(context.Context, *SignReq) (*InputScriptResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ComputeInputScript not implemented")
|
||||
}
|
||||
func (*UnimplementedSignerServer) SignMessage(context.Context, *SignMessageReq) (*SignMessageResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SignMessage not implemented")
|
||||
}
|
||||
func (*UnimplementedSignerServer) VerifyMessage(context.Context, *VerifyMessageReq) (*VerifyMessageResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method VerifyMessage not implemented")
|
||||
}
|
||||
func (*UnimplementedSignerServer) DeriveSharedKey(context.Context, *SharedKeyRequest) (*SharedKeyResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeriveSharedKey not implemented")
|
||||
}
|
||||
|
||||
func RegisterSignerServer(s *grpc.Server, srv SignerServer) {
|
||||
s.RegisterService(&_Signer_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Signer_SignOutputRaw_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SignReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SignerServer).SignOutputRaw(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/signrpc.Signer/SignOutputRaw",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SignerServer).SignOutputRaw(ctx, req.(*SignReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Signer_ComputeInputScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SignReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SignerServer).ComputeInputScript(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/signrpc.Signer/ComputeInputScript",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SignerServer).ComputeInputScript(ctx, req.(*SignReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Signer_SignMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SignMessageReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SignerServer).SignMessage(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/signrpc.Signer/SignMessage",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SignerServer).SignMessage(ctx, req.(*SignMessageReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Signer_VerifyMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(VerifyMessageReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SignerServer).VerifyMessage(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/signrpc.Signer/VerifyMessage",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SignerServer).VerifyMessage(ctx, req.(*VerifyMessageReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Signer_DeriveSharedKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SharedKeyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SignerServer).DeriveSharedKey(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/signrpc.Signer/DeriveSharedKey",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SignerServer).DeriveSharedKey(ctx, req.(*SharedKeyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Signer_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "signrpc.Signer",
|
||||
HandlerType: (*SignerServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "SignOutputRaw",
|
||||
Handler: _Signer_SignOutputRaw_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ComputeInputScript",
|
||||
Handler: _Signer_ComputeInputScript_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SignMessage",
|
||||
Handler: _Signer_SignMessage_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "VerifyMessage",
|
||||
Handler: _Signer_VerifyMessage_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeriveSharedKey",
|
||||
Handler: _Signer_DeriveSharedKey_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "signrpc/signer.proto",
|
||||
}
|
||||
Reference in new issue
Block a user