From ece884994e9e649d51feefbab5cb8b52eed3d54c Mon Sep 17 00:00:00 2001 From: thephez Date: Mon, 9 Oct 2017 14:24:56 -0400 Subject: [PATCH] RPC help formatting updates (#1670) - Convert satoshis to duffs - Correct order of fields in GetAddressUtxos - Add missing field from GetAddressDeltas (blockindex) - Add HelpExamples to gettxoutproof and verifytxoutproof --- src/rpc/misc.cpp | 15 ++++++++------- src/rpc/rawtransaction.cpp | 9 +++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 49d47d7267ff6..01c04a6df318f 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -600,7 +600,7 @@ UniValue getaddressmempool(const UniValue& params, bool fHelp) " \"address\" (string) The base58check encoded address\n" " \"txid\" (string) The related txid\n" " \"index\" (number) The related input or output index\n" - " \"satoshis\" (number) The difference of satoshis\n" + " \"duffs\" (number) The difference of duffs\n" " \"timestamp\" (number) The time the transaction entered the mempool (seconds)\n" " \"prevtxid\" (string) The previous txid (if spending)\n" " \"prevout\" (string) The previous transaction output index (if spending)\n" @@ -670,10 +670,10 @@ UniValue getaddressutxos(const UniValue& params, bool fHelp) " {\n" " \"address\" (string) The address base58check encoded\n" " \"txid\" (string) The output txid\n" - " \"height\" (number) The block height\n" " \"outputIndex\" (number) The output index\n" - " \"script\" (strin) The script hex encoded\n" - " \"satoshis\" (number) The number of satoshis of the output\n" + " \"script\" (string) The script hex encoded\n" + " \"duffs\" (number) The number of duffs of the output\n" + " \"height\" (number) The block height\n" " }\n" "]\n" "\nExamples:\n" @@ -737,9 +737,10 @@ UniValue getaddressdeltas(const UniValue& params, bool fHelp) "\nResult:\n" "[\n" " {\n" - " \"satoshis\" (number) The difference of satoshis\n" + " \"duffs\" (number) The difference of duffs\n" " \"txid\" (string) The related txid\n" " \"index\" (number) The related input or output index\n" + " \"blockindex\" (number) The related block index\n" " \"height\" (number) The block height\n" " \"address\" (string) The base58check encoded address\n" " }\n" @@ -821,8 +822,8 @@ UniValue getaddressbalance(const UniValue& params, bool fHelp) "}\n" "\nResult:\n" "{\n" - " \"balance\" (string) The current balance in satoshis\n" - " \"received\" (string) The total number of satoshis received (including change)\n" + " \"balance\" (string) The current balance in duffs\n" + " \"received\" (string) The total number of duffs received (including change)\n" "}\n" "\nExamples:\n" + HelpExampleCli("getaddressbalance", "'{\"addresses\": [\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\"]}'") diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 8f9ab2d05bbab..ad81ff4687970 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -252,6 +252,11 @@ UniValue gettxoutproof(const UniValue& params, bool fHelp) "2. \"block hash\" (string, optional) If specified, looks for txid in the block with this hash\n" "\nResult:\n" "\"data\" (string) A string that is a serialized, hex-encoded data for the proof.\n" + + "\nExamples:\n" + + HelpExampleCli("gettxoutproof", "'[\"mytxid\",...]'") + + HelpExampleCli("gettxoutproof", "'[\"mytxid\",...]' \"blockhash\"") + + HelpExampleRpc("gettxoutproof", "[\"mytxid\",...], \"blockhash\"") ); set setTxids; @@ -324,6 +329,10 @@ UniValue verifytxoutproof(const UniValue& params, bool fHelp) "1. \"proof\" (string, required) The hex-encoded proof generated by gettxoutproof\n" "\nResult:\n" "[\"txid\"] (array, strings) The txid(s) which the proof commits to, or empty array if the proof is invalid\n" + + "\nExamples:\n" + + HelpExampleCli("verifytxoutproof", "\"proof\"") + + HelpExampleRpc("gettxoutproof", "\"proof\"") ); CDataStream ssMB(ParseHexV(params[0], "proof"), SER_NETWORK, PROTOCOL_VERSION);