jl777/komodo

Curl command examples need fixing

Closed this issue · 4 comments

Describe the issue

I am informed by @leto that there is a script that auto-generates all komodo-cli rpc examples and inserts them into source code.

However, the way this script functions, parameters that are in curl commands are generated incorrectly.

For example:

curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_listunspent", "params": [6 9999999 false "["zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37","zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:7771/

Note that the params has the parameters inserted improperly into the array.

Can you reliably reproduce the issue?

If so, please list the steps to reproduce below:

  1. ./komodo-cli help z_listunspent

Expected behaviour

It should insert the parameters into the array with proper formatting.

Actual behaviour + errors

Curl commands don't work.

The version of Komodo you were using:

Latest manual on dev branch

leto commented

@siddhartha-crypto good bug report, I suspect there are various other RPCs that might have this problem. Please add them to this issue if you find anymore. I can fix this.

I got that curl command fixed.

Here we go:

curl --user username:userpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_listunspent", "params": [1, 9999999, false, ["zs1umhaattx6lna933m9zwfqlmkm2qj49hpa9lnymtj5h5c7cwtd3evfpu29hppprax9cs45fzeyqg"] ] }' -H 'content-type: text/plain;' http://127.0.0.1:rpcport/

jl777 commented

not sure the status of this, have pull requests been done to solve it already?

leto commented

@jl777 this is a generated documentation bug we inherited from upstream (which is still present there). I am testing a fix now.

Core issue is that HelpExampleCli and HelpExampleRpc cannot be used in exactly the same way, because CLI quoting is different than RPC quoting.