Skip to content

Commit

Permalink
RPC help formatting updates (#1670)
Browse files Browse the repository at this point in the history
- Convert satoshis to duffs
 - Correct order of fields in GetAddressUtxos
 - Add missing field from GetAddressDeltas (blockindex)
 - Add HelpExamples to gettxoutproof and verifytxoutproof
  • Loading branch information
thephez authored and UdjinM6 committed Oct 9, 2017
1 parent 11afd7c commit ece8849
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/rpc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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\"]}'")
Expand Down
9 changes: 9 additions & 0 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint256> setTxids;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ece8849

Please sign in to comment.