• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 13481890706

23 Feb 2025 09:53AM UTC coverage: 46.221% (-12.6%) from 58.825%
13481890706

Pull #9521

github

web-flow
Merge 9fb980a6f into 5fe900d18
Pull Request #9521: unit: remove GOACC, use Go 1.20 native coverage functionality

105094 of 227374 relevant lines covered (46.22%)

19705.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lnrpc/invoicesrpc/invoices_grpc.pb.go
1
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2

3
package invoicesrpc
4

5
import (
6
        context "context"
7
        lnrpc "github.com/lightningnetwork/lnd/lnrpc"
8
        grpc "google.golang.org/grpc"
9
        codes "google.golang.org/grpc/codes"
10
        status "google.golang.org/grpc/status"
11
)
12

13
// This is a compile-time assertion to ensure that this generated file
14
// is compatible with the grpc package it is being compiled against.
15
// Requires gRPC-Go v1.32.0 or later.
16
const _ = grpc.SupportPackageIsVersion7
17

18
// InvoicesClient is the client API for Invoices service.
19
//
20
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
21
type InvoicesClient interface {
22
        // SubscribeSingleInvoice returns a uni-directional stream (server -> client)
23
        // to notify the client of state transitions of the specified invoice.
24
        // Initially the current invoice state is always sent out.
25
        SubscribeSingleInvoice(ctx context.Context, in *SubscribeSingleInvoiceRequest, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error)
26
        // lncli: `cancelinvoice`
27
        // CancelInvoice cancels a currently open invoice. If the invoice is already
28
        // canceled, this call will succeed. If the invoice is already settled, it will
29
        // fail.
30
        CancelInvoice(ctx context.Context, in *CancelInvoiceMsg, opts ...grpc.CallOption) (*CancelInvoiceResp, error)
31
        // lncli: `addholdinvoice`
32
        // AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
33
        // supplied in the request.
34
        AddHoldInvoice(ctx context.Context, in *AddHoldInvoiceRequest, opts ...grpc.CallOption) (*AddHoldInvoiceResp, error)
35
        // lncli: `settleinvoice`
36
        // SettleInvoice settles an accepted invoice. If the invoice is already
37
        // settled, this call will succeed.
38
        SettleInvoice(ctx context.Context, in *SettleInvoiceMsg, opts ...grpc.CallOption) (*SettleInvoiceResp, error)
39
        // LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced
40
        // using either its payment hash, payment address, or set ID.
41
        LookupInvoiceV2(ctx context.Context, in *LookupInvoiceMsg, opts ...grpc.CallOption) (*lnrpc.Invoice, error)
42
        // HtlcModifier is a bidirectional streaming RPC that allows a client to
43
        // intercept and modify the HTLCs that attempt to settle the given invoice. The
44
        // server will send HTLCs of invoices to the client and the client can modify
45
        // some aspects of the HTLC in order to pass the invoice acceptance tests.
46
        HtlcModifier(ctx context.Context, opts ...grpc.CallOption) (Invoices_HtlcModifierClient, error)
47
}
48

49
type invoicesClient struct {
50
        cc grpc.ClientConnInterface
51
}
52

53
func NewInvoicesClient(cc grpc.ClientConnInterface) InvoicesClient {
×
54
        return &invoicesClient{cc}
×
55
}
×
56

57
func (c *invoicesClient) SubscribeSingleInvoice(ctx context.Context, in *SubscribeSingleInvoiceRequest, opts ...grpc.CallOption) (Invoices_SubscribeSingleInvoiceClient, error) {
×
58
        stream, err := c.cc.NewStream(ctx, &Invoices_ServiceDesc.Streams[0], "/invoicesrpc.Invoices/SubscribeSingleInvoice", opts...)
×
59
        if err != nil {
×
60
                return nil, err
×
61
        }
×
62
        x := &invoicesSubscribeSingleInvoiceClient{stream}
×
63
        if err := x.ClientStream.SendMsg(in); err != nil {
×
64
                return nil, err
×
65
        }
×
66
        if err := x.ClientStream.CloseSend(); err != nil {
×
67
                return nil, err
×
68
        }
×
69
        return x, nil
×
70
}
71

72
type Invoices_SubscribeSingleInvoiceClient interface {
73
        Recv() (*lnrpc.Invoice, error)
74
        grpc.ClientStream
75
}
76

77
type invoicesSubscribeSingleInvoiceClient struct {
78
        grpc.ClientStream
79
}
80

81
func (x *invoicesSubscribeSingleInvoiceClient) Recv() (*lnrpc.Invoice, error) {
×
82
        m := new(lnrpc.Invoice)
×
83
        if err := x.ClientStream.RecvMsg(m); err != nil {
×
84
                return nil, err
×
85
        }
×
86
        return m, nil
×
87
}
88

