multi: rename LookupHtlc to LookupHtlcResolution for clarity
This commit is contained in:
11 files changed
+2952
-2939
No files matched your search
+2868
-2865
File diff suppressed because it is too large.
Load diff
+16
-16
@@ -2460,8 +2460,8 @@ func local_request_Lightning_ListAliases_0(ctx context.Context, marshaler runtim
|
||||
|
||||
}
|
||||
|
||||
func request_Lightning_LookupHtlc_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq LookupHtlcRequest
|
||||
func request_Lightning_LookupHtlcResolution_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq LookupHtlcResolutionRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
@@ -2491,13 +2491,13 @@ func request_Lightning_LookupHtlc_0(ctx context.Context, marshaler runtime.Marsh
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "htlc_index", err)
|
||||
}
|
||||
|
||||
msg, err := client.LookupHtlc(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
msg, err := client.LookupHtlcResolution(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Lightning_LookupHtlc_0(ctx context.Context, marshaler runtime.Marshaler, server LightningServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq LookupHtlcRequest
|
||||
func local_request_Lightning_LookupHtlcResolution_0(ctx context.Context, marshaler runtime.Marshaler, server LightningServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq LookupHtlcResolutionRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
@@ -2527,7 +2527,7 @@ func local_request_Lightning_LookupHtlc_0(ctx context.Context, marshaler runtime
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "htlc_index", err)
|
||||
}
|
||||
|
||||
msg, err := server.LookupHtlc(ctx, &protoReq)
|
||||
msg, err := server.LookupHtlcResolution(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
@@ -3864,18 +3864,18 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux,
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Lightning_LookupHtlc_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("GET", pattern_Lightning_LookupHtlcResolution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/LookupHtlc", runtime.WithHTTPPathPattern("/v1/htlc/{chan_id}/{htlc_index}"))
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/LookupHtlcResolution", runtime.WithHTTPPathPattern("/v1/htlc-resolution/{chan_id}/{htlc_index}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Lightning_LookupHtlc_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
resp, md, err := local_request_Lightning_LookupHtlcResolution_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
@@ -3883,7 +3883,7 @@ func RegisterLightningHandlerServer(ctx context.Context, mux *runtime.ServeMux,
|
||||
return
|
||||
}
|
||||
|
||||
forward_Lightning_LookupHtlc_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_Lightning_LookupHtlcResolution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
@@ -5248,23 +5248,23 @@ func RegisterLightningHandlerClient(ctx context.Context, mux *runtime.ServeMux,
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Lightning_LookupHtlc_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("GET", pattern_Lightning_LookupHtlcResolution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/LookupHtlc", runtime.WithHTTPPathPattern("/v1/htlc/{chan_id}/{htlc_index}"))
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/lnrpc.Lightning/LookupHtlcResolution", runtime.WithHTTPPathPattern("/v1/htlc-resolution/{chan_id}/{htlc_index}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Lightning_LookupHtlc_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_Lightning_LookupHtlcResolution_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Lightning_LookupHtlc_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_Lightning_LookupHtlcResolution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
@@ -5404,7 +5404,7 @@ var (
|
||||
|
||||
pattern_Lightning_ListAliases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "aliases", "list"}, ""))
|
||||
|
||||
pattern_Lightning_LookupHtlc_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "htlc", "chan_id", "htlc_index"}, ""))
|
||||
pattern_Lightning_LookupHtlcResolution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "htlc-resolution", "chan_id", "htlc_index"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -5540,5 +5540,5 @@ var (
|
||||
|
||||
forward_Lightning_ListAliases_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Lightning_LookupHtlc_0 = runtime.ForwardResponseMessage
|
||||
forward_Lightning_LookupHtlcResolution_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
@@ -1724,10 +1724,10 @@ func RegisterLightningJSONCallbacks(registry map[string]func(ctx context.Context
|
||||
callback(string(respBytes), nil)
|
||||
}
|
||||
|
||||
registry["lnrpc.Lightning.LookupHtlc"] = func(ctx context.Context,
|
||||
registry["lnrpc.Lightning.LookupHtlcResolution"] = func(ctx context.Context,
|
||||
conn *grpc.ClientConn, reqJSON string, callback func(string, error)) {
|
||||
|
||||
req := &LookupHtlcRequest{}
|
||||
req := &LookupHtlcResolutionRequest{}
|
||||
err := marshaler.Unmarshal([]byte(reqJSON), req)
|
||||
if err != nil {
|
||||
callback("", err)
|
||||
@@ -1735,7 +1735,7 @@ func RegisterLightningJSONCallbacks(registry map[string]func(ctx context.Context
|
||||
}
|
||||
|
||||
client := NewLightningClient(conn)
|
||||
resp, err := client.LookupHtlc(ctx, req)
|
||||
resp, err := client.LookupHtlcResolution(ctx, req)
|
||||
if err != nil {
|
||||
callback("", err)
|
||||
return
|
||||
|
||||
@@ -583,19 +583,21 @@ service Lightning {
|
||||
rpc ListAliases (ListAliasesRequest) returns (ListAliasesResponse);
|
||||
|
||||
/*
|
||||
LookupHtlc retrieves a final htlc resolution from the database. If the htlc
|
||||
has no final resolution yet, a NotFound grpc status code is returned.
|
||||
LookupHtlcResolution retrieves a final htlc resolution from the database.
|
||||
If the htlc has no final resolution yet, a NotFound grpc status code is
|
||||
returned.
|
||||
*/
|
||||
rpc LookupHtlc (LookupHtlcRequest) returns (LookupHtlcResponse);
|
||||
rpc LookupHtlcResolution (LookupHtlcResolutionRequest)
|
||||
returns (LookupHtlcResolutionResponse);
|
||||
}
|
||||
|
||||
message LookupHtlcRequest {
|
||||
message LookupHtlcResolutionRequest {
|
||||
uint64 chan_id = 1;
|
||||
|
||||
uint64 htlc_index = 2;
|
||||
}
|
||||
|
||||
message LookupHtlcResponse {
|
||||
message LookupHtlcResolutionResponse {
|
||||
// Settled is true is the htlc was settled. If false, the htlc was failed.
|
||||
bool settled = 1;
|
||||
|
||||
|
||||
@@ -1601,15 +1601,15 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/htlc/{chan_id}/{htlc_index}": {
|
||||
"/v1/htlc-resolution/{chan_id}/{htlc_index}": {
|
||||
"get": {
|
||||
"summary": "LookupHtlc retrieves a final htlc resolution from the database. If the htlc\nhas no final resolution yet, a NotFound grpc status code is returned.",
|
||||
"operationId": "Lightning_LookupHtlc",
|
||||
"summary": "LookupHtlcResolution retrieves a final htlc resolution from the database.\nIf the htlc has no final resolution yet, a NotFound grpc status code is\nreturned.",
|
||||
"operationId": "Lightning_LookupHtlcResolution",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/lnrpcLookupHtlcResponse"
|
||||
"$ref": "#/definitions/lnrpcLookupHtlcResolutionResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
@@ -5437,7 +5437,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"lnrpcLookupHtlcResponse": {
|
||||
"lnrpcLookupHtlcResolutionResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"settled": {
|
||||
|
||||
@@ -165,5 +165,5 @@ http:
|
||||
get: "/v1/custommessage/subscribe"
|
||||
- selector: lnrpc.Lightning.ListAliases
|
||||
get: "/v1/aliases/list"
|
||||
- selector: lnrpc.Lightning.LookupHtlc
|
||||
get: "/v1/htlc/{chan_id}/{htlc_index}"
|
||||
- selector: lnrpc.Lightning.LookupHtlcResolution
|
||||
get: "/v1/htlc-resolution/{chan_id}/{htlc_index}"
|
||||
+20
-18
@@ -402,9 +402,10 @@ type LightningClient interface {
|
||||
// their confirmed SCID (if it exists) and/or the base SCID (in the case of
|
||||
// zero conf).
|
||||
ListAliases(ctx context.Context, in *ListAliasesRequest, opts ...grpc.CallOption) (*ListAliasesResponse, error)
|
||||
// LookupHtlc retrieves a final htlc resolution from the database. If the htlc
|
||||
// has no final resolution yet, a NotFound grpc status code is returned.
|
||||
LookupHtlc(ctx context.Context, in *LookupHtlcRequest, opts ...grpc.CallOption) (*LookupHtlcResponse, error)
|
||||
// LookupHtlcResolution retrieves a final htlc resolution from the database.
|
||||
// If the htlc has no final resolution yet, a NotFound grpc status code is
|
||||
// returned.
|
||||
LookupHtlcResolution(ctx context.Context, in *LookupHtlcResolutionRequest, opts ...grpc.CallOption) (*LookupHtlcResolutionResponse, error)
|
||||
}
|
||||
|
||||
type lightningClient struct {
|
||||
@@ -1306,9 +1307,9 @@ func (c *lightningClient) ListAliases(ctx context.Context, in *ListAliasesReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *lightningClient) LookupHtlc(ctx context.Context, in *LookupHtlcRequest, opts ...grpc.CallOption) (*LookupHtlcResponse, error) {
|
||||
out := new(LookupHtlcResponse)
|
||||
err := c.cc.Invoke(ctx, "/lnrpc.Lightning/LookupHtlc", in, out, opts...)
|
||||
func (c *lightningClient) LookupHtlcResolution(ctx context.Context, in *LookupHtlcResolutionRequest, opts ...grpc.CallOption) (*LookupHtlcResolutionResponse, error) {
|
||||
out := new(LookupHtlcResolutionResponse)
|
||||
err := c.cc.Invoke(ctx, "/lnrpc.Lightning/LookupHtlcResolution", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1703,9 +1704,10 @@ type LightningServer interface {
|
||||
// their confirmed SCID (if it exists) and/or the base SCID (in the case of
|
||||
// zero conf).
|
||||
ListAliases(context.Context, *ListAliasesRequest) (*ListAliasesResponse, error)
|
||||
// LookupHtlc retrieves a final htlc resolution from the database. If the htlc
|
||||
// has no final resolution yet, a NotFound grpc status code is returned.
|
||||
LookupHtlc(context.Context, *LookupHtlcRequest) (*LookupHtlcResponse, error)
|
||||
// LookupHtlcResolution retrieves a final htlc resolution from the database.
|
||||
// If the htlc has no final resolution yet, a NotFound grpc status code is
|
||||
// returned.
|
||||
LookupHtlcResolution(context.Context, *LookupHtlcResolutionRequest) (*LookupHtlcResolutionResponse, error)
|
||||
mustEmbedUnimplementedLightningServer()
|
||||
}
|
||||
|
||||
@@ -1911,8 +1913,8 @@ func (UnimplementedLightningServer) SubscribeCustomMessages(*SubscribeCustomMess
|
||||
func (UnimplementedLightningServer) ListAliases(context.Context, *ListAliasesRequest) (*ListAliasesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListAliases not implemented")
|
||||
}
|
||||
func (UnimplementedLightningServer) LookupHtlc(context.Context, *LookupHtlcRequest) (*LookupHtlcResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LookupHtlc not implemented")
|
||||
func (UnimplementedLightningServer) LookupHtlcResolution(context.Context, *LookupHtlcResolutionRequest) (*LookupHtlcResolutionResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LookupHtlcResolution not implemented")
|
||||
}
|
||||
func (UnimplementedLightningServer) mustEmbedUnimplementedLightningServer() {}
|
||||
|
||||
@@ -3174,20 +3176,20 @@ func _Lightning_ListAliases_Handler(srv interface{}, ctx context.Context, dec fu
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Lightning_LookupHtlc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LookupHtlcRequest)
|
||||
func _Lightning_LookupHtlcResolution_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LookupHtlcResolutionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LightningServer).LookupHtlc(ctx, in)
|
||||
return srv.(LightningServer).LookupHtlcResolution(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/lnrpc.Lightning/LookupHtlc",
|
||||
FullMethod: "/lnrpc.Lightning/LookupHtlcResolution",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LightningServer).LookupHtlc(ctx, req.(*LookupHtlcRequest))
|
||||
return srv.(LightningServer).LookupHtlcResolution(ctx, req.(*LookupHtlcResolutionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -3412,8 +3414,8 @@ var Lightning_ServiceDesc = grpc.ServiceDesc{
|
||||
Handler: _Lightning_ListAliases_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LookupHtlc",
|
||||
Handler: _Lightning_LookupHtlc_Handler,
|
||||
MethodName: "LookupHtlcResolution",
|
||||
Handler: _Lightning_LookupHtlcResolution_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
|
||||
Reference in new issue
Block a user