diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-11-22 14:56:29 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2017-01-10 12:04:54 +0100 |
| commit | 481f289765fab47ff2e0bd7dfb968f2bd92fd608 (patch) | |
| tree | d7ad238c4842bc4fa6c9a05ae8aef395029d1835 /src/rpc/client.h | |
| parent | rpc: Argument name consistency (diff) | |
| download | discoin-481f289765fab47ff2e0bd7dfb968f2bd92fd608.tar.xz discoin-481f289765fab47ff2e0bd7dfb968f2bd92fd608.zip | |
rpc: Named argument support for bitcoin-cli
Usage e.g.:
$ src/bitcoin-cli -testnet -named echo arg0="dfdf"
[
"dfdf"
]
Argument conversion also works, for arguments thus flagged in the table in
`src/rpc/client.cpp`.
$ src/bitcoin-cli -testnet -named echojson arg0="[1,2,3]"
[
[
1,
2,
3
]
]
Unknown parameter (detected server-side):
$ src/bitcoin-cli -testnet -named getinfo arg0="dfdf"
error code: -8
error message:
Unknown named parameter arg0
Diffstat (limited to 'src/rpc/client.h')
| -rw-r--r-- | src/rpc/client.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rpc/client.h b/src/rpc/client.h index cb7c12b12..e7cf035d8 100644 --- a/src/rpc/client.h +++ b/src/rpc/client.h @@ -8,7 +8,12 @@ #include <univalue.h> +/** Convert positional arguments to command-specific RPC representation */ UniValue RPCConvertValues(const std::string& strMethod, const std::vector<std::string>& strParams); + +/** Convert named arguments to command-specific RPC representation */ +UniValue RPCConvertNamedValues(const std::string& strMethod, const std::vector<std::string>& strParams); + /** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null) * as well as objects and arrays. */ |