invoicesrpc: SubcribeSingleInvoiceRequest fix

This fixes a bug where the RHashStr field on the PaymentHash request for
SubscribeSingleInvoice was being ignored. This replaces the PaymentHash
message for the SubscribeSingleInvoice request with a new message called
SubscribeSingleInvoiceRequest that contains only the RHash field.
This commit is contained in:
Daniel McNally 2019-04-27 17:30:26 +08:00
parent c4415f0400
commit c9afa6469f
No known key found for this signature in database
GPG Key ID: 2D510757156F5E75
3 changed files with 96 additions and 48 deletions

@ -37,7 +37,7 @@ func (m *CancelInvoiceMsg) Reset() { *m = CancelInvoiceMsg{} }
func (m *CancelInvoiceMsg) String() string { return proto.CompactTextString(m) }
func (*CancelInvoiceMsg) ProtoMessage() {}
func (*CancelInvoiceMsg) Descriptor() ([]byte, []int) {
return fileDescriptor_invoices_faecc7e411e82f9d, []int{0}
return fileDescriptor_invoices_b95f8bc86c534ce9, []int{0}
}
func (m *CancelInvoiceMsg) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CancelInvoiceMsg.Unmarshal(m, b)
@ -74,7 +74,7 @@ func (m *CancelInvoiceResp) Reset() { *m = CancelInvoiceResp{} }
func (m *CancelInvoiceResp) String() string { return proto.CompactTextString(m) }
func (*CancelInvoiceResp) ProtoMessage() {}
func (*CancelInvoiceResp) Descriptor() ([]byte, []int) {
return fileDescriptor_invoices_faecc7e411e82f9d, []int{1}
return fileDescriptor_invoices_b95f8bc86c534ce9, []int{1}
}
func (m *CancelInvoiceResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CancelInvoiceResp.Unmarshal(m, b)
@ -131,7 +131,7 @@ func (m *AddHoldInvoiceRequest) Reset() { *m = AddHoldInvoiceRequest{} }
func (m *AddHoldInvoiceRequest) String() string { return proto.CompactTextString(m) }
func (*AddHoldInvoiceRequest) ProtoMessage() {}
func (*AddHoldInvoiceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_invoices_faecc7e411e82f9d, []int{2}
return fileDescriptor_invoices_b95f8bc86c534ce9, []int{2}
}
func (m *AddHoldInvoiceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AddHoldInvoiceRequest.Unmarshal(m, b)
@ -229,7 +229,7 @@ func (m *AddHoldInvoiceResp) Reset() { *m = AddHoldInvoiceResp{} }
func (m *AddHoldInvoiceResp) String() string { return proto.CompactTextString(m) }
func (*AddHoldInvoiceResp) ProtoMessage() {}
func (*AddHoldInvoiceResp) Descriptor() ([]byte, []int) {
return fileDescriptor_invoices_faecc7e411e82f9d, []int{3}
return fileDescriptor_invoices_b95f8bc86c534ce9, []int{3}
}
func (m *AddHoldInvoiceResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AddHoldInvoiceResp.Unmarshal(m, b)
@ -268,7 +268,7 @@ func (m *SettleInvoiceMsg) Reset() { *m = SettleInvoiceMsg{} }
func (m *SettleInvoiceMsg) String() string { return proto.CompactTextString(m) }
func (*SettleInvoiceMsg) ProtoMessage() {}
func (*SettleInvoiceMsg) Descriptor() ([]byte, []int) {
return fileDescriptor_invoices_faecc7e411e82f9d, []int{4}
return fileDescriptor_invoices_b95f8bc86c534ce9, []int{4}
}
func (m *SettleInvoiceMsg) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SettleInvoiceMsg.Unmarshal(m, b)
@ -305,7 +305,7 @@ func (m *SettleInvoiceResp) Reset() { *m = SettleInvoiceResp{} }
func (m *SettleInvoiceResp) String() string { return proto.CompactTextString(m) }
func (*SettleInvoiceResp) ProtoMessage() {}
func (*SettleInvoiceResp) Descriptor() ([]byte, []int) {
return fileDescriptor_invoices_faecc7e411e82f9d, []int{5}
return fileDescriptor_invoices_b95f8bc86c534ce9, []int{5}
}
func (m *SettleInvoiceResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SettleInvoiceResp.Unmarshal(m, b)
@ -325,6 +325,45 @@ func (m *SettleInvoiceResp) XXX_DiscardUnknown() {
var xxx_messageInfo_SettleInvoiceResp proto.InternalMessageInfo
type SubscribeSingleInvoiceRequest struct {
// / Hash corresponding to the (hold) invoice to subscribe to.
RHash []byte `protobuf:"bytes,2,opt,name=r_hash,proto3" json:"r_hash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SubscribeSingleInvoiceRequest) Reset() { *m = SubscribeSingleInvoiceRequest{} }
func (m *SubscribeSingleInvoiceRequest) String() string { return proto.CompactTextString(m) }
func (*SubscribeSingleInvoiceRequest) ProtoMessage() {}
func (*SubscribeSingleInvoiceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_invoices_b95f8bc86c534ce9, []int{6}
}
func (m *SubscribeSingleInvoiceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SubscribeSingleInvoiceRequest.Unmarshal(m, b)
}
func (m *SubscribeSingleInvoiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SubscribeSingleInvoiceRequest.Marshal(b, m, deterministic)
}
func (dst *SubscribeSingleInvoiceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SubscribeSingleInvoiceRequest.Merge(dst, src)
}
func (m *SubscribeSingleInvoiceRequest) XXX_Size() int {
return xxx_messageInfo_SubscribeSingleInvoiceRequest.Size(m)
}
func (m *SubscribeSingleInvoiceRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SubscribeSingleInvoiceRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SubscribeSingleInvoiceRequest proto.InternalMessageInfo
func (m *SubscribeSingleInvoiceRequest) GetRHash() []byte {
if m != nil {
return m.RHash
}
return nil
}
func init() {
proto.RegisterType((*CancelInvoiceMsg)(nil), "invoicesrpc.CancelInvoiceMsg")
proto.RegisterType((*CancelInvoiceResp)(nil), "invoicesrpc.CancelInvoiceResp")
@ -332,6 +371,7 @@ func init() {
proto.RegisterType((*AddHoldInvoiceResp)(nil), "invoicesrpc.AddHoldInvoiceResp")
proto.RegisterType((*SettleInvoiceMsg)(nil), "invoicesrpc.SettleInvoiceMsg")
proto.RegisterType((*SettleInvoiceResp)(nil), "invoicesrpc.SettleInvoiceResp")
proto.RegisterType((*SubscribeSingleInvoiceRequest)(nil), "invoicesrpc.SubscribeSingleInvoiceRequest")
}
// Reference imports to suppress errors if they are not otherwise used.
@ -350,7 +390,7 @@ type InvoicesClient interface {
// SubscribeSingleInvoice returns a uni-directional stream (server -> client)
// to notify the client of state transitions of the specified invoice.
// Initially the current invoice state is always sent out.
SubscribeSingleInvoice(ctx context.Context, in *lnrpc.PaymentHash, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error)
SubscribeSingleInvoice(ctx context.Context, in *SubscribeSingleInvoiceRequest, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error)
// *
// CancelInvoice cancels a currently open invoice. If the invoice is already
// canceled, this call will succeed. If the invoice is already settled, it will
@ -374,7 +414,7 @@ func NewInvoicesClient(cc *grpc.ClientConn) InvoicesClient {
return &invoicesClient{cc}
}
func (c *invoicesClient) SubscribeSingleInvoice(ctx context.Context, in *lnrpc.PaymentHash, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error) {
func (c *invoicesClient) SubscribeSingleInvoice(ctx context.Context, in *SubscribeSingleInvoiceRequest, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error) {
stream, err := c.cc.NewStream(ctx, &_Invoices_serviceDesc.Streams[0], "/invoicesrpc.Invoices/SubscribeSingleInvoice", opts...)
if err != nil {
return nil, err
@ -439,7 +479,7 @@ type InvoicesServer interface {
// SubscribeSingleInvoice returns a uni-directional stream (server -> client)
// to notify the client of state transitions of the specified invoice.
// Initially the current invoice state is always sent out.
SubscribeSingleInvoice(*lnrpc.PaymentHash, Invoices_SubscribeSingleInvoiceServer) error
SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error
// *
// CancelInvoice cancels a currently open invoice. If the invoice is already
// canceled, this call will succeed. If the invoice is already settled, it will
@ -460,7 +500,7 @@ func RegisterInvoicesServer(s *grpc.Server, srv InvoicesServer) {
}
func _Invoices_SubscribeSingleInvoice_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(lnrpc.PaymentHash)
m := new(SubscribeSingleInvoiceRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
@ -562,40 +602,41 @@ var _Invoices_serviceDesc = grpc.ServiceDesc{
}
func init() {
proto.RegisterFile("invoicesrpc/invoices.proto", fileDescriptor_invoices_faecc7e411e82f9d)
proto.RegisterFile("invoicesrpc/invoices.proto", fileDescriptor_invoices_b95f8bc86c534ce9)
}
var fileDescriptor_invoices_faecc7e411e82f9d = []byte{
// 490 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x4f, 0x8f, 0xd3, 0x3c,
0x10, 0xc6, 0x95, 0xb6, 0xdb, 0x6d, 0xa7, 0xbb, 0xfb, 0xf6, 0x35, 0xb0, 0x8a, 0x22, 0xfe, 0x84,
0x88, 0x43, 0xc4, 0x21, 0x81, 0xae, 0xb8, 0xae, 0x04, 0x5c, 0xca, 0x01, 0x84, 0x52, 0x71, 0xe1,
0x52, 0xb9, 0x89, 0x49, 0xac, 0x75, 0x6d, 0x63, 0xbb, 0x85, 0xfd, 0x54, 0x7c, 0x06, 0xbe, 0x19,
0x8a, 0xe3, 0x96, 0x24, 0x0b, 0xdc, 0x66, 0x1e, 0xcf, 0x3c, 0x19, 0xff, 0x3c, 0x81, 0x80, 0xf2,
0xbd, 0xa0, 0x39, 0xd1, 0x4a, 0xe6, 0xe9, 0x21, 0x4e, 0xa4, 0x12, 0x46, 0xa0, 0x59, 0xeb, 0x2c,
0x78, 0x58, 0x0a, 0x51, 0x32, 0x92, 0x62, 0x49, 0x53, 0xcc, 0xb9, 0x30, 0xd8, 0x50, 0xc1, 0x5d,
0x69, 0x30, 0x55, 0x32, 0x6f, 0xc2, 0xe8, 0x15, 0xcc, 0x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Descriptor_invoices_b95f8bc86c534ce9 = []byte{
// 509 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x41, 0x6f, 0xd3, 0x4c,
0x10, 0x95, 0x93, 0x34, 0x4d, 0x26, 0x6d, 0xbf, 0x7c, 0x0b, 0x44, 0x96, 0x45, 0xc1, 0x58, 0x1c,
0xac, 0x1e, 0x6c, 0x48, 0xc5, 0x11, 0x24, 0xe0, 0x12, 0x90, 0xe0, 0xe0, 0x08, 0x0e, 0x5c, 0xa2,
0x8d, 0xbd, 0xd8, 0xab, 0x6e, 0x76, 0x97, 0xdd, 0x75, 0xa0, 0xbf, 0x8a, 0xdf, 0xc3, 0xbf, 0x41,
0x5e, 0x3b, 0x95, 0xed, 0x96, 0xde, 0x66, 0xde, 0xcc, 0x3c, 0x8f, 0xdf, 0x9b, 0x05, 0x8f, 0xf2,
0xbd, 0xa0, 0x29, 0xd1, 0x4a, 0xa6, 0xf1, 0x21, 0x8e, 0xa4, 0x12, 0x46, 0xa0, 0x59, 0xab, 0xe6,
0x3d, 0xce, 0x85, 0xc8, 0x19, 0x89, 0xb1, 0xa4, 0x31, 0xe6, 0x5c, 0x18, 0x6c, 0xa8, 0xe0, 0x4d,
0xab, 0x37, 0x55, 0x32, 0xad, 0xc3, 0xe0, 0x15, 0xcc, 0xdf, 0x63, 0x9e, 0x12, 0xf6, 0xa1, 0x9e,
0xfe, 0xa4, 0x73, 0xf4, 0x0c, 0x4e, 0x24, 0xbe, 0xde, 0x11, 0x6e, 0x36, 0x05, 0xd6, 0x85, 0xeb,
0xf8, 0x4e, 0x78, 0x92, 0xcc, 0x1a, 0x6c, 0x85, 0x75, 0x11, 0x3c, 0x80, 0xff, 0x3b, 0x63, 0x09,
0xd1, 0x32, 0xf8, 0x3d, 0x80, 0x47, 0x6f, 0xb3, 0x6c, 0x25, 0x58, 0x76, 0x03, 0xff, 0x28, 0x89,
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 0x97, 0xdb, 0x4a, 0xc7, 0x2d, 0x59, 0x53, 0x9e,
0xb7, 0xaa, 0xb5, 0x7b, 0x0b, 0x18, 0xab, 0x4d, 0xcb, 0xab, 0x26, 0xfb, 0x38, 0x9a, 0x38, 0xf3,
0xc1, 0xf2, 0xcf, 0x00, 0x26, 0xcd, 0x80, 0x46, 0x5f, 0x61, 0x71, 0x37, 0x17, 0xba, 0x88, 0x5a,
0xf7, 0x19, 0xdd, 0xfb, 0x41, 0xef, 0xac, 0xd1, 0xb3, 0x81, 0x5f, 0x38, 0xe8, 0x33, 0x9c, 0x76,
0xee, 0x0d, 0x9d, 0x77, 0xe8, 0xfa, 0x27, 0xec, 0x3d, 0xf9, 0x77, 0xd9, 0x4a, 0xfc, 0x05, 0xce,
0xba, 0xc2, 0xa3, 0xa0, 0x33, 0x71, 0xe7, 0x19, 0x7b, 0x4f, 0xef, 0xed, 0xd1, 0xb2, 0x5a, 0xb3,
0xa3, 0x6f, 0x6f, 0xcd, 0xbe, 0x57, 0xbd, 0x35, 0x6f, 0x59, 0xf3, 0xee, 0xf2, 0xdb, 0xcb, 0x9c,
0x9a, 0xa2, 0xdc, 0x46, 0xa9, 0xd8, 0xc5, 0x8c, 0xe6, 0x85, 0xe1, 0x94, 0xe7, 0x9c, 0x98, 0x9f,
0x42, 0x5d, 0xc5, 0x8c, 0x67, 0xb1, 0x55, 0x2a, 0x6e, 0xd1, 0x6c, 0xc7, 0xf6, 0x65, 0x5f, 0xfe,
0x0d, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x5f, 0xe2, 0x9a, 0x2d, 0x04, 0x00, 0x00,
}

@ -15,7 +15,7 @@ service Invoices {
to notify the client of state transitions of the specified invoice.
Initially the current invoice state is always sent out.
*/
rpc SubscribeSingleInvoice (lnrpc.PaymentHash) returns (stream lnrpc.Invoice);
rpc SubscribeSingleInvoice (SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice);
/**
CancelInvoice cancels a currently open invoice. If the invoice is already
@ -99,3 +99,10 @@ message SettleInvoiceMsg {
}
message SettleInvoiceResp {}
message SubscribeSingleInvoiceRequest {
reserved 1;
/// Hash corresponding to the (hold) invoice to subscribe to.
bytes r_hash = 2 [json_name = "r_hash"];
}

@ -168,9 +168,9 @@ func (s *Server) RegisterWithRootServer(grpcServer *grpc.Server) error {
return nil
}
// SubscribeInvoices returns a uni-directional stream (server -> client) for
// notifying the client of invoice state changes.
func (s *Server) SubscribeSingleInvoice(req *lnrpc.PaymentHash,
// SubscribeSingleInvoice returns a uni-directional stream (server -> client)
// for notifying the client of state changes for a specified invoice.
func (s *Server) SubscribeSingleInvoice(req *SubscribeSingleInvoiceRequest,
updateStream Invoices_SubscribeSingleInvoiceServer) error {
hash, err := lntypes.MakeHash(req.RHash)