Skip to content

Commit fa9aaf8

Browse files
author
MarcoFalke
committed
scripted-diff: Use named args in RPC docs
-BEGIN VERIFY SCRIPT- sed -i -e 's|, /\* optional \*/ true,|, /*optional=*/true,|g' $( git grep -l ', /\* optional \*/ true,' ) -END VERIFY SCRIPT-
1 parent f601326 commit fa9aaf8

File tree

11 files changed

+199
-199
lines changed

11 files changed

+199
-199
lines changed

src/rpc/blockchain.cpp

Lines changed: 52 additions & 52 deletions
Large diffs are not rendered by default.

src/rpc/mining.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ static RPCHelpMan getmininginfo()
412412
RPCResult::Type::OBJ, "", "",
413413
{
414414
{RPCResult::Type::NUM, "blocks", "The current block"},
415-
{RPCResult::Type::NUM, "currentblockweight", /* optional */ true, "The block weight of the last assembled block (only present if a block was ever assembled)"},
416-
{RPCResult::Type::NUM, "currentblocktx", /* optional */ true, "The number of block transactions of the last assembled block (only present if a block was ever assembled)"},
415+
{RPCResult::Type::NUM, "currentblockweight", /*optional=*/true, "The block weight of the last assembled block (only present if a block was ever assembled)"},
416+
{RPCResult::Type::NUM, "currentblocktx", /*optional=*/true, "The number of block transactions of the last assembled block (only present if a block was ever assembled)"},
417417
{RPCResult::Type::NUM, "difficulty", "The current difficulty"},
418418
{RPCResult::Type::NUM, "networkhashps", "The network hashes per second"},
419419
{RPCResult::Type::NUM, "pooledtx", "The size of the mempool"},
@@ -590,12 +590,12 @@ static RPCHelpMan getblocktemplate()
590590
{RPCResult::Type::STR_HEX, "noncerange", "A range of valid nonces"},
591591
{RPCResult::Type::NUM, "sigoplimit", "limit of sigops in blocks"},
592592
{RPCResult::Type::NUM, "sizelimit", "limit of block size"},
593-
{RPCResult::Type::NUM, "weightlimit", /* optional */ true, "limit of block weight"},
593+
{RPCResult::Type::NUM, "weightlimit", /*optional=*/true, "limit of block weight"},
594594
{RPCResult::Type::NUM_TIME, "curtime", "current timestamp in " + UNIX_EPOCH_TIME},
595595
{RPCResult::Type::STR, "bits", "compressed target of next block"},
596596
{RPCResult::Type::NUM, "height", "The height of the next block"},
597-
{RPCResult::Type::STR_HEX, "signet_challenge", /* optional */ true, "Only on signet"},
598-
{RPCResult::Type::STR_HEX, "default_witness_commitment", /* optional */ true, "a valid witness commitment for the unmodified block template"},
597+
{RPCResult::Type::STR_HEX, "signet_challenge", /*optional=*/true, "Only on signet"},
598+
{RPCResult::Type::STR_HEX, "default_witness_commitment", /*optional=*/true, "a valid witness commitment for the unmodified block template"},
599599
}},
600600
},
601601
RPCExamples{
@@ -1082,8 +1082,8 @@ static RPCHelpMan estimatesmartfee()
10821082
RPCResult{
10831083
RPCResult::Type::OBJ, "", "",
10841084
{
1085-
{RPCResult::Type::NUM, "feerate", /* optional */ true, "estimate fee rate in " + CURRENCY_UNIT + "/kvB (only present if no errors were encountered)"},
1086-
{RPCResult::Type::ARR, "errors", /* optional */ true, "Errors encountered during processing (if there are any)",
1085+
{RPCResult::Type::NUM, "feerate", /*optional=*/true, "estimate fee rate in " + CURRENCY_UNIT + "/kvB (only present if no errors were encountered)"},
1086+
{RPCResult::Type::ARR, "errors", /*optional=*/true, "Errors encountered during processing (if there are any)",
10871087
{
10881088
{RPCResult::Type::STR, "", "error"},
10891089
}},
@@ -1155,12 +1155,12 @@ static RPCHelpMan estimaterawfee()
11551155
RPCResult{
11561156
RPCResult::Type::OBJ, "", "Results are returned for any horizon which tracks blocks up to the confirmation target",
11571157
{
1158-
{RPCResult::Type::OBJ, "short", /* optional */ true, "estimate for short time horizon",
1158+
{RPCResult::Type::OBJ, "short", /*optional=*/true, "estimate for short time horizon",
11591159
{
1160-
{RPCResult::Type::NUM, "feerate", /* optional */ true, "estimate fee rate in " + CURRENCY_UNIT + "/kvB"},
1160+
{RPCResult::Type::NUM, "feerate", /*optional=*/true, "estimate fee rate in " + CURRENCY_UNIT + "/kvB"},
11611161
{RPCResult::Type::NUM, "decay", "exponential decay (per block) for historical moving average of confirmation data"},
11621162
{RPCResult::Type::NUM, "scale", "The resolution of confirmation targets at this time horizon"},
1163-
{RPCResult::Type::OBJ, "pass", /* optional */ true, "information about the lowest range of feerates to succeed in meeting the threshold",
1163+
{RPCResult::Type::OBJ, "pass", /*optional=*/true, "information about the lowest range of feerates to succeed in meeting the threshold",
11641164
{
11651165
{RPCResult::Type::NUM, "startrange", "start of feerate range"},
11661166
{RPCResult::Type::NUM, "endrange", "end of feerate range"},
@@ -1169,20 +1169,20 @@ static RPCHelpMan estimaterawfee()
11691169
{RPCResult::Type::NUM, "inmempool", "current number of txs in mempool in the feerate range unconfirmed for at least target blocks"},
11701170
{RPCResult::Type::NUM, "leftmempool", "number of txs over history horizon in the feerate range that left mempool unconfirmed after target"},
11711171
}},
1172-
{RPCResult::Type::OBJ, "fail", /* optional */ true, "information about the highest range of feerates to fail to meet the threshold",
1172+
{RPCResult::Type::OBJ, "fail", /*optional=*/true, "information about the highest range of feerates to fail to meet the threshold",
11731173
{
11741174
{RPCResult::Type::ELISION, "", ""},
11751175
}},
1176-
{RPCResult::Type::ARR, "errors", /* optional */ true, "Errors encountered during processing (if there are any)",
1176+
{RPCResult::Type::ARR, "errors", /*optional=*/true, "Errors encountered during processing (if there are any)",
11771177
{
11781178
{RPCResult::Type::STR, "error", ""},
11791179
}},
11801180
}},
1181-
{RPCResult::Type::OBJ, "medium", /* optional */ true, "estimate for medium time horizon",
1181+
{RPCResult::Type::OBJ, "medium", /*optional=*/true, "estimate for medium time horizon",
11821182
{
11831183
{RPCResult::Type::ELISION, "", ""},
11841184
}},
1185-
{RPCResult::Type::OBJ, "long", /* optional */ true, "estimate for long time horizon",
1185+
{RPCResult::Type::OBJ, "long", /*optional=*/true, "estimate for long time horizon",
11861186
{
11871187
{RPCResult::Type::ELISION, "", ""},
11881188
}},

src/rpc/misc.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ static RPCHelpMan validateaddress()
4747
RPCResult::Type::OBJ, "", "",
4848
{
4949
{RPCResult::Type::BOOL, "isvalid", "If the address is valid or not"},
50-
{RPCResult::Type::STR, "address", /* optional */ true, "The bitcoin address validated"},
51-
{RPCResult::Type::STR_HEX, "scriptPubKey", /* optional */ true, "The hex-encoded scriptPubKey generated by the address"},
52-
{RPCResult::Type::BOOL, "isscript", /* optional */ true, "If the key is a script"},
53-
{RPCResult::Type::BOOL, "iswitness", /* optional */ true, "If the address is a witness address"},
54-
{RPCResult::Type::NUM, "witness_version", /* optional */ true, "The version number of the witness program"},
55-
{RPCResult::Type::STR_HEX, "witness_program", /* optional */ true, "The hex value of the witness program"},
56-
{RPCResult::Type::STR, "error", /* optional */ true, "Error message, if any"},
50+
{RPCResult::Type::STR, "address", /*optional=*/true, "The bitcoin address validated"},
51+
{RPCResult::Type::STR_HEX, "scriptPubKey", /*optional=*/true, "The hex-encoded scriptPubKey generated by the address"},
52+
{RPCResult::Type::BOOL, "isscript", /*optional=*/true, "If the key is a script"},
53+
{RPCResult::Type::BOOL, "iswitness", /*optional=*/true, "If the address is a witness address"},
54+
{RPCResult::Type::NUM, "witness_version", /*optional=*/true, "The version number of the witness program"},
55+
{RPCResult::Type::STR_HEX, "witness_program", /*optional=*/true, "The hex value of the witness program"},
56+
{RPCResult::Type::STR, "error", /*optional=*/true, "Error message, if any"},
5757
{RPCResult::Type::ARR, "error_locations", /*optional=*/true, "Indices of likely error locations in address, if known (e.g. Bech32 errors)",
5858
{
5959
{RPCResult::Type::NUM, "index", "index of a potential error"},

src/rpc/net.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ static RPCHelpMan getpeerinfo()
101101
{
102102
{RPCResult::Type::NUM, "id", "Peer index"},
103103
{RPCResult::Type::STR, "addr", "(host:port) The IP address and port of the peer"},
104-
{RPCResult::Type::STR, "addrbind", /* optional */ true, "(ip:port) Bind address of the connection to the peer"},
105-
{RPCResult::Type::STR, "addrlocal", /* optional */ true, "(ip:port) Local address as reported by the peer"},
104+
{RPCResult::Type::STR, "addrbind", /*optional=*/true, "(ip:port) Bind address of the connection to the peer"},
105+
{RPCResult::Type::STR, "addrlocal", /*optional=*/true, "(ip:port) Local address as reported by the peer"},
106106
{RPCResult::Type::STR, "network", "Network (" + Join(GetNetworkNames(/* append_unroutable */ true), ", ") + ")"},
107-
{RPCResult::Type::NUM, "mapped_as", /* optional */ true, "The AS in the BGP route to the peer used for diversifying\n"
107+
{RPCResult::Type::NUM, "mapped_as", /*optional=*/true, "The AS in the BGP route to the peer used for diversifying\n"
108108
"peer selection (only available if the asmap config flag is set)"},
109109
{RPCResult::Type::STR_HEX, "services", "The services offered"},
110110
{RPCResult::Type::ARR, "servicesnames", "the services offered, in human-readable form",
@@ -120,9 +120,9 @@ static RPCHelpMan getpeerinfo()
120120
{RPCResult::Type::NUM, "bytesrecv", "The total bytes received"},
121121
{RPCResult::Type::NUM_TIME, "conntime", "The " + UNIX_EPOCH_TIME + " of the connection"},
122122
{RPCResult::Type::NUM, "timeoffset", "The time offset in seconds"},
123-
{RPCResult::Type::NUM, "pingtime", /* optional */ true, "ping time (if available)"},
124-
{RPCResult::Type::NUM, "minping", /* optional */ true, "minimum observed ping time (if any at all)"},
125-
{RPCResult::Type::NUM, "pingwait", /* optional */ true, "ping wait (if non-zero)"},
123+
{RPCResult::Type::NUM, "pingtime", /*optional=*/true, "ping time (if available)"},
124+
{RPCResult::Type::NUM, "minping", /*optional=*/true, "minimum observed ping time (if any at all)"},
125+
{RPCResult::Type::NUM, "pingwait", /*optional=*/true, "ping wait (if non-zero)"},
126126
{RPCResult::Type::NUM, "version", "The peer version, such as 70001"},
127127
{RPCResult::Type::STR, "subver", "The string version"},
128128
{RPCResult::Type::BOOL, "inbound", "Inbound (true) or Outbound (false)"},

0 commit comments

Comments
 (0)