89
func (c *invoicesClient) CancelInvoice(ctx context.Context, in *CancelInvoiceMsg, opts ...grpc.CallOption) (*CancelInvoiceResp, error) {
×
90
        out := new(CancelInvoiceResp)
×
91
        err := c.cc.Invoke(ctx, "/invoicesrpc.Invoices/CancelInvoice", in, out, opts...)
×
92
        if err != nil {
×
93
                return nil, err
×
94
        }
×
95
        return out, nil
×
96
}
97

98
func (c *invoicesClient) AddHoldInvoice(ctx context.Context, in *AddHoldInvoiceRequest, opts ...grpc.CallOption) (*AddHoldInvoiceResp, error) {
×
99
        out := new(AddHoldInvoiceResp)
×
100
        err := c.cc.Invoke(ctx, "/invoicesrpc.Invoices/AddHoldInvoice", in, out, opts...)
×
101
        if err != nil {
×
102
                return nil, err
×
103
        }
×
104
        return out, nil
×
105
}
106

107
func (c *invoicesClient) SettleInvoice(ctx context.Context, in *SettleInvoiceMsg, opts ...grpc.CallOption) (*SettleInvoiceResp, error) {
×
108
        out := new(SettleInvoiceResp)
×
109
        err := c.cc.Invoke(ctx, "/invoicesrpc.Invoices/SettleInvoice", in, out, opts...)
×
110
        if err != nil {
×
111
                return nil, err
×
112
        }
×
113
        return out, nil
×
114
}
115

116
func (c *invoicesClient) LookupInvoiceV2(ctx context.Context, in *LookupInvoiceMsg, opts ...grpc.CallOption) (*lnrpc.Invoice, error) {
×
117
        out := new(lnrpc.Invoice)
×
118
        err := c.cc.Invoke(ctx, "/invoicesrpc.Invoices/LookupInvoiceV2", in, out, opts...)
×
119
        if err != nil {
×
120
                return nil, err
×
121
        }
×
122
        return out, nil
×
123
}
124

125
func (c *invoicesClient) HtlcModifier(ctx context.Context, opts ...grpc.CallOption) (Invoices_HtlcModifierClient, error) {
×
126
        stream, err := c.cc.NewStream(ctx, &Invoices_ServiceDesc.Streams[1], "/invoicesrpc.Invoices/HtlcModifier", opts...)
×
127
        if err != nil {
×
128
                return nil, err
×
129
        }
×
130
        x := &invoicesHtlcModifierClient{stream}
×
131
        return x, nil
×
132
}
133

134
type Invoices_HtlcModifierClient interface {
135
        Send(*HtlcModifyResponse) error
136
        Recv() (*HtlcModifyRequest, error)
137
        grpc.ClientStream
138
}
139

140
type invoicesHtlcModifierClient struct {
141
        grpc.ClientStream
142
}
143

144
func (x *invoicesHtlcModifierClient) Send(m *HtlcModifyResponse) error {
×
145
        return x.ClientStream.SendMsg(m)
×
146
}
×
147

148
func (x *invoicesHtlcModifierClient) Recv() (*HtlcModifyRequest, error) {
×
149
        m := new(HtlcModifyRequest)
×
150
        if err := x.ClientStream.RecvMsg(m); err != nil {
×
151
                return nil, err
×
152
        }
×
153
        return m, nil
×
154
}
155

156
// InvoicesServer is the server API for Invoices service.
157
// All implementations must embed UnimplementedInvoicesServer
158
// for forward compatibility
159
type InvoicesServer interface {
160
        // SubscribeSingleInvoice returns a uni-directional stream (server -> client)
161
        // to notify the client of state transitions of the specified invoice.
162
        // Initially the current invoice state is always sent out.
163
        SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error
164
        // lncli: `cancelinvoice`
165
        // CancelInvoice cancels a currently open invoice. If the invoice is already
166
        // canceled, this call will succeed. If the invoice is already settled, it will
167
        // fail.
168
        CancelInvoice(context.Context, *CancelInvoiceMsg) (*CancelInvoiceResp, error)
169
        // lncli: `addholdinvoice`
170
        // AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
171
        // supplied in the request.
172
        AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error)
173
        // lncli: `settleinvoice`
174
        // SettleInvoice settles an accepted invoice. If the invoice is already
175
        // settled, this call will succeed.
176
        SettleInvoice(context.Context, *SettleInvoiceMsg) (*SettleInvoiceResp, error)
177
        // LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced
178
        // using either its payment hash, payment address, or set ID.
179
        LookupInvoiceV2(context.Context, *LookupInvoiceMsg) (*lnrpc.Invoice, error)
180
        // HtlcModifier is a bidirectional streaming RPC that allows a client to
181
        // intercept and modify the HTLCs that attempt to settle the given invoice. The
182
        // server will send HTLCs of invoices to the client and the client can modify
