lightningd: remove tx and txid fields from close response.
Changelog-Removed: JSON-RPC: `close` `tx` and `txid` field (use `txs` and `txids`), deprecated v24.11. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
2
cln-grpc/proto/node.proto
generated
2
cln-grpc/proto/node.proto
generated
@@ -547,8 +547,6 @@ message CloseResponse {
|
||||
UNOPENED = 2;
|
||||
}
|
||||
CloseType item_type = 1;
|
||||
optional bytes tx = 2;
|
||||
optional bytes txid = 3;
|
||||
repeated bytes txs = 4;
|
||||
repeated bytes txids = 5;
|
||||
}
|
||||
|
||||
6
cln-grpc/src/convert.rs
generated
6
cln-grpc/src/convert.rs
generated
@@ -449,14 +449,10 @@ impl From<responses::CheckmessageResponse> for pb::CheckmessageResponse {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables,deprecated)]
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::CloseResponse> for pb::CloseResponse {
|
||||
fn from(c: responses::CloseResponse) -> Self {
|
||||
Self {
|
||||
#[allow(deprecated)]
|
||||
tx: c.tx.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
|
||||
#[allow(deprecated)]
|
||||
txid: c.txid.map(|v| hex::decode(v).unwrap()), // Rule #2 for type txid?
|
||||
// Field: Close.txids[]
|
||||
txids: c.txids.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
|
||||
// Field: Close.txs[]
|
||||
|
||||
6
cln-rpc/src/model.rs
generated
6
cln-rpc/src/model.rs
generated
@@ -5814,12 +5814,6 @@ pub mod responses {
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct CloseResponse {
|
||||
#[deprecated]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub tx: Option<String>,
|
||||
#[deprecated]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub txid: Option<String>,
|
||||
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
|
||||
pub txids: Option<Vec<String>>,
|
||||
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
|
||||
|
||||
@@ -5908,26 +5908,6 @@
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"tx": {
|
||||
"type": "hex",
|
||||
"deprecated": [
|
||||
"v24.11",
|
||||
"v25.12"
|
||||
],
|
||||
"description": [
|
||||
"The raw bitcoin transaction used to close the channel (if it was open)."
|
||||
]
|
||||
},
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"deprecated": [
|
||||
"v24.11",
|
||||
"v25.12"
|
||||
],
|
||||
"description": [
|
||||
"The transaction id of the *tx* field."
|
||||
]
|
||||
},
|
||||
"txs": {
|
||||
"added": "v24.11",
|
||||
"type": "array",
|
||||
|
||||
2164
contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py
generated
2164
contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py
generated
File diff suppressed because one or more lines are too long
@@ -335,8 +335,6 @@ def close2py(m):
|
||||
"txids": [hexlify(m.txids) for i in hexlify(m.txids)], # ArrayField[primitive] in generate_composite
|
||||
"txs": [hexlify(m.txs) for i in hexlify(m.txs)], # ArrayField[primitive] in generate_composite
|
||||
"type": str(m.item_type), # EnumField in generate_composite
|
||||
"tx": hexlify(m.tx), # PrimitiveField in generate_composite
|
||||
"txid": hexlify(m.txid), # PrimitiveField in generate_composite
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ privacy:
|
||||
|
||||
| Name | Type | First Deprecated | Last Supported | Description |
|
||||
|----------------------------------------------------|--------------------|------------------|----------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||
| close.tx | Field | v24.11 | v25.12 | Use txs array instead |
|
||||
| close.txid | Field | v24.11 | v25.12 | Use txids array instead |
|
||||
| xpay.ignore_bolt12_mpp | Field | v25.05 | v25.12 | Try MPP even if the BOLT12 invoice doesn't explicitly allow it (CLN didn't until 25.02) |
|
||||
| listpeerchannels.max_total_htlc_in_msat | Field | v25.02 | v26.03 | Use our_max_total_htlc_out_msat |
|
||||
| wait.details | Field | v25.05 | v26.06 | Use subsystem-specific object instead |
|
||||
|
||||
@@ -111,26 +111,6 @@
|
||||
],
|
||||
"properties": {
|
||||
"type": {},
|
||||
"tx": {
|
||||
"type": "hex",
|
||||
"deprecated": [
|
||||
"v24.11",
|
||||
"v25.12"
|
||||
],
|
||||
"description": [
|
||||
"The raw bitcoin transaction used to close the channel (if it was open)."
|
||||
]
|
||||
},
|
||||
"txid": {
|
||||
"type": "txid",
|
||||
"deprecated": [
|
||||
"v24.11",
|
||||
"v25.12"
|
||||
],
|
||||
"description": [
|
||||
"The transaction id of the *tx* field."
|
||||
]
|
||||
},
|
||||
"txs": {
|
||||
"added": "v24.11",
|
||||
"type": "array",
|
||||
|
||||
@@ -39,22 +39,6 @@ resolve_one_close_command(struct close_command *cc, bool cooperative,
|
||||
const struct bitcoin_tx **close_txs)
|
||||
{
|
||||
struct json_stream *result = json_stream_success(cc->cmd);
|
||||
const struct bitcoin_tx *close_tx;
|
||||
|
||||
/* Withheld funding channels can have no close_txs! */
|
||||
if (tal_count(close_txs) != 0)
|
||||
close_tx = close_txs[tal_count(close_txs) - 1];
|
||||
else
|
||||
close_tx = NULL;
|
||||
|
||||
if (close_tx && command_deprecated_out_ok(cc->cmd, "tx", "v24.11", "v25.12"))
|
||||
json_add_tx(result, "tx", close_tx);
|
||||
if (close_tx && !invalid_last_tx(close_tx)) {
|
||||
struct bitcoin_txid txid;
|
||||
bitcoin_txid(close_tx, &txid);
|
||||
if (command_deprecated_out_ok(cc->cmd, "txid", "v24.11", "v25.12"))
|
||||
json_add_txid(result, "txid", &txid);
|
||||
}
|
||||
|
||||
json_array_start(result, "txs");
|
||||
for (int i = 0; i < tal_count(close_txs); i++)
|
||||
|
||||
Reference in New Issue
Block a user