msggen: Add stop method to generators

We'll need this when testing the grpc interface in pyln-testing,
otherwise tests just slowly die and wither.
This commit is contained in:
Christian Decker
2022-07-01 13:51:18 +02:00
committed by Rusty Russell
parent 1efa5c37be
commit 18a9eb2feb
9 changed files with 134 additions and 4 deletions

View File

@@ -239,6 +239,11 @@ class NodeStub(object):
request_serializer=node__pb2.SignmessageRequest.SerializeToString,
response_deserializer=node__pb2.SignmessageResponse.FromString,
)
self.Stop = channel.unary_unary(
'/cln.Node/Stop',
request_serializer=node__pb2.StopRequest.SerializeToString,
response_deserializer=node__pb2.StopResponse.FromString,
)
class NodeServicer(object):
@@ -514,6 +519,12 @@ class NodeServicer(object):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Stop(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 add_NodeServicer_to_server(servicer, server):
rpc_method_handlers = {
@@ -742,6 +753,11 @@ def add_NodeServicer_to_server(servicer, server):
request_deserializer=node__pb2.SignmessageRequest.FromString,
response_serializer=node__pb2.SignmessageResponse.SerializeToString,
),
'Stop': grpc.unary_unary_rpc_method_handler(
servicer.Stop,
request_deserializer=node__pb2.StopRequest.FromString,
response_serializer=node__pb2.StopResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'cln.Node', rpc_method_handlers)
@@ -1516,3 +1532,20 @@ class Node(object):
node__pb2.SignmessageResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Stop(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/Stop',
node__pb2.StopRequest.SerializeToString,
node__pb2.StopResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)