Skip to content

Commit

Permalink
msggen: add delforward method
Browse files Browse the repository at this point in the history
Changelog-None
  • Loading branch information
daywalker90 authored and cdecker committed Apr 24, 2024
1 parent 1a2a9b0 commit 7317bb1
Show file tree
Hide file tree
Showing 9 changed files with 431 additions and 207 deletions.
26 changes: 26 additions & 0 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
"P2WPKH": 2,
"P2WSH": 3
},
"DelforwardStatus": {
"failed": 2,
"local_failed": 1,
"settled": 0
},
"DelinvoiceStatus": {
"expired": 1,
"paid": 0,
Expand Down Expand Up @@ -785,6 +790,11 @@
"DelexpiredinvoiceRequest": {
"DelExpiredInvoice.maxexpirytime": 1
},
"DelforwardRequest": {
"DelForward.in_channel": 1,
"DelForward.in_htlc_id": 2,
"DelForward.status": 3
},
"DelinvoiceRequest": {
"DelInvoice.desconly": 3,
"DelInvoice.label": 1,
Expand Down Expand Up @@ -3478,6 +3488,22 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"DelForward": {
"added": "pre-v0.10.1",
"deprecated": null
},
"DelForward.in_channel": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelForward.in_htlc_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelForward.status": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelInvoice": {
"added": "pre-v0.10.1",
"deprecated": null
Expand Down
16 changes: 16 additions & 0 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions cln-grpc/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,38 @@ async fn del_pay(

}

async fn del_forward(
&self,
request: tonic::Request<pb::DelforwardRequest>,
) -> Result<tonic::Response<pb::DelforwardResponse>, tonic::Status> {
let req = request.into_inner();
let req: requests::DelforwardRequest = req.into();
debug!("Client asked for del_forward");
trace!("del_forward request: {:?}", req);
let mut rpc = ClnRpc::new(&self.rpc_path)
.await
.map_err(|e| Status::new(Code::Internal, e.to_string()))?;
let result = rpc.call(Request::DelForward(req))
.await
.map_err(|e| Status::new(
Code::Unknown,
format!("Error calling method DelForward: {:?}", e)))?;
match result {
Response::DelForward(r) => {
trace!("del_forward response: {:?}", r);
Ok(tonic::Response::new(r.into()))
},
r => Err(Status::new(
Code::Internal,
format!(
"Unexpected result {:?} to method call DelForward",
r
)
)),
}

}

async fn disconnect(
&self,
request: tonic::Request<pb::DisconnectRequest>,
Expand Down
75 changes: 75 additions & 0 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions contrib/msggen/msggen/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def load_jsonrpc_service():
"DecodePay",
"Decode",
"DelPay",
"DelForward",
# "disableoffer",
"Disconnect",
"Feerates",
Expand Down
420 changes: 213 additions & 207 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ def __init__(self, channel):
request_serializer=node__pb2.DelpayRequest.SerializeToString,
response_deserializer=node__pb2.DelpayResponse.FromString,
)
self.DelForward = channel.unary_unary(
'/cln.Node/DelForward',
request_serializer=node__pb2.DelforwardRequest.SerializeToString,
response_deserializer=node__pb2.DelforwardResponse.FromString,
)
self.Disconnect = channel.unary_unary(
'/cln.Node/Disconnect',
request_serializer=node__pb2.DisconnectRequest.SerializeToString,
Expand Down Expand Up @@ -658,6 +663,12 @@ def DelPay(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def DelForward(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 Disconnect(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
Expand Down Expand Up @@ -1067,6 +1078,11 @@ def add_NodeServicer_to_server(servicer, server):
request_deserializer=node__pb2.DelpayRequest.FromString,
response_serializer=node__pb2.DelpayResponse.SerializeToString,
),
'DelForward': grpc.unary_unary_rpc_method_handler(
servicer.DelForward,
request_deserializer=node__pb2.DelforwardRequest.FromString,
response_serializer=node__pb2.DelforwardResponse.SerializeToString,
),
'Disconnect': grpc.unary_unary_rpc_method_handler(
servicer.Disconnect,
request_deserializer=node__pb2.DisconnectRequest.FromString,
Expand Down Expand Up @@ -1980,6 +1996,23 @@ def DelPay(request,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def DelForward(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/DelForward',
node__pb2.DelforwardRequest.SerializeToString,
node__pb2.DelforwardResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def Disconnect(request,
target,
Expand Down
5 changes: 5 additions & 0 deletions contrib/pyln-testing/pyln/testing/grpc2py.py
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,11 @@ def delpay2py(m):
})


def delforward2py(m):
return remove_default({
})


def disconnect2py(m):
return remove_default({
})
Expand Down

0 comments on commit 7317bb1

Please sign in to comment.