Skip to content

Commit

Permalink
msggen: add delpay method
Browse files Browse the repository at this point in the history
  • Loading branch information
daywalker90 committed Apr 17, 2024
1 parent 7f74c51 commit 7e1b82e
Show file tree
Hide file tree
Showing 9 changed files with 628 additions and 296 deletions.
129 changes: 129 additions & 0 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@
"paid": 0,
"unpaid": 2
},
"DelpayPaymentsStatus": {
"complete": 2,
"failed": 1,
"pending": 0
},
"DelpayStatus": {
"complete": 0,
"failed": 1
},
"FeeratesStyle": {
"perkb": 0,
"perkw": 1
Expand Down Expand Up @@ -712,6 +721,34 @@
"DelInvoice.status": 7,
"DelInvoice.updated_index": 13
},
"DelpayPayments": {
"DelPay.payments[].amount_msat": 8,
"DelPay.payments[].amount_sent_msat": 5,
"DelPay.payments[].bolt11": 15,
"DelPay.payments[].bolt12": 16,
"DelPay.payments[].completed_at": 11,
"DelPay.payments[].created_at": 9,
"DelPay.payments[].created_index": 1,
"DelPay.payments[].destination": 7,
"DelPay.payments[].erroronion": 17,
"DelPay.payments[].groupid": 12,
"DelPay.payments[].id": 2,
"DelPay.payments[].label": 14,
"DelPay.payments[].partid": 6,
"DelPay.payments[].payment_hash": 3,
"DelPay.payments[].payment_preimage": 13,
"DelPay.payments[].status": 4,
"DelPay.payments[].updated_index": 10
},
"DelpayRequest": {
"DelPay.groupid": 4,
"DelPay.partid": 3,
"DelPay.payment_hash": 1,
"DelPay.status": 2
},
"DelpayResponse": {
"DelPay.payments[]": 1
},
"DisconnectRequest": {
"Disconnect.force": 2,
"Disconnect.id": 1
Expand Down Expand Up @@ -3024,6 +3061,98 @@
"added": "v23.08",
"deprecated": false
},
"DelPay": {
"added": "pre-v0.10.1",
"deprecated": null
},
"DelPay.groupid": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.partid": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payment_hash": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].amount_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].amount_sent_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].bolt11": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].bolt12": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].completed_at": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].created_at": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].created_index": {
"added": "v23.11",
"deprecated": false
},
"DelPay.payments[].destination": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].erroronion": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].groupid": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].label": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].partid": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].payment_hash": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].payment_preimage": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].status": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelPay.payments[].updated_index": {
"added": "v23.11",
"deprecated": false
},
"DelPay.status": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Disconnect": {
"added": "pre-v0.10.1",
"deprecated": null
Expand Down
43 changes: 43 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.

59 changes: 59 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 @@ -1338,6 +1338,38 @@ async fn decode(

}

async fn del_pay(
&self,
request: tonic::Request<pb::DelpayRequest>,
) -> Result<tonic::Response<pb::DelpayResponse>, tonic::Status> {
let req = request.into_inner();
let req: requests::DelpayRequest = req.into();
debug!("Client asked for del_pay");
trace!("del_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::DelPay(req))
.await
.map_err(|e| Status::new(
Code::Unknown,
format!("Error calling method DelPay: {:?}", e)))?;
match result {
Response::DelPay(r) => {
trace!("del_pay response: {:?}", r);
Ok(tonic::Response::new(r.into()))
},
r => Err(Status::new(
Code::Internal,
format!(
"Unexpected result {:?} to method call DelPay",
r
)
)),
}

}

async fn disconnect(
&self,
request: tonic::Request<pb::DisconnectRequest>,
Expand Down

0 comments on commit 7e1b82e

Please sign in to comment.