Skip to content

Commit

Permalink
rpc: Remove duplicate name and argNames from CRPCCommand
Browse files Browse the repository at this point in the history
Summary:
This is a backport of [[bitcoin/bitcoin#20012 | core#20012]] [3/3]
bitcoin/bitcoin@fa04f9b

Depends on D10760

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10761
  • Loading branch information
PiRK committed Jan 5, 2022
1 parent 25e918c commit 27d3f1a
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 197 deletions.
2 changes: 1 addition & 1 deletion src/qt/test/rpcnestedtests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static RPCHelpMan rpcNestedTest_rpc() {
}

static const CRPCCommand vRPCCommands[] = {
{"test", "rpcNestedTest", &rpcNestedTest_rpc, {"arg1", "arg2", "arg3"}},
{"test", &rpcNestedTest_rpc},
};

void RPCNestedTests::rpcNestedTests() {
Expand Down
6 changes: 3 additions & 3 deletions src/rpc/abc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ static RPCHelpMan getexcessiveblock() {
void RegisterABCRPCCommands(CRPCTable &t) {
// clang-format off
static const CRPCCommand commands[] = {
// category name actor (function) argNames
// ------------------- ------------------------ ---------------------- ----------
{ "network", "getexcessiveblock", getexcessiveblock, {}},
// category actor (function)
// ------------------ ----------------------
{ "network", getexcessiveblock, },
};
// clang-format on

Expand Down
22 changes: 11 additions & 11 deletions src/rpc/avalanche.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,17 +729,17 @@ static RPCHelpMan verifyavalancheproof() {
void RegisterAvalancheRPCCommands(CRPCTable &t) {
// clang-format off
static const CRPCCommand commands[] = {
// category name actor (function) argNames
// ------------------- ------------------------ ---------------------- ----------
{ "avalanche", "getavalanchekey", getavalanchekey, {}},
{ "avalanche", "addavalanchenode", addavalanchenode, {"nodeid", "publickey", "proof", "delegation"}},
{ "avalanche", "buildavalancheproof", buildavalancheproof, {"sequence", "expiration", "master", "stakes", "payoutAddress"}},
{ "avalanche", "decodeavalancheproof", decodeavalancheproof, {"proof"}},
{ "avalanche", "delegateavalancheproof", delegateavalancheproof, {"limitedproofid", "privatekey", "publickey", "delegation"}},
{ "avalanche", "getavalanchepeerinfo", getavalanchepeerinfo, {}},
{ "avalanche", "getrawavalancheproof", getrawavalancheproof, {"proofid"}},
{ "avalanche", "sendavalancheproof", sendavalancheproof, {"proof"}},
{ "avalanche", "verifyavalancheproof", verifyavalancheproof, {"proof"}},
// category actor (function)
// ----------------- --------------------
{ "avalanche", getavalanchekey, },
{ "avalanche", addavalanchenode, },
{ "avalanche", buildavalancheproof, },
{ "avalanche", decodeavalancheproof, },
{ "avalanche", delegateavalancheproof, },
{ "avalanche", getavalanchepeerinfo, },
{ "avalanche", getrawavalancheproof, },
{ "avalanche", sendavalancheproof, },
{ "avalanche", verifyavalancheproof, },
};
// clang-format on

Expand Down
72 changes: 36 additions & 36 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3058,44 +3058,44 @@ static RPCHelpMan dumptxoutset() {
void RegisterBlockchainRPCCommands(CRPCTable &t) {
// clang-format off
static const CRPCCommand commands[] = {
// category name actor (function) argNames
// ------------------- ------------------------ ---------------------- ----------
{ "blockchain", "getbestblockhash", getbestblockhash, {} },
{ "blockchain", "getblock", getblock, {"blockhash","verbosity|verbose"} },
{ "blockchain", "getblockchaininfo", getblockchaininfo, {} },
{ "blockchain", "getblockcount", getblockcount, {} },
{ "blockchain", "getblockhash", getblockhash, {"height"} },
{ "blockchain", "getblockheader", getblockheader, {"blockhash","verbose"} },
{ "blockchain", "getblockstats", getblockstats, {"hash_or_height","stats"} },
{ "blockchain", "getchaintips", getchaintips, {} },
{ "blockchain", "getchaintxstats", getchaintxstats, {"nblocks", "blockhash"} },
{ "blockchain", "getdifficulty", getdifficulty, {} },
{ "blockchain", "getmempoolancestors", getmempoolancestors, {"txid","verbose"} },
{ "blockchain", "getmempooldescendants", getmempooldescendants, {"txid","verbose"} },
{ "blockchain", "getmempoolentry", getmempoolentry, {"txid"} },
{ "blockchain", "getmempoolinfo", getmempoolinfo, {} },
{ "blockchain", "getrawmempool", getrawmempool, {"verbose", "mempool_sequence"} },
{ "blockchain", "gettxout", gettxout, {"txid","n","include_mempool"} },
{ "blockchain", "gettxoutsetinfo", gettxoutsetinfo, {"hash_type"} },
{ "blockchain", "pruneblockchain", pruneblockchain, {"height"} },
{ "blockchain", "savemempool", savemempool, {} },
{ "blockchain", "verifychain", verifychain, {"checklevel","nblocks"} },
{ "blockchain", "preciousblock", preciousblock, {"blockhash"} },
{ "blockchain", "scantxoutset", scantxoutset, {"action", "scanobjects"} },
{ "blockchain", "getblockfilter", getblockfilter, {"blockhash", "filtertype"} },
// category actor (function)
// ------------------ ----------------------
{ "blockchain", getbestblockhash, },
{ "blockchain", getblock, },
{ "blockchain", getblockchaininfo, },
{ "blockchain", getblockcount, },
{ "blockchain", getblockhash, },
{ "blockchain", getblockheader, },
{ "blockchain", getblockstats, },
{ "blockchain", getchaintips, },
{ "blockchain", getchaintxstats, },
{ "blockchain", getdifficulty, },
{ "blockchain", getmempoolancestors, },
{ "blockchain", getmempooldescendants, },
{ "blockchain", getmempoolentry, },
{ "blockchain", getmempoolinfo, },
{ "blockchain", getrawmempool, },
{ "blockchain", gettxout, },
{ "blockchain", gettxoutsetinfo, },
{ "blockchain", pruneblockchain, },
{ "blockchain", savemempool, },
{ "blockchain", verifychain, },
{ "blockchain", preciousblock, },
{ "blockchain", scantxoutset, },
{ "blockchain", getblockfilter, },

/* Not shown in help */
{ "hidden", "getfinalizedblockhash", getfinalizedblockhash, {} },
{ "hidden", "finalizeblock", finalizeblock, {"blockhash"} },
{ "hidden", "invalidateblock", invalidateblock, {"blockhash"} },
{ "hidden", "parkblock", parkblock, {"blockhash"} },
{ "hidden", "reconsiderblock", reconsiderblock, {"blockhash"} },
{ "hidden", "syncwithvalidationinterfacequeue", syncwithvalidationinterfacequeue, {} },
{ "hidden", "dumptxoutset", dumptxoutset, {"path"} },
{ "hidden", "unparkblock", unparkblock, {"blockhash"} },
{ "hidden", "waitfornewblock", waitfornewblock, {"timeout"} },
{ "hidden", "waitforblock", waitforblock, {"blockhash","timeout"} },
{ "hidden", "waitforblockheight", waitforblockheight, {"height","timeout"} },
{ "hidden", getfinalizedblockhash, },
{ "hidden", finalizeblock, },
{ "hidden", invalidateblock, },
{ "hidden", parkblock, },
{ "hidden", reconsiderblock, },
{ "hidden", syncwithvalidationinterfacequeue, },
{ "hidden", dumptxoutset, },
{ "hidden", unparkblock, },
{ "hidden", waitfornewblock, },
{ "hidden", waitforblock, },
{ "hidden", waitforblockheight, },
};
// clang-format on
for (const auto &c : commands) {
Expand Down
32 changes: 16 additions & 16 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,22 +1189,22 @@ static RPCHelpMan estimatefee() {
void RegisterMiningRPCCommands(CRPCTable &t) {
// clang-format off
static const CRPCCommand commands[] = {
// category name actor (function) argNames
// ---------- ------------------------ ---------------------- ----------
{"mining", "getnetworkhashps", getnetworkhashps, {"nblocks", "height"}},
{"mining", "getmininginfo", getmininginfo, {}},
{"mining", "prioritisetransaction", prioritisetransaction, {"txid", "dummy", "fee_delta"}},
{"mining", "getblocktemplate", getblocktemplate, {"template_request"}},
{"mining", "submitblock", submitblock, {"hexdata", "dummy"}},
{"mining", "submitheader", submitheader, {"hexdata"}},

{"generating", "generatetoaddress", generatetoaddress, {"nblocks", "address", "maxtries"}},
{"generating", "generatetodescriptor", generatetodescriptor, {"num_blocks","descriptor","maxtries"}},
{"generating", "generateblock", generateblock, {"output","transactions"}},

{"util", "estimatefee", estimatefee, {}},

{"hidden", "generate", generate, {}},
// category actor (function)
// ---------- ----------------------
{"mining", getnetworkhashps, },
{"mining", getmininginfo, },
{"mining", prioritisetransaction, },
{"mining", getblocktemplate, },
{"mining", submitblock, },
{"mining", submitheader, },

{"generating", generatetoaddress, },
{"generating", generatetodescriptor, },
{"generating", generateblock, },

{"util", estimatefee, },

{"hidden", generate, },
};
// clang-format on
for (const auto &c : commands) {
Expand Down
32 changes: 16 additions & 16 deletions src/rpc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,24 +888,24 @@ static RPCHelpMan getindexinfo() {
void RegisterMiscRPCCommands(CRPCTable &t) {
// clang-format off
static const CRPCCommand commands[] = {
// category name actor (function) argNames
// ------------------- ------------------------ ---------------------- ----------
{ "control", "getmemoryinfo", getmemoryinfo, {"mode"} },
{ "control", "logging", logging, {"include", "exclude"} },
{ "util", "validateaddress", validateaddress, {"address"} },
{ "util", "createmultisig", createmultisig, {"nrequired","keys"} },
{ "util", "deriveaddresses", deriveaddresses, {"descriptor", "range"} },
{ "util", "getdescriptorinfo", getdescriptorinfo, {"descriptor"} },
{ "util", "verifymessage", verifymessage, {"address","signature","message"} },
{ "util", "signmessagewithprivkey", signmessagewithprivkey, {"privkey","message"} },
{ "util", "getcurrencyinfo", getcurrencyinfo, {} },
{ "util", "getindexinfo", getindexinfo, {"index_name"} },
// category actor (function)
// ------------------ ----------------------
{ "control", getmemoryinfo, },
{ "control", logging, },
{ "util", validateaddress, },
{ "util", createmultisig, },
{ "util", deriveaddresses, },
{ "util", getdescriptorinfo, },
{ "util", verifymessage, },
{ "util", signmessagewithprivkey, },
{ "util", getcurrencyinfo, },
{ "util", getindexinfo, },

/* Not shown in help */
{ "hidden", "setmocktime", setmocktime, {"timestamp"}},
{ "hidden", "mockscheduler", mockscheduler, {"delta_time"}},
{ "hidden", "echo", echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}},
{ "hidden", "echojson", echojson, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}},
{ "hidden", setmocktime, },
{ "hidden", mockscheduler, },
{ "hidden", echo, },
{ "hidden", echojson, },
};
// clang-format on
for (const auto &c : commands) {
Expand Down
32 changes: 16 additions & 16 deletions src/rpc/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1085,22 +1085,22 @@ static RPCHelpMan addpeeraddress() {
void RegisterNetRPCCommands(CRPCTable &t) {
// clang-format off
static const CRPCCommand commands[] = {
// category name actor (function) argNames
// ------------------- ------------------------ ---------------------- ----------
{ "network", "getconnectioncount", getconnectioncount, {} },
{ "network", "ping", ping, {} },
{ "network", "getpeerinfo", getpeerinfo, {} },
{ "network", "addnode", addnode, {"node","command"} },
{ "network", "disconnectnode", disconnectnode, {"address", "nodeid"} },
{ "network", "getaddednodeinfo", getaddednodeinfo, {"node"} },
{ "network", "getnettotals", getnettotals, {} },
{ "network", "getnetworkinfo", getnetworkinfo, {} },
{ "network", "setban", setban, {"subnet", "command", "bantime", "absolute"} },
{ "network", "listbanned", listbanned, {} },
{ "network", "clearbanned", clearbanned, {} },
{ "network", "setnetworkactive", setnetworkactive, {"state"} },
{ "network", "getnodeaddresses", getnodeaddresses, {"count"} },
{ "hidden", "addpeeraddress", addpeeraddress, {"address", "port"} },
// category actor (function)
// ------------------ ----------------------
{ "network", getconnectioncount, },
{ "network", ping, },
{ "network", getpeerinfo, },
{ "network", addnode, },
{ "network", disconnectnode, },
{ "network", getaddednodeinfo, },
{ "network", getnettotals, },
{ "network", getnetworkinfo, },
{ "network", setban, },
{ "network", listbanned, },
{ "network", clearbanned, },
{ "network", setnetworkactive, },
{ "network", getnodeaddresses, },
{ "hidden", addpeeraddress, },
};
// clang-format on
for (const auto &c : commands) {
Expand Down
Loading

0 comments on commit 27d3f1a

Please sign in to comment.