neutrinorpc: deprecate getblockhash

This commit is contained in:
erik 2023-05-20 13:01:41 +07:00
parent 51a23b0901
commit 9ce02b96fe
5 changed files with 20 additions and 8 deletions

View File

@ -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 (

View File

@ -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 {

View File

@ -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": {

View File

@ -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}"

View File

@ -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()