From 9ce02b96fe7ddfb0830029f89bd53bc60186bdfa Mon Sep 17 00:00:00 2001 From: erik Date: Sat, 20 May 2023 13:01:41 +0700 Subject: [PATCH] neutrinorpc: deprecate getblockhash --- lnrpc/neutrinorpc/neutrino.pb.go | 13 +++++++------ lnrpc/neutrinorpc/neutrino.proto | 5 ++++- lnrpc/neutrinorpc/neutrino.swagger.json | 2 +- lnrpc/neutrinorpc/neutrino.yaml | 1 + lnrpc/neutrinorpc/neutrino_grpc.pb.go | 7 +++++++ 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lnrpc/neutrinorpc/neutrino.pb.go b/lnrpc/neutrinorpc/neutrino.pb.go index 50ad8f30c..42019619a 100644 --- a/lnrpc/neutrinorpc/neutrino.pb.go +++ b/lnrpc/neutrinorpc/neutrino.pb.go @@ -1156,7 +1156,7 @@ var file_neutrinorpc_neutrino_proto_rawDesc = []byte{ 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2a, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x32, 0x82, 0x05, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x32, 0x87, 0x05, 0x0a, 0x0b, 0x4e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x4b, 0x69, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, @@ -1191,16 +1191,17 @@ var file_neutrinorpc_neutrino_proto_rawDesc = []byte{ 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x20, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x2f, 0x6c, 0x6e, 0x64, 0x2f, 0x6c, 0x6e, 0x72, 0x70, 0x63, 0x2f, 0x6e, 0x65, 0x75, 0x74, - 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x65, 0x22, 0x03, 0x88, 0x02, 0x01, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x6c, 0x6e, 0x64, 0x2f, 0x6c, 0x6e, 0x72, 0x70, 0x63, + 0x2f, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x69, 0x6e, 0x6f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/lnrpc/neutrinorpc/neutrino.proto b/lnrpc/neutrinorpc/neutrino.proto index a82bd2276..5a61feaad 100644 --- a/lnrpc/neutrinorpc/neutrino.proto +++ b/lnrpc/neutrinorpc/neutrino.proto @@ -47,9 +47,12 @@ service NeutrinoKit { rpc GetCFilter (GetCFilterRequest) returns (GetCFilterResponse); /* + Deprecated, use chainrpc.GetBlockHash instead. GetBlockHash returns the header hash of a block at a given height. */ - rpc GetBlockHash (GetBlockHashRequest) returns (GetBlockHashResponse); + rpc GetBlockHash (GetBlockHashRequest) returns (GetBlockHashResponse) { + option deprecated = true; + } } message StatusRequest { diff --git a/lnrpc/neutrinorpc/neutrino.swagger.json b/lnrpc/neutrinorpc/neutrino.swagger.json index a8b344601..21a2b7788 100644 --- a/lnrpc/neutrinorpc/neutrino.swagger.json +++ b/lnrpc/neutrinorpc/neutrino.swagger.json @@ -83,7 +83,7 @@ }, "/v2/neutrino/blockhash/{height}": { "get": { - "summary": "GetBlockHash returns the header hash of a block at a given height.", + "summary": "Deprecated, use chainrpc.GetBlockHash instead.\nGetBlockHash returns the header hash of a block at a given height.", "operationId": "NeutrinoKit_GetBlockHash", "responses": { "200": { diff --git a/lnrpc/neutrinorpc/neutrino.yaml b/lnrpc/neutrinorpc/neutrino.yaml index c81ef700e..5cff0b378 100644 --- a/lnrpc/neutrinorpc/neutrino.yaml +++ b/lnrpc/neutrinorpc/neutrino.yaml @@ -19,5 +19,6 @@ http: get: "/v2/neutrino/blockheader/{hash}" - selector: neutrinorpc.NeutrinoKit.GetCFilter get: "/v2/neutrino/cfilter/{hash}" + # deprecated - selector: neutrinorpc.NeutrinoKit.GetBlockHash get: "/v2/neutrino/blockhash/{height}" diff --git a/lnrpc/neutrinorpc/neutrino_grpc.pb.go b/lnrpc/neutrinorpc/neutrino_grpc.pb.go index 4ede00e52..cb9a2c5e9 100644 --- a/lnrpc/neutrinorpc/neutrino_grpc.pb.go +++ b/lnrpc/neutrinorpc/neutrino_grpc.pb.go @@ -36,6 +36,9 @@ type NeutrinoKitClient interface { GetBlock(ctx context.Context, in *GetBlockRequest, opts ...grpc.CallOption) (*GetBlockResponse, error) // GetCFilter returns a compact filter from a block. GetCFilter(ctx context.Context, in *GetCFilterRequest, opts ...grpc.CallOption) (*GetCFilterResponse, error) + // Deprecated: Do not use. + // + // Deprecated, use chainrpc.GetBlockHash instead. // GetBlockHash returns the header hash of a block at a given height. GetBlockHash(ctx context.Context, in *GetBlockHashRequest, opts ...grpc.CallOption) (*GetBlockHashResponse, error) } @@ -111,6 +114,7 @@ func (c *neutrinoKitClient) GetCFilter(ctx context.Context, in *GetCFilterReques return out, nil } +// Deprecated: Do not use. func (c *neutrinoKitClient) GetBlockHash(ctx context.Context, in *GetBlockHashRequest, opts ...grpc.CallOption) (*GetBlockHashResponse, error) { out := new(GetBlockHashResponse) err := c.cc.Invoke(ctx, "/neutrinorpc.NeutrinoKit/GetBlockHash", in, out, opts...) @@ -142,6 +146,9 @@ type NeutrinoKitServer interface { GetBlock(context.Context, *GetBlockRequest) (*GetBlockResponse, error) // GetCFilter returns a compact filter from a block. GetCFilter(context.Context, *GetCFilterRequest) (*GetCFilterResponse, error) + // Deprecated: Do not use. + // + // Deprecated, use chainrpc.GetBlockHash instead. // GetBlockHash returns the header hash of a block at a given height. GetBlockHash(context.Context, *GetBlockHashRequest) (*GetBlockHashResponse, error) mustEmbedUnimplementedNeutrinoKitServer()