Skip to content

Commit 838b85e

Browse files
committed
Merge #14008: Preserve a format of RPC command definitions
d9d7957 Preserve a format of RPC command definitions (Kostiantyn Stepaniuk) Pull request description: Currently, RPC commands are formatted in a way that it's easy to read and that `test/lint/check-rpc-mappings.py` can parse it. To void breaking `test/lint/check-rpc-mappings.py` script by running `clang-format`, RPC command definitions should be disabled for clang-format. Tree-SHA512: e17d20ec0e6c4e19410198b55687ebbe6fa01654d214d4578cd16c00b872bf8b0b306594a45523685cd2e9d9280702e00471d9366e87954428e8bbeacd8cad60
2 parents 7c7bb6e + d9d7957 commit 838b85e

File tree

9 files changed

+18
-2
lines changed

9 files changed

+18
-2
lines changed

src/coins.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ class CCoinsViewCache : public CCoinsViewBacked
285285
* Note that lightweight clients may not know anything besides the hash of previous transactions,
286286
* so may not be able to calculate this.
287287
*
288-
* @param[in] tx transaction for which we are checking input total
289-
* @return Sum of value of all inputs (scriptSigs)
288+
* @param[in] tx transaction for which we are checking input total
289+
* @return Sum of value of all inputs (scriptSigs)
290290
*/
291291
CAmount GetValueIn(const CTransaction& tx) const;
292292

src/rpc/blockchain.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,6 +2192,7 @@ UniValue scantxoutset(const JSONRPCRequest& request)
21922192
return result;
21932193
}
21942194

2195+
// clang-format off
21952196
static const CRPCCommand commands[] =
21962197
{ // category name actor (function) argNames
21972198
// --------------------- ------------------------ ----------------------- ----------
@@ -2227,6 +2228,7 @@ static const CRPCCommand commands[] =
22272228
{ "hidden", "waitforblockheight", &waitforblockheight, {"height","timeout"} },
22282229
{ "hidden", "syncwithvalidationinterfacequeue", &syncwithvalidationinterfacequeue, {} },
22292230
};
2231+
// clang-format on
22302232

22312233
void RegisterBlockchainRPCCommands(CRPCTable &t)
22322234
{

src/rpc/client.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class CRPCConvertParam
1818
std::string paramName; //!< parameter name
1919
};
2020

21+
// clang-format off
2122
/**
2223
* Specify a (method, idx, name) here if the argument is a non-string RPC
2324
* argument and needs to be converted from JSON.
@@ -163,6 +164,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
163164
{ "rescanblockchain", 1, "stop_height"},
164165
{ "createwallet", 1, "disable_private_keys"},
165166
};
167+
// clang-format on
166168

167169
class CRPCConvertTable
168170
{

src/rpc/mining.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,7 @@ static UniValue estimaterawfee(const JSONRPCRequest& request)
968968
return result;
969969
}
970970

971+
// clang-format off
971972
static const CRPCCommand commands[] =
972973
{ // category name actor (function) argNames
973974
// --------------------- ------------------------ ----------------------- ----------
@@ -986,6 +987,7 @@ static const CRPCCommand commands[] =
986987

987988
{ "hidden", "estimaterawfee", &estimaterawfee, {"conf_target", "threshold"} },
988989
};
990+
// clang-format on
989991

990992
void RegisterMiningRPCCommands(CRPCTable &t)
991993
{

src/rpc/misc.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ static UniValue echo(const JSONRPCRequest& request)
439439
return request.params;
440440
}
441441

442+
// clang-format off
442443
static const CRPCCommand commands[] =
443444
{ // category name actor (function) argNames
444445
// --------------------- ------------------------ ----------------------- ----------
@@ -454,6 +455,7 @@ static const CRPCCommand commands[] =
454455
{ "hidden", "echo", &echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}},
455456
{ "hidden", "echojson", &echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}},
456457
};
458+
// clang-format on
457459

458460
void RegisterMiscRPCCommands(CRPCTable &t)
459461
{

src/rpc/net.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ static UniValue setnetworkactive(const JSONRPCRequest& request)
626626
return g_connman->GetNetworkActive();
627627
}
628628

629+
// clang-format off
629630
static const CRPCCommand commands[] =
630631
{ // category name actor (function) argNames
631632
// --------------------- ------------------------ ----------------------- ----------
@@ -642,6 +643,7 @@ static const CRPCCommand commands[] =
642643
{ "network", "clearbanned", &clearbanned, {} },
643644
{ "network", "setnetworkactive", &setnetworkactive, {"state"} },
644645
};
646+
// clang-format on
645647

646648
void RegisterNetRPCCommands(CRPCTable &t)
647649
{

src/rpc/rawtransaction.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,6 +1695,7 @@ UniValue converttopsbt(const JSONRPCRequest& request)
16951695
return EncodeBase64((unsigned char*)ssTx.data(), ssTx.size());
16961696
}
16971697

1698+
// clang-format off
16981699
static const CRPCCommand commands[] =
16991700
{ // category name actor (function) argNames
17001701
// --------------------- ------------------------ ----------------------- ----------
@@ -1716,6 +1717,7 @@ static const CRPCCommand commands[] =
17161717
{ "blockchain", "gettxoutproof", &gettxoutproof, {"txids", "blockhash"} },
17171718
{ "blockchain", "verifytxoutproof", &verifytxoutproof, {"proof"} },
17181719
};
1720+
// clang-format on
17191721

17201722
void RegisterRawTransactionRPCCommands(CRPCTable &t)
17211723
{

src/rpc/server.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ static UniValue uptime(const JSONRPCRequest& jsonRequest)
252252
return GetTime() - GetStartupTime();
253253
}
254254

255+
// clang-format off
255256
/**
256257
* Call Table
257258
*/
@@ -263,6 +264,7 @@ static const CRPCCommand vRPCCommands[] =
263264
{ "control", "stop", &stop, {} },
264265
{ "control", "uptime", &uptime, {} },
265266
};
267+
// clang-format on
266268

267269
CRPCTable::CRPCTable()
268270
{

src/wallet/rpcwallet.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4065,6 +4065,7 @@ UniValue importprunedfunds(const JSONRPCRequest& request);
40654065
UniValue removeprunedfunds(const JSONRPCRequest& request);
40664066
UniValue importmulti(const JSONRPCRequest& request);
40674067

4068+
// clang-format off
40684069
static const CRPCCommand commands[] =
40694070
{ // category name actor (function) argNames
40704071
// --------------------- ------------------------ ----------------------- ----------
@@ -4125,6 +4126,7 @@ static const CRPCCommand commands[] =
41254126
{ "wallet", "walletpassphrasechange", &walletpassphrasechange, {"oldpassphrase","newpassphrase"} },
41264127
{ "wallet", "walletprocesspsbt", &walletprocesspsbt, {"psbt","sign","sighashtype","bip32derivs"} },
41274128
};
4129+
// clang-format on
41284130

41294131
void RegisterWalletRPCCommands(CRPCTable &t)
41304132
{

0 commit comments

Comments
 (0)