Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

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
tests/test_pay.py Outdated Show resolved Hide resolved
@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 <vincenzopalazzodev@gmail.com>
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