Skip to content

Commit

Permalink
chore: update gRPC files
Browse files Browse the repository at this point in the history
Latest gRPC library version introduced breaking changes
  • Loading branch information
fusion44 committed Nov 29, 2022
1 parent 5edb60a commit 7d65b7c
Show file tree
Hide file tree
Showing 8 changed files with 1,399 additions and 30,654 deletions.
28 changes: 28 additions & 0 deletions app/lightning/impl/protos/lnd/gen_protos_python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# clone lnd repo
# cd into lnd/lnrpc
# git clone https://github.com/googleapis/googleapis.git

set -e

# path to LND lnrpc directory
LND_RPC_DIR="."

function generate() {
echo "Generating root gRPC protos"

PROTOS=$(find ${LND_RPC_DIR} -not -path '*googleapis*' -name "*.proto")

for file in $PROTOS; do
DIRECTORY=$(dirname "${file}")

echo "Generating protos from ${file}, into ${DIRECTORY}"

# Generate the protos.
python -m grpc_tools.protoc --proto_path=googleapis:. --python_out=. --grpc_python_out=. "${file}"
done
}

# Compile the lnrpc package.
generate
25,004 changes: 636 additions & 24,368 deletions app/lightning/impl/protos/lnd/lightning_pb2.py

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions app/lightning/impl/protos/lnd/lightning_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ def __init__(self, channel):
request_serializer=lightning__pb2.SubscribeCustomMessagesRequest.SerializeToString,
response_deserializer=lightning__pb2.CustomMessage.FromString,
)
self.ListAliases = channel.unary_unary(
"/lnrpc.Lightning/ListAliases",
request_serializer=lightning__pb2.ListAliasesRequest.SerializeToString,
response_deserializer=lightning__pb2.ListAliasesResponse.FromString,
)


class LightningServicer(object):
Expand Down Expand Up @@ -1097,6 +1102,16 @@ def SubscribeCustomMessages(self, request, context):
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def ListAliases(self, request, context):
"""lncli: `listaliases`
ListAliases returns the set of all aliases that have ever existed with
their confirmed SCID (if it exists) and/or the base SCID (in the case of
zero conf).
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")


def add_LightningServicer_to_server(servicer, server):
rpc_method_handlers = {
Expand Down Expand Up @@ -1425,6 +1440,11 @@ def add_LightningServicer_to_server(servicer, server):
request_deserializer=lightning__pb2.SubscribeCustomMessagesRequest.FromString,
response_serializer=lightning__pb2.CustomMessage.SerializeToString,
),
"ListAliases": grpc.unary_unary_rpc_method_handler(
servicer.ListAliases,
request_deserializer=lightning__pb2.ListAliasesRequest.FromString,
response_serializer=lightning__pb2.ListAliasesResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
"lnrpc.Lightning", rpc_method_handlers
Expand Down Expand Up @@ -3338,3 +3358,32 @@ def SubscribeCustomMessages(
timeout,
metadata,
)

@staticmethod
def ListAliases(
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,
"/lnrpc.Lightning/ListAliases",
lightning__pb2.ListAliasesRequest.SerializeToString,
lightning__pb2.ListAliasesResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)
4,147 changes: 120 additions & 4,027 deletions app/lightning/impl/protos/lnd/router_pb2.py

Large diffs are not rendered by default.

188 changes: 94 additions & 94 deletions app/lightning/impl/protos/lnd/router_pb2_grpc.py

Large diffs are not rendered by default.

Loading

0 comments on commit 7d65b7c

Please sign in to comment.