grpc: Allow conversion code to use deprecated fields

The warning was rather superfluous, we should rather annotate the
downstream structs so the developer gets a warning, not us library
maintainers.
This commit is contained in:
Christian Decker 2023-01-13 15:00:15 +01:00 committed by Alex Myers
parent 640edf3955
commit e5d5737927
4 changed files with 35 additions and 0 deletions

BIN
cln-grpc/src/convert.rs generated

Binary file not shown.

View File

@ -327,6 +327,8 @@ class GrpcConverterGenerator(IGenerator):
f'c.{name}' # default to just assignment
)
if f.deprecated:
self.write(f"#[allow(deprecated)]\n", numindent=3)
self.write(f"{name}: {rhs}, // Rule #2 for type {typ}\n", numindent=3)
elif isinstance(f, CompositeField):

Binary file not shown.

View File

@ -239,6 +239,11 @@ class NodeStub(object):
request_serializer=node__pb2.SetchannelRequest.SerializeToString,
response_deserializer=node__pb2.SetchannelResponse.FromString,
)
self.SignInvoice = channel.unary_unary(
'/cln.Node/SignInvoice',
request_serializer=node__pb2.SigninvoiceRequest.SerializeToString,
response_deserializer=node__pb2.SigninvoiceResponse.FromString,
)
self.SignMessage = channel.unary_unary(
'/cln.Node/SignMessage',
request_serializer=node__pb2.SignmessageRequest.SerializeToString,
@ -524,6 +529,12 @@ class NodeServicer(object):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SignInvoice(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SignMessage(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
@ -764,6 +775,11 @@ def add_NodeServicer_to_server(servicer, server):
request_deserializer=node__pb2.SetchannelRequest.FromString,
response_serializer=node__pb2.SetchannelResponse.SerializeToString,
),
'SignInvoice': grpc.unary_unary_rpc_method_handler(
servicer.SignInvoice,
request_deserializer=node__pb2.SigninvoiceRequest.FromString,
response_serializer=node__pb2.SigninvoiceResponse.SerializeToString,
),
'SignMessage': grpc.unary_unary_rpc_method_handler(
servicer.SignMessage,
request_deserializer=node__pb2.SignmessageRequest.FromString,
@ -1549,6 +1565,23 @@ class Node(object):
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def SignInvoice(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/cln.Node/SignInvoice',
node__pb2.SigninvoiceRequest.SerializeToString,
node__pb2.SigninvoiceResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def SignMessage(request,
target,