msggen: Add two missing fields to the listpays schema

The fields were missing because they weren't annotated with a type and
a description. Adding those fixes them.

Changelog-Fixed: msggen: `listpays` now includes the missing `amount_msat` and `amount_sent_msat` fields
No-schema-diff-check: fields were always there, just undocumented!
This commit is contained in:
Christian Decker 2023-07-25 17:01:30 +02:00 committed by Rusty Russell
parent 7915a9d678
commit 7b8ea7f60a
8 changed files with 85 additions and 51 deletions

View file

@ -3810,6 +3810,14 @@
"added": "pre-v0.10.1",
"deprecated": null
},
"ListPays.amount_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListPays.amount_sent_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListPays.bolt11": {
"added": "pre-v0.10.1",
"deprecated": false
@ -3822,6 +3830,14 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"ListPays.pays[].amount_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListPays.pays[].amount_sent_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListPays.pays[].bolt11": {
"added": "pre-v0.10.1",
"deprecated": false

View file

@ -1627,6 +1627,8 @@ message ListpaysPays {
optional string bolt11 = 6;
optional string description = 11;
optional string bolt12 = 7;
optional Amount amount_msat = 8;
optional Amount amount_sent_msat = 9;
optional bytes preimage = 13;
optional uint64 number_of_parts = 14;
optional bytes erroronion = 10;

View file

@ -1487,6 +1487,8 @@ impl From<responses::ListpaysPays> for pb::ListpaysPays {
bolt11: c.bolt11, // Rule #2 for type string?
description: c.description, // Rule #2 for type string?
bolt12: c.bolt12, // Rule #2 for type string?
amount_msat: c.amount_msat.map(|f| f.into()), // Rule #2 for type msat?
amount_sent_msat: c.amount_sent_msat.map(|f| f.into()), // Rule #2 for type msat?
preimage: c.preimage.map(|v| v.to_vec()), // Rule #2 for type secret?
number_of_parts: c.number_of_parts, // Rule #2 for type u64?
erroronion: c.erroronion.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?

4
cln-rpc/src/model.rs generated
View file

@ -4662,6 +4662,10 @@ pub mod responses {
#[serde(skip_serializing_if = "Option::is_none")]
pub bolt12: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_msat: Option<Amount>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_sent_msat: Option<Amount>,
#[serde(skip_serializing_if = "Option::is_none")]
pub preimage: Option<Secret>,
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_parts: Option<u64>,

File diff suppressed because one or more lines are too long

View file

@ -1277,6 +1277,8 @@ def listpays_pays2py(m):
"bolt11": m.bolt11, # PrimitiveField in generate_composite
"description": m.description, # PrimitiveField in generate_composite
"bolt12": m.bolt12, # PrimitiveField 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
"preimage": hexlify(m.preimage), # PrimitiveField in generate_composite
"number_of_parts": m.number_of_parts, # PrimitiveField in generate_composite
"erroronion": hexlify(m.erroronion), # PrimitiveField in generate_composite

View file

@ -31,7 +31,9 @@ On success, an object containing **pays** is returned. It is an array of object
If **status** is "complete":
- **amount\_sent\_msat** (msat): The amount of millisatoshi we sent in order to pay (may include fees and not match amount\_msat)
- **preimage** (secret): proof of payment
- **amount\_msat** (msat, optional): The amount of millisatoshi we intended to send to the destination
- **number\_of\_parts** (u64, optional): the number of parts for a successful payment (only if more than one).
If **status** is "failed":
@ -57,4 +59,4 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:716bcbf01d946c6e4da0bd2f6817c34e6471a1fcd2f0f388ce47984271285c72)
[comment]: # ( SHA256STAMP:1485c07b6a62b67169675ecd1e6e42f34fb371c2eb687adf7451ad1bec5dcc50)

View file

@ -87,8 +87,14 @@
"bolt11": {},
"description": {},
"bolt12": {},
"amount_msat": {},
"amount_sent_msat": {},
"amount_msat": {
"type": "msat",
"description": "The amount of millisatoshi we intended to send to the destination"
},
"amount_sent_msat": {
"type": "msat",
"description": "The amount of millisatoshi we sent in order to pay (may include fees and not match amount_msat)"
},
"preimage": {
"type": "secret",
"description": "proof of payment"