lightningd: listsendpays always has groupid.

Schema was too loose since we did deprecations.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-09-19 10:24:26 +09:30 committed by Christian Decker
parent fa7d732ba6
commit 05095313f5
6 changed files with 173 additions and 172 deletions

View file

@ -708,7 +708,7 @@ message ListsendpaysPayments {
COMPLETE = 2;
}
uint64 id = 1;
optional uint64 groupid = 2;
uint64 groupid = 2;
bytes payment_hash = 3;
ListsendpaysPaymentsStatus status = 4;
optional Amount amount_msat = 5;

View file

@ -504,7 +504,7 @@ impl From<&responses::ListsendpaysPayments> for pb::ListsendpaysPayments {
fn from(c: &responses::ListsendpaysPayments) -> Self {
Self {
id: c.id.clone(), // Rule #2 for type u64
groupid: c.groupid.clone(), // Rule #2 for type u64?
groupid: c.groupid.clone(), // Rule #2 for type u64
payment_hash: c.payment_hash.clone().to_vec(), // Rule #2 for type hash
status: c.status as i32,
amount_msat: c.amount_msat.map(|f| f.into()), // Rule #2 for type msat?

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

@ -1910,8 +1910,8 @@ pub mod responses {
pub struct ListsendpaysPayments {
#[serde(alias = "id")]
pub id: u64,
#[serde(alias = "groupid", skip_serializing_if = "Option::is_none")]
pub groupid: Option<u64>,
#[serde(alias = "groupid")]
pub groupid: u64,
#[serde(alias = "payment_hash")]
pub payment_hash: Sha256,
// Path `ListSendPays.payments[].status`

File diff suppressed because one or more lines are too long

View file

@ -26,11 +26,11 @@ Note that the returned array is ordered by increasing *id*.
On success, an object containing **payments** is returned. It is an array of objects, where each object contains:
- **id** (u64): unique ID for this payment attempt
- **groupid** (u64): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash
- **payment\_hash** (hash): the hash of the *payment_preimage* which will prove payment (always 64 characters)
- **status** (string): status of the payment (one of "pending", "failed", "complete")
- **created\_at** (u64): the UNIX timestamp showing when this payment was initiated
- **amount\_sent\_msat** (msat): The amount sent
- **groupid** (u64, optional): Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash
- **amount\_msat** (msat, optional): The amount delivered to destination (if known)
- **destination** (pubkey, optional): the final destination of the payment if known
- **label** (string, optional): the label, if given to sendpay
@ -64,4 +64,4 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:68af9f1edf2ddc78a7daad1bb72aa773b82c5103b0ba706ef83de36a11cabe26)
[comment]: # ( SHA256STAMP:eddbf227775b367fbea5d90dfc1d06bc87b9301e4b862b0d755592432ef58f89)

View file

@ -15,6 +15,7 @@
"id",
"payment_hash",
"status",
"groupid",
"created_at",
"amount_sent_msat"
],