Skip to content

Commit

Permalink
lightningd: remove delexpiredinvoice
Browse files Browse the repository at this point in the history
Changelog-Removed: JSON-RPC: `delexpiredinvoice` (deprecated v22.11, EOL v24.02)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Mar 25, 2024
1 parent 57e5947 commit 7e0e394
Show file tree
Hide file tree
Showing 23 changed files with 364 additions and 733 deletions.
8 changes: 0 additions & 8 deletions cln-grpc/proto/node.proto

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

26 changes: 0 additions & 26 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: 0 additions & 32 deletions cln-grpc/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,38 +506,6 @@ async fn del_datastore(

}

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

}

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

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

48 changes: 0 additions & 48 deletions contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7932,53 +7932,6 @@
"Main web site: <https://github.com/ElementsProject/lightning>"
]
},
"lightning-delexpiredinvoice.json": {
"$schema": "../rpc-schema-draft.json",
"type": "object",
"additionalProperties": false,
"rpc": "delexpiredinvoice",
"title": "Command for removing expired invoices",
"description": [
"The **delexpiredinvoice** RPC command removes all invoices that have expired on or before the given *maxexpirytime*."
],
"request": {
"required": [],
"properties": {
"maxexpirytime": {
"type": "u64",
"description": [
"Invoice expiry time in seconds. If not specified then all expired invoices are deleted."
]
}
}
},
"response": {
"required": [],
"properties": {}
},
"example_json_request": [
{
"id": "example:delexpiredinvoice#1",
"method": "delexpiredinvoice",
"params": {
"maxexpirytime": null
}
}
],
"example_json_response": [
{}
],
"author": [
"ZmnSCPxj <<ZmnSCPxj@protonmail.com>> is mainly responsible."
],
"see_also": [
"lightning-delinvoice(7)",
"lightning-autoclean-status(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
]
},
"lightning-delforward.json": {
"$schema": "../rpc-schema-draft.json",
"type": "object",
Expand Down Expand Up @@ -8396,7 +8349,6 @@
"lightning-listinvoice(7)",
"lightning-waitinvoice(7)",
"lightning-invoice(7)",
"lightning-delexpiredinvoice(7)",
"lightning-autoclean-status(7)"
],
"resources": [
Expand Down
1 change: 0 additions & 1 deletion contrib/msggen/msggen/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def load_jsonrpc_service():
"DatastoreUsage",
"CreateOnion",
"DelDatastore",
"DelExpiredInvoice",
"DelInvoice",
"Invoice",
"ListDatastore",
Expand Down
9 changes: 0 additions & 9 deletions contrib/pyln-client/pyln/client/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,15 +607,6 @@ def deldatastore(self, key, generation=None):
}
return self.call("deldatastore", payload)

def delexpiredinvoice(self, maxexpirytime=None):
"""
Delete all invoices that have expired on or before the given {maxexpirytime}.
"""
payload = {
"maxexpirytime": maxexpirytime
}
return self.call("delexpiredinvoice", payload)

def delinvoice(self, label, status, desconly=None):
"""
Delete unpaid invoice {label} with {status} (or, with {desconly} true, remove its description).
Expand Down
722 changes: 359 additions & 363 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Large diffs are not rendered by default.

33 changes: 0 additions & 33 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ def __init__(self, channel):
request_serializer=node__pb2.DeldatastoreRequest.SerializeToString,
response_deserializer=node__pb2.DeldatastoreResponse.FromString,
)
self.DelExpiredInvoice = channel.unary_unary(
'/cln.Node/DelExpiredInvoice',
request_serializer=node__pb2.DelexpiredinvoiceRequest.SerializeToString,
response_deserializer=node__pb2.DelexpiredinvoiceResponse.FromString,
)
self.DelInvoice = channel.unary_unary(
'/cln.Node/DelInvoice',
request_serializer=node__pb2.DelinvoiceRequest.SerializeToString,
Expand Down Expand Up @@ -429,12 +424,6 @@ def DelDatastore(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def DelExpiredInvoice(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 DelInvoice(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
Expand Down Expand Up @@ -801,11 +790,6 @@ def add_NodeServicer_to_server(servicer, server):
request_deserializer=node__pb2.DeldatastoreRequest.FromString,
response_serializer=node__pb2.DeldatastoreResponse.SerializeToString,
),
'DelExpiredInvoice': grpc.unary_unary_rpc_method_handler(
servicer.DelExpiredInvoice,
request_deserializer=node__pb2.DelexpiredinvoiceRequest.FromString,
response_serializer=node__pb2.DelexpiredinvoiceResponse.SerializeToString,
),
'DelInvoice': grpc.unary_unary_rpc_method_handler(
servicer.DelInvoice,
request_deserializer=node__pb2.DelinvoiceRequest.FromString,
Expand Down Expand Up @@ -1311,23 +1295,6 @@ def DelDatastore(request,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

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

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


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


def delinvoice2py(m):
return remove_default({
"label": m.label, # PrimitiveField in generate_composite
Expand Down
3 changes: 1 addition & 2 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ GENERATE_MARKDOWN := doc/lightning-addgossip.7 \
doc/lightning-decode.7 \
doc/lightning-decodepay.7 \
doc/lightning-deldatastore.7 \
doc/lightning-delexpiredinvoice.7 \
doc/lightning-delforward.7 \
doc/lightning-delinvoice.7 \
doc/lightning-delpay.7 \
Expand Down Expand Up @@ -112,7 +111,7 @@ GENERATE_MARKDOWN := doc/lightning-addgossip.7 \
doc/lightning-splice_init.7 \
doc/lightning-splice_signed.7 \
doc/lightning-splice_update.7 \
doc/lightning-staticbackup.7 \
doc/lightning-staticbackup.7 \
doc/lightning-stop.7 \
doc/lightning-txdiscard.7 \
doc/lightning-txprepare.7 \
Expand Down
2 changes: 0 additions & 2 deletions doc/developers-guide/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ hidden: false

| Name | Type | First Deprecated | Last Supported | Description |
|--------------------------------------|--------------------|------------------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| delexpiredinvoice | Command | v22.11 | v24.02 | `autoclean-once` is more powerful |
| autocleaninvoice | Command | v22.11 | v24.02 | `autoclean` is more general, does more than expired invoices |
| autocleaninvoice-cycle | Config | v22.11 | v24.02 | Now always once per hour: you can run `autoclean-once` regularly if you need. |
| autocleaninvoice-expired-by | Config | v22.11 | v24.02 | `autoclean`'s `autoclean-expiredinvoices-age` |
| feerates.delayed_to_us | Field | v23.05 | v24.02 | Not used with anchor outputs. |
Expand Down
1 change: 0 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Core Lightning Documentation
lightning-decode <lightning-decode.7.md>
lightning-decodepay <lightning-decodepay.7.md>
lightning-deldatastore <lightning-deldatastore.7.md>
lightning-delexpiredinvoice <lightning-delexpiredinvoice.7.md>
lightning-delforward <lightning-delforward.7.md>
lightning-delinvoice <lightning-delinvoice.7.md>
lightning-delpay <lightning-delpay.7.md>
Expand Down
Loading

0 comments on commit 7e0e394

Please sign in to comment.