Skip to content

plugin: fetchinvoice: assign the quantity to the invrequest field#6090

Merged
vincenzopalazzo merged 1 commit intoElementsProject:masterfrom
vincenzopalazzo:macros/fetch_invoice
Mar 20, 2023
Merged

plugin: fetchinvoice: assign the quantity to the invrequest field#6090
vincenzopalazzo merged 1 commit intoElementsProject:masterfrom
vincenzopalazzo:macros/fetch_invoice

Conversation

@vincenzopalazzo
Copy link
Collaborator

assign the quantity field to receive as RPC parameter inside the invrequest field.

Fixes #6089

@vincenzopalazzo vincenzopalazzo force-pushed the macros/fetch_invoice branch 2 times, most recently from 628df5e to 2218bcb Compare March 13, 2023 11:58
@vincenzopalazzo vincenzopalazzo added this to the v23.05 milestone Mar 13, 2023
@vincenzopalazzo vincenzopalazzo force-pushed the macros/fetch_invoice branch 2 times, most recently from f82f973 to 52a59a9 Compare March 14, 2023 08:16
@rustyrussell
Copy link
Contributor

rustyrussell commented Mar 19, 2023

Needs: "Changelog-EXPERIMENTAL: fetchinvoice quantity specification now works."

Note: we should never rely on references to GH issues being persistent. One day GH will fail us, but we may be bisecting a problem or trying to understand some code, and we'll need the complete record in the git history!

Also, it's best to include the error message (if any) in the commit message: this helps people search for the problem!

@vincenzopalazzo
Copy link
Collaborator Author

All done @rustyrussell thanks!

I think we had all the information to have a description of the problem inside the commit body, thanks to suggest it!

While the user trying to fetch an invoice by specifing the quantity we do
not work as expected.

Running the command

```
lightning-cli fetchinvoice -k offer='lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqffqszsk2p6hycmgv9ek2grpyphxjcm9ypmkjer8v46pyzmhd9jxwet5wvhxxmmdzsqs593pq0ylsvakdua5h976f4g3eautgjt3udvtyga47eaw7339sjrhpwpwz' quantity=2
```

and we answer back with

```json
{
   "code": -32602,
   "message": "quantity parameter required"
}
```

This is caused because we forget to bind the `quanity` field from the
RPC into the `invrequest`.

Reported-by: @aaronbarnardsound
Link: ElementsProject#6089
Signed-off-by: Vincenzo Palazzo <[email protected]>
Changelog-EXPERIMENTAL: fetchinvoice: fix: do not ignore the `quantity` field
into the invreq field.
@rustyrussell
Copy link
Contributor

Ack acf71ae

@vincenzopalazzo vincenzopalazzo merged commit fca6211 into ElementsProject:master Mar 20, 2023
@vincenzopalazzo vincenzopalazzo deleted the macros/fetch_invoice branch March 20, 2023 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetchinvoicedoes not recognise quantity param

2 participants