Skip to content

lighting-cli decode fails to decode rune #9039

@nepet

Description

@nepet

It seems that lightnig-cli decode ignores or strips the == padding chars off an encoded rune and fails to decode it.

Failing example with padding chars:

 lightning-cli --regtest decode "zFMd1fjhrAYxUeFA54TjloZqOt8JrA_i_nYwIgXkag49MA=="
{
   "code": -32602,
   "message": "unknown parameter: zFMd1fjhrAYxUeFA54TjloZqOt8JrA_i_nYwIgXkag49MA, this may be caused by a failure to autodetect key=value-style parameters. Please try using the -k flag and explicit key=value pairs of parameters."
}

Working example, without padding chars:

 lightning-cli --regtest decode "_RWaZZRI7wAYU2hqlFBmYgC_dFczcpAdI_9O87YbDpg9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl"
{
   "type": "rune",
   "unique_id": "0",
   "string": "fd159a659448ef001853686a9450666200bf74573372901d23ff4ef3b61b0e98:=0&method^list|method^get|method=summary&method/listdatastore",
   "restrictions": [
      {
         "alternatives": [
            "method^list",
            "method^get",
            "method=summary"
         ],
         "summary": "method (of command) starts with 'list' OR method (of command) starts with 'get' OR method (of command) equal to 'summary'"
      },
      {
         "alternatives": [
            "method/listdatastore"
         ],
         "summary": "method (of command) unequal to 'listdatastore'"
      }
   ],
   "valid": true
}

Both runes are from the example in the createrune doc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions