Skip to content

Commit

Permalink
rpc: Regenerate derived files after adding bkpr-listincome
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Feb 1, 2024
1 parent 19af808 commit 5924509
Show file tree
Hide file tree
Showing 9 changed files with 313 additions and 3 deletions.
80 changes: 80 additions & 0 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,26 @@
"AutoCleanInvoice.enabled": 1,
"AutoCleanInvoice.expired_by": 2
},
"Bkpr-listincomeIncome_events": {
"Bkpr-ListIncome.income_events[].account": 1,
"Bkpr-ListIncome.income_events[].credit_msat": 3,
"Bkpr-ListIncome.income_events[].currency": 5,
"Bkpr-ListIncome.income_events[].debit_msat": 4,
"Bkpr-ListIncome.income_events[].description": 7,
"Bkpr-ListIncome.income_events[].outpoint": 8,
"Bkpr-ListIncome.income_events[].payment_id": 10,
"Bkpr-ListIncome.income_events[].tag": 2,
"Bkpr-ListIncome.income_events[].timestamp": 6,
"Bkpr-ListIncome.income_events[].txid": 9
},
"Bkpr-listincomeRequest": {
"Bkpr-ListIncome.consolidate_fees": 1,
"Bkpr-ListIncome.end_time": 3,
"Bkpr-ListIncome.start_time": 2
},
"Bkpr-listincomeResponse": {
"Bkpr-ListIncome.income_events[]": 1
},
"CheckmessageRequest": {
"CheckMessage.message": 1,
"CheckMessage.pubkey": 3,
Expand Down Expand Up @@ -1798,6 +1818,66 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome": {
"added": "pre-v0.10.1",
"deprecated": null
},
"Bkpr-ListIncome.consolidate_fees": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.end_time": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.income_events[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.income_events[].account": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.income_events[].credit_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.income_events[].currency": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.income_events[].debit_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.income_events[].description": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.income_events[].outpoint": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.income_events[].payment_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.income_events[].tag": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.income_events[].timestamp": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.income_events[].txid": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Bkpr-ListIncome.start_time": {
"added": "pre-v0.10.1",
"deprecated": false
},
"CheckMessage": {
"added": "pre-v0.10.1",
"deprecated": null
Expand Down
24 changes: 24 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.

50 changes: 50 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 @@ -1978,4 +1978,36 @@ async fn static_backup(

}

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

}

}
63 changes: 63 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 @@ -114,6 +114,7 @@ def load_jsonrpc_service(schema_dir: str):
"PreApproveKeysend",
"PreApproveInvoice",
"StaticBackup",
"Bkpr-ListIncome",
]
methods = [load_jsonrpc_method(name, schema_dir=schema_dir) for name in method_names]
service = Service(name="Node", methods=methods)
Expand Down
12 changes: 9 additions & 3 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 @@ -319,6 +319,11 @@ def __init__(self, channel):
request_serializer=node__pb2.StaticbackupRequest.SerializeToString,
response_deserializer=node__pb2.StaticbackupResponse.FromString,
)
self.BkprListIncome = channel.unary_unary(
'/cln.Node/BkprListIncome',
request_serializer=node__pb2.BkprlistincomeRequest.SerializeToString,
response_deserializer=node__pb2.BkprlistincomeResponse.FromString,
)


class NodeServicer(object):
Expand Down Expand Up @@ -690,6 +695,12 @@ def StaticBackup(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def BkprListIncome(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 = {
Expand Down Expand Up @@ -998,6 +1009,11 @@ def add_NodeServicer_to_server(servicer, server):
request_deserializer=node__pb2.StaticbackupRequest.FromString,
response_serializer=node__pb2.StaticbackupResponse.SerializeToString,
),
'BkprListIncome': grpc.unary_unary_rpc_method_handler(
servicer.BkprListIncome,
request_deserializer=node__pb2.BkprlistincomeRequest.FromString,
response_serializer=node__pb2.BkprlistincomeResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'cln.Node', rpc_method_handlers)
Expand Down Expand Up @@ -2044,3 +2060,20 @@ def StaticBackup(request,
node__pb2.StaticbackupResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

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

0 comments on commit 5924509

Please sign in to comment.