Skip to content

Commit

Permalink
scripted-diff: Add missing spaces in RPCResult, Fix type names
Browse files Browse the repository at this point in the history
This makes the rendered diff smaller when the RPCResult is machine
generated later on

-BEGIN VERIFY SCRIPT-
 # Add space after dictionary key and before colon
 sed -i --regexp-extended -e 's/(^ +" +\\"[a-zA-Z_]+\\"): ?/\1 : /g' $(git grep -l '\\":')
 # Rename (array) to (json array)
 sed -i -e 's/ (array) / (json array) /g' $(git grep -l '(array)' ./src)
 # Rename (object) to (json object)
 sed -i -e 's/ (object) / (json object) /g' $(git grep -l '(object)' ./src)
 # Rename (bool) to (boolean)
 sed -i -e 's/ (bool) / (boolean) /g' $(git grep -l '(bool)' ./src)
 # Rename (int) to (numeric)
 sed -i -e 's/  (int) /  (numeric) /g' $(git grep -l '(int)' ./src)
-END VERIFY SCRIPT-
  • Loading branch information
MarcoFalke committed Feb 9, 2020
1 parent 75fb37c commit fad027f
Show file tree
Hide file tree
Showing 8 changed files with 315 additions and 315 deletions.
222 changes: 111 additions & 111 deletions src/rpc/blockchain.cpp

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static UniValue generatetodescriptor(const JSONRPCRequest& request)
{"maxtries", RPCArg::Type::NUM, /* default */ "1000000", "How many iterations to try."},
},
RPCResult{
"[ blockhashes ] (array) hashes of blocks generated\n"},
"[ blockhashes ] (json array) hashes of blocks generated\n"},
RPCExamples{
"\nGenerate 11 blocks to mydesc\n" + HelpExampleCli("generatetodescriptor", "11 \"mydesc\"")},
}
Expand Down Expand Up @@ -196,7 +196,7 @@ static UniValue generatetoaddress(const JSONRPCRequest& request)
{"maxtries", RPCArg::Type::NUM, /* default */ "1000000", "How many iterations to try."},
},
RPCResult{
"[ blockhashes ] (array) hashes of blocks generated\n"
"[ blockhashes ] (json array) hashes of blocks generated\n"
},
RPCExamples{
"\nGenerate 11 blocks to myaddress\n"
Expand Down Expand Up @@ -231,14 +231,14 @@ static UniValue getmininginfo(const JSONRPCRequest& request)
{},
RPCResult{
"{\n"
" \"blocks\": nnn, (numeric) The current block\n"
" \"currentblockweight\": nnn, (numeric, optional) The block weight of the last assembled block (only present if a block was ever assembled)\n"
" \"currentblocktx\": nnn, (numeric, optional) The number of block transactions of the last assembled block (only present if a block was ever assembled)\n"
" \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n"
" \"networkhashps\": nnn, (numeric) The network hashes per second\n"
" \"pooledtx\": n (numeric) The size of the mempool\n"
" \"chain\": \"xxxx\", (string) current network name (main, test, regtest)\n"
" \"warnings\": \"...\" (string) any network and blockchain warnings\n"
" \"blocks\" : nnn, (numeric) The current block\n"
" \"currentblockweight\" : nnn, (numeric, optional) The block weight of the last assembled block (only present if a block was ever assembled)\n"
" \"currentblocktx\" : nnn, (numeric, optional) The number of block transactions of the last assembled block (only present if a block was ever assembled)\n"
" \"difficulty\" : xxx.xxxxx (numeric) The current difficulty\n"
" \"networkhashps\" : nnn, (numeric) The network hashes per second\n"
" \"pooledtx\" : n (numeric) The size of the mempool\n"
" \"chain\" : \"xxxx\", (string) current network name (main, test, regtest)\n"
" \"warnings\" : \"...\" (string) any network and blockchain warnings\n"
"}\n"
},
RPCExamples{
Expand Down Expand Up @@ -365,16 +365,16 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
" },\n"
" \"vbrequired\" : n, (numeric) bit mask of versionbits the server requires set in submissions\n"
" \"previousblockhash\" : \"xxxx\", (string) The hash of current highest block\n"
" \"transactions\" : [ (array) contents of non-coinbase transactions that should be included in the next block\n"
" \"transactions\" : [ (json array) contents of non-coinbase transactions that should be included in the next block\n"
" {\n"
" \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n"
" \"txid\" : \"xxxx\", (string) transaction id encoded in little-endian hexadecimal\n"
" \"hash\" : \"xxxx\", (string) hash encoded in little-endian hexadecimal (including witness data)\n"
" \"depends\" : [ (array) array of numbers \n"
" \"depends\" : [ (json array) array of numbers \n"
" n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\n"
" ,...\n"
" ],\n"
" \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n"
" \"fee\" : n, (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n"
" \"sigops\" : n, (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero\n"
" \"weight\" : n, (numeric) total transaction weight, as counted for purposes of block limits\n"
" }\n"
Expand Down Expand Up @@ -850,7 +850,7 @@ static UniValue estimatesmartfee(const JSONRPCRequest& request)
RPCResult{
"{\n"
" \"feerate\" : x.x, (numeric, optional) estimate fee rate in " + CURRENCY_UNIT + "/kB\n"
" \"errors\": [ str... ] (json array of strings, optional) Errors encountered during processing\n"
" \"errors\" : [ str... ] (json array of strings, optional) Errors encountered during processing\n"
" \"blocks\" : n (numeric) block number where estimate was found\n"
"}\n"
"\n"
Expand Down Expand Up @@ -924,7 +924,7 @@ static UniValue estimaterawfee(const JSONRPCRequest& request)
" \"fail\" : { (json object, optional) information about the highest range of feerates to fail to meet the threshold\n"
" ...\n"
" },\n"
" \"errors\": [ (json array, optional) Errors encountered during processing\n"
" \"errors\" : [ (json array, optional) Errors encountered during processing\n"
" \"str\", (string)\n"
" ...\n"
" ],\n"
Expand Down
24 changes: 12 additions & 12 deletions src/rpc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ static UniValue createmultisig(const JSONRPCRequest& request)
},
RPCResult{
"{\n"
" \"address\":\"multisigaddress\", (string) The value of the new multisig address.\n"
" \"redeemScript\":\"script\" (string) The string value of the hex-encoded redemption script.\n"
" \"descriptor\":\"descriptor\" (string) The descriptor for this multisig\n"
" \"address\" : \"multisigaddress\", (string) The value of the new multisig address.\n"
" \"redeemScript\" : \"script\" (string) The string value of the hex-encoded redemption script.\n"
" \"descriptor\" : \"descriptor\" (string) The descriptor for this multisig\n"
"}\n"
},
RPCExamples{
Expand Down Expand Up @@ -187,7 +187,7 @@ UniValue deriveaddresses(const JSONRPCRequest& request)
{"range", RPCArg::Type::RANGE, RPCArg::Optional::OMITTED_NAMED_ARG, "If a ranged descriptor is used, this specifies the end or the range (in [begin,end] notation) to derive."},
},
RPCResult{
"[ address ] (array) the derived addresses\n"
"[ address ] (json array) the derived addresses\n"
},
RPCExamples{
"First three native segwit receive addresses\n" +
Expand Down Expand Up @@ -418,13 +418,13 @@ static UniValue getmemoryinfo(const JSONRPCRequest& request)
{
RPCResult{"mode \"stats\"",
"{\n"
" \"locked\": { (json object) Information about locked memory manager\n"
" \"used\": xxxxx, (numeric) Number of bytes used\n"
" \"free\": xxxxx, (numeric) Number of bytes available in current arenas\n"
" \"total\": xxxxxxx, (numeric) Total number of bytes managed\n"
" \"locked\": xxxxxx, (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.\n"
" \"chunks_used\": xxxxx, (numeric) Number allocated chunks\n"
" \"chunks_free\": xxxxx, (numeric) Number unused chunks\n"
" \"locked\" : { (json object) Information about locked memory manager\n"
" \"used\" : xxxxx, (numeric) Number of bytes used\n"
" \"free\" : xxxxx, (numeric) Number of bytes available in current arenas\n"
" \"total\" : xxxxxxx, (numeric) Total number of bytes managed\n"
" \"locked\" : xxxxxx, (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.\n"
" \"chunks_used\" : xxxxx, (numeric) Number allocated chunks\n"
" \"chunks_free\" : xxxxx, (numeric) Number unused chunks\n"
" }\n"
"}\n"
},
Expand Down Expand Up @@ -497,7 +497,7 @@ UniValue logging(const JSONRPCRequest& request)
},
RPCResult{
"{ (json object where keys are the logging categories, and values indicates its status\n"
" \"category\": true|false, (bool) if being debug logged or not. false:inactive, true:active\n"
" \"category\" : true|false, (boolean) if being debug logged or not. false:inactive, true:active\n"
" ...\n"
"}\n"
},
Expand Down
Loading

0 comments on commit fad027f

Please sign in to comment.