183
        // some aspects of the HTLC in order to pass the invoice acceptance tests.
184
        HtlcModifier(Invoices_HtlcModifierServer) error
185
        mustEmbedUnimplementedInvoicesServer()
186
}
187

188
// UnimplementedInvoicesServer must be embedded to have forward compatible implementations.
189
type UnimplementedInvoicesServer struct {
190
}
191

192
func (UnimplementedInvoicesServer) SubscribeSingleInvoice(*SubscribeSingleInvoiceRequest, Invoices_SubscribeSingleInvoiceServer) error {
×
193
        return status.Errorf(codes.Unimplemented, "method SubscribeSingleInvoice not implemented")
×
194
}
×
195
func (UnimplementedInvoicesServer) CancelInvoice(context.Context, *CancelInvoiceMsg) (*CancelInvoiceResp, error) {
×
196
        return nil, status.Errorf(codes.Unimplemented, "method CancelInvoice not implemented")
×
197
}
×
198
func (UnimplementedInvoicesServer) AddHoldInvoice(context.Context, *AddHoldInvoiceRequest) (*AddHoldInvoiceResp, error) {
×
199
        return nil, status.Errorf(codes.Unimplemented, "method AddHoldInvoice not implemented")
×
200
}
×
201
func (UnimplementedInvoicesServer) SettleInvoice(context.Context, *SettleInvoiceMsg) (*SettleInvoiceResp, error) {
×
202
        return nil, status.Errorf(codes.Unimplemented, "method SettleInvoice not implemented")
×
203
}
×
204
func (UnimplementedInvoicesServer) LookupInvoiceV2(context.Context, *LookupInvoiceMsg) (*lnrpc.Invoice, error) {
×
205
        return nil, status.Errorf(codes.Unimplemented, "method LookupInvoiceV2 not implemented")
×
206
}
×
207
func (UnimplementedInvoicesServer) HtlcModifier(Invoices_HtlcModifierServer) error {
×
208
        return status.Errorf(codes.Unimplemented, "method HtlcModifier not implemented")
×
209
}
×
210
func (UnimplementedInvoicesServer) mustEmbedUnimplementedInvoicesServer() {}
×
211

212
// UnsafeInvoicesServer may be embedded to opt out of forward compatibility for this service.
213
// Use of this interface is not recommended, as added methods to InvoicesServer will
214
// result in compilation errors.
215
type UnsafeInvoicesServer interface {
216
        mustEmbedUnimplementedInvoicesServer()
217
}
218

219
func RegisterInvoicesServer(s grpc.ServiceRegistrar, srv InvoicesServer) {
×
220
        s.RegisterService(&Invoices_ServiceDesc, srv)
×
221
}
×
222

223
func _Invoices_SubscribeSingleInvoice_Handler(srv interface{}, stream grpc.ServerStream) error {
×
224
        m := new(SubscribeSingleInvoiceRequest)
×
225
        if err := stream.RecvMsg(m); err != nil {
×
226
                return err
×
227
        }
×
228
        return srv.(InvoicesServer).SubscribeSingleInvoice(m, &invoicesSubscribeSingleInvoiceServer{stream})
×
229
}
230

231
type Invoices_SubscribeSingleInvoiceServer interface {
232
        Send(*lnrpc.Invoice) error
233
        grpc.ServerStream
234
}
235

236
type invoicesSubscribeSingleInvoiceServer struct {
237
        grpc.ServerStream
238
}
239

240
func (x *invoicesSubscribeSingleInvoiceServer) Send(m *lnrpc.Invoice) error {
×
241
        return x.ServerStream.SendMsg(m)
×
242
}
×
243

244
func _Invoices_CancelInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
×
245
        in := new(CancelInvoiceMsg)
×
246
        if err := dec(in); err != nil {
×
247
                return nil, err
×
248
        }
×
249
        if interceptor == nil {
×
250
                return srv.(InvoicesServer).CancelInvoice(ctx, in)
×
251
        }
×
252
        info := &grpc.UnaryServerInfo{
×
253
                Server:     srv,
×
254
                FullMethod: "/invoicesrpc.Invoices/CancelInvoice",
×
255
        }
×
256
        handler := func(ctx context.Context, req interface{}) (interface{}, error) {
×
257
                return srv.(InvoicesServer).CancelInvoice(ctx, req.(*CancelInvoiceMsg))
×
258
        }
×
259
        return interceptor(ctx, in, info, handler)
×
260
}
261

262
func _Invoices_AddHoldInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
×
263
        in := new(AddHoldInvoiceRequest)
×
264
        if err := dec(in); err != nil {
×
265
                return nil, err
×
266
        }
×
267
        if interceptor == nil {
×
268
                return srv.(InvoicesServer).AddHoldInvoice(ctx, in)
×
269
        }
