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

msggen: Expose extratlvs of keysend #5674

Merged
merged 4 commits into from
Nov 1, 2022

Conversation

cdecker
Copy link
Member

@cdecker cdecker commented Oct 25, 2022

It's a bit special in the sense that it is a composite whose keys are numbers and not enumerated (they're custom types).

@cdecker cdecker added this to the v22.11 milestone Oct 25, 2022
The JSON specification technically disallows maps with numeric keys,
so we'll want to slowly migrate away from using them. This helper
extracts the numeric value from a quoted number, which is a legal
representation of the same in JSON.
This is because JSON technically does not allow numeric keys in maps.

Changelog-Added: JSON-RPC: The `extratlvs` argument for `keysend` now allows quoting the type numbers in string
These were only in the test targets, but still.
Changelog-Added: cln-rpc: `keysend` now exposes the `extratlvs` field
@cdecker cdecker marked this pull request as ready for review October 27, 2022 14:44
@cdecker cdecker merged commit 1a1c0a3 into ElementsProject:master Nov 1, 2022
@dennisreimann
Copy link
Contributor

I'm trying to pass in the extratlv with a payload like the following, but get an "invalid payload" result:

{
  "id": 0,
  "jsonrpc": "2.0",
  "method": "keysend",
  "params": [
    "02ef9c3b0c78257428a3eb0087bb88d64708aba5f0528a330df53efa70d43fbc42",
    21000,
    null,
    null,
    null,
    null,
    null,
    {
      "696969": "313233343536",
      "112111100": "77616c5f6872444873305242454d353736",
      "5482373484": "4055d3893ec48d1a42453a34a7d7b338296edd82219945621bb2580996c9149a"
    }
  ]
}

Without the extratlv data it works, so I know that the destination accepts keysend payments in general.

What am I missing or doing wrong?

@cdecker
Copy link
Member Author

cdecker commented Dec 9, 2022

This seems mostly unrelated to msggen. You can switch to key=value mode on the command line by adding the -k switch, and then you can skip the nulls which are required in positional mode.

@cdecker cdecker deleted the rs-extratlvs branch December 9, 2022 16:43
@dennisreimann
Copy link
Contributor

Got it done, thanks! Turns out 5482373484 shouldn't be part of the payload.

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.

2 participants