mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
msggen: add renepay method
Changelog-None
This commit is contained in:
parent
5c0f25f916
commit
9538ecccad
89
.msggen.json
89
.msggen.json
@ -403,6 +403,11 @@
|
||||
"startdir": 3,
|
||||
"stop": 1
|
||||
},
|
||||
"RenepayStatus": {
|
||||
"complete": 0,
|
||||
"failed": 2,
|
||||
"pending": 1
|
||||
},
|
||||
"SendonionStatus": {
|
||||
"complete": 1,
|
||||
"pending": 0
|
||||
@ -2132,6 +2137,26 @@
|
||||
"PreApproveKeysend.destination": 1,
|
||||
"PreApproveKeysend.payment_hash": 2
|
||||
},
|
||||
"RenepayRequest": {
|
||||
"RenePay.amount_msat": 2,
|
||||
"RenePay.description": 6,
|
||||
"RenePay.dev_use_shadow": 8,
|
||||
"RenePay.invstring": 1,
|
||||
"RenePay.label": 7,
|
||||
"RenePay.maxdelay": 4,
|
||||
"RenePay.maxfee": 3,
|
||||
"RenePay.retry_for": 5
|
||||
},
|
||||
"RenepayResponse": {
|
||||
"RenePay.amount_msat": 5,
|
||||
"RenePay.amount_sent_msat": 6,
|
||||
"RenePay.created_at": 3,
|
||||
"RenePay.destination": 8,
|
||||
"RenePay.parts": 4,
|
||||
"RenePay.payment_hash": 2,
|
||||
"RenePay.payment_preimage": 1,
|
||||
"RenePay.status": 7
|
||||
},
|
||||
"SendcustommsgRequest": {
|
||||
"SendCustomMsg.msg": 2,
|
||||
"SendCustomMsg.node_id": 1
|
||||
@ -7523,6 +7548,70 @@
|
||||
"added": "v23.02",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": null
|
||||
},
|
||||
"RenePay.amount_msat": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.amount_sent_msat": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.created_at": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.description": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.destination": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.dev_use_shadow": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.invstring": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.label": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.maxdelay": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.maxfee": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.parts": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.payment_hash": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.payment_preimage": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.retry_for": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"RenePay.status": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"SendCustomMsg": {
|
||||
"added": "v0.10.1",
|
||||
"deprecated": null
|
||||
|
BIN
cln-grpc/proto/node.proto
generated
BIN
cln-grpc/proto/node.proto
generated
Binary file not shown.
BIN
cln-grpc/src/convert.rs
generated
BIN
cln-grpc/src/convert.rs
generated
Binary file not shown.
@ -2202,6 +2202,38 @@ async fn plugin(
|
||||
|
||||
}
|
||||
|
||||
async fn rene_pay(
|
||||
&self,
|
||||
request: tonic::Request<pb::RenepayRequest>,
|
||||
) -> Result<tonic::Response<pb::RenepayResponse>, tonic::Status> {
|
||||
let req = request.into_inner();
|
||||
let req: requests::RenepayRequest = req.into();
|
||||
debug!("Client asked for rene_pay");
|
||||
trace!("rene_pay 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::RenePay(req))
|
||||
.await
|
||||
.map_err(|e| Status::new(
|
||||
Code::Unknown,
|
||||
format!("Error calling method RenePay: {:?}", e)))?;
|
||||
match result {
|
||||
Response::RenePay(r) => {
|
||||
trace!("rene_pay response: {:?}", r);
|
||||
Ok(tonic::Response::new(r.into()))
|
||||
},
|
||||
r => Err(Status::new(
|
||||
Code::Internal,
|
||||
format!(
|
||||
"Unexpected result {:?} to method call RenePay",
|
||||
r
|
||||
)
|
||||
)),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async fn send_custom_msg(
|
||||
&self,
|
||||
request: tonic::Request<pb::SendcustommsgRequest>,
|
||||
|
BIN
cln-rpc/src/model.rs
generated
BIN
cln-rpc/src/model.rs
generated
Binary file not shown.
@ -129,6 +129,7 @@ def load_jsonrpc_service():
|
||||
# "parsefeerate",
|
||||
"Ping",
|
||||
"Plugin",
|
||||
"RenePay",
|
||||
# "reserveinputs",
|
||||
"SendCustomMsg",
|
||||
# "sendinvoice",
|
||||
|
File diff suppressed because one or more lines are too long
@ -354,6 +354,11 @@ class NodeStub(object):
|
||||
request_serializer=node__pb2.PluginRequest.SerializeToString,
|
||||
response_deserializer=node__pb2.PluginResponse.FromString,
|
||||
)
|
||||
self.RenePay = channel.unary_unary(
|
||||
'/cln.Node/RenePay',
|
||||
request_serializer=node__pb2.RenepayRequest.SerializeToString,
|
||||
response_deserializer=node__pb2.RenepayResponse.FromString,
|
||||
)
|
||||
self.SendCustomMsg = channel.unary_unary(
|
||||
'/cln.Node/SendCustomMsg',
|
||||
request_serializer=node__pb2.SendcustommsgRequest.SerializeToString,
|
||||
@ -847,6 +852,12 @@ class NodeServicer(object):
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def RenePay(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 SendCustomMsg(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
@ -1286,6 +1297,11 @@ def add_NodeServicer_to_server(servicer, server):
|
||||
request_deserializer=node__pb2.PluginRequest.FromString,
|
||||
response_serializer=node__pb2.PluginResponse.SerializeToString,
|
||||
),
|
||||
'RenePay': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.RenePay,
|
||||
request_deserializer=node__pb2.RenepayRequest.FromString,
|
||||
response_serializer=node__pb2.RenepayResponse.SerializeToString,
|
||||
),
|
||||
'SendCustomMsg': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.SendCustomMsg,
|
||||
request_deserializer=node__pb2.SendcustommsgRequest.FromString,
|
||||
@ -2532,6 +2548,23 @@ class Node(object):
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def RenePay(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/RenePay',
|
||||
node__pb2.RenepayRequest.SerializeToString,
|
||||
node__pb2.RenepayResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def SendCustomMsg(request,
|
||||
target,
|
||||
|
@ -1715,6 +1715,19 @@ def plugin2py(m):
|
||||
})
|
||||
|
||||
|
||||
def renepay2py(m):
|
||||
return remove_default({
|
||||
"status": str(m.status), # EnumField in generate_composite
|
||||
"amount_msat": amount2msat(m.amount_msat), # PrimitiveField in generate_composite
|
||||
"amount_sent_msat": amount2msat(m.amount_sent_msat), # PrimitiveField in generate_composite
|
||||
"created_at": m.created_at, # PrimitiveField in generate_composite
|
||||
"destination": hexlify(m.destination), # PrimitiveField in generate_composite
|
||||
"parts": m.parts, # PrimitiveField in generate_composite
|
||||
"payment_hash": hexlify(m.payment_hash), # PrimitiveField in generate_composite
|
||||
"payment_preimage": hexlify(m.payment_preimage), # PrimitiveField in generate_composite
|
||||
})
|
||||
|
||||
|
||||
def sendcustommsg2py(m):
|
||||
return remove_default({
|
||||
"status": m.status, # PrimitiveField in generate_composite
|
||||
|
Loading…
Reference in New Issue
Block a user