×
270
        info := &grpc.UnaryServerInfo{
×
271
                Server:     srv,
×
272
                FullMethod: "/invoicesrpc.Invoices/AddHoldInvoice",
×
273
        }
×
274
        handler := func(ctx context.Context, req interface{}) (interface{}, error) {
×
275
                return srv.(InvoicesServer).AddHoldInvoice(ctx, req.(*AddHoldInvoiceRequest))
×
276
        }
×
277
        return interceptor(ctx, in, info, handler)
×
278
}
279

280
func _Invoices_SettleInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
×
281
        in := new(SettleInvoiceMsg)
×
282
        if err := dec(in); err != nil {
×
283
                return nil, err
×
284
        }
×
285
        if interceptor == nil {
×
286
                return srv.(InvoicesServer).SettleInvoice(ctx, in)
×
287
        }
×
288
        info := &grpc.UnaryServerInfo{
×
289
                Server:     srv,
×
290
                FullMethod: "/invoicesrpc.Invoices/SettleInvoice",
×
291
        }
×
292
        handler := func(ctx context.Context, req interface{}) (interface{}, error) {
×
293
                return srv.(InvoicesServer).SettleInvoice(ctx, req.(*SettleInvoiceMsg))
×
294
        }
×
295
        return interceptor(ctx, in, info, handler)
×
296
}
297

298
func _Invoices_LookupInvoiceV2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
×
299
        in := new(LookupInvoiceMsg)
×
300
        if err := dec(in); err != nil {
×
301
                return nil, err
×
302
        }
×
303
        if interceptor == nil {
×
304
                return srv.(InvoicesServer).LookupInvoiceV2(ctx, in)
×
305
        }
×
306
        info := &grpc.UnaryServerInfo{
×
307
                Server:     srv,
×
308
                FullMethod: "/invoicesrpc.Invoices/LookupInvoiceV2",
×
309
        }
×
310
        handler := func(ctx context.Context, req interface{}) (interface{}, error) {
×
311
                return srv.(InvoicesServer).LookupInvoiceV2(ctx, req.(*LookupInvoiceMsg))
×
312
        }
×
313
        return interceptor(ctx, in, info, handler)
×
314
}
315

316
func _Invoices_HtlcModifier_Handler(srv interface{}, stream grpc.ServerStream) error {
×
317
        return srv.(InvoicesServer).HtlcModifier(&invoicesHtlcModifierServer{stream})
×
318
}
×
319

320
type Invoices_HtlcModifierServer interface {
321
        Send(*HtlcModifyRequest) error
322
        Recv() (*HtlcModifyResponse, error)
323
        grpc.ServerStream
324
}
325

326
type invoicesHtlcModifierServer struct {
327
        grpc.ServerStream
328
}
329

330
func (x *invoicesHtlcModifierServer) Send(m *HtlcModifyRequest) error {
×
331
        return x.ServerStream.SendMsg(m)
×
332
}
×
333

334
func (x *invoicesHtlcModifierServer) Recv() (*HtlcModifyResponse, error) {
×
335
        m := new(HtlcModifyResponse)
×
336
        if err := x.ServerStream.RecvMsg(m); err != nil {
×
337
                return nil, err
×
338
        }
×
339
        return m, nil
×
340
}
341

342
// Invoices_ServiceDesc is the grpc.ServiceDesc for Invoices service.
343
// It's only intended for direct use with grpc.RegisterService,
344
// and not to be introspected or modified (even as a copy)
345
var Invoices_ServiceDesc = grpc.ServiceDesc{
346
        ServiceName: "invoicesrpc.Invoices",
347
        HandlerType: (*InvoicesServer)(nil),
348
        Methods: []grpc.MethodDesc{
349
                {
350
                        MethodName: "CancelInvoice",
351
                        Handler:    _Invoices_CancelInvoice_Handler,
352
                },
353
                {
354
                        MethodName: "AddHoldInvoice",
355
                        Handler:    _Invoices_AddHoldInvoice_Handler,
356
                },
357
                {
358
                        MethodName: "SettleInvoice",
359
                        Handler:    _Invoices_SettleInvoice_Handler,
360
                },
361
                {
362
                        MethodName: "LookupInvoiceV2",
363
                        Handler:    _Invoices_LookupInvoiceV2_Handler,
364
                },
365
        },
366
        Streams: []grpc.StreamDesc{
367
                {
368
                        StreamName:    "SubscribeSingleInvoice",
369
                        Handler:       _Invoices_SubscribeSingleInvoice_Handler,
370
                        ServerStreams: true,
371
                },
372
                {
373
                        StreamName:    "HtlcModifier",
374
                        Handler:       _Invoices_HtlcModifier_Handler,
375
                        ServerStreams: true,
376
                        ClientStreams: true,
377
                },
378
        },
379
        Metadata: "invoicesrpc/invoices.proto",
380
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc