Skip to content

Commit d9d7957

Browse files
committed
Preserve a format of RPC command definitions
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.
1 parent 2a58340 commit d9d7957

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
@@ -2179,6 +2179,7 @@ UniValue scantxoutset(const JSONRPCRequest& request)
21792179
return result;
21802180
}
21812181

2182+
// clang-format off
21822183
static const CRPCCommand commands[] =
21832184
{ // category name actor (function) argNames
21842185
// --------------------- ------------------------ ----------------------- ----------
@@ -2214,6 +2215,7 @@ static const CRPCCommand commands[] =
22142215
{ "hidden", "waitforblockheight", &waitforblockheight, {"height","timeout"} },
22152216
{ "hidden", "syncwithvalidationinterfacequeue", &syncwithvalidationinterfacequeue, {} },
22162217
};
2218+
// clang-format on
22172219

22182220
void RegisterBlockchainRPCCommands(CRPCTable &t)
22192221
{

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.
@@ -174,6 +175,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
174175
{ "rescanblockchain", 1, "stop_height"},
175176
{ "createwallet", 1, "disable_private_keys"},
176177
};
178+
// clang-format on
177179

178180
class CRPCConvertTable
179181
{

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
@@ -456,6 +456,7 @@ static UniValue echo(const JSONRPCRequest& request)
456456
return request.params;
457457
}
458458

459+
// clang-format off
459460
static const CRPCCommand commands[] =
460461
{ // category name actor (function) argNames
461462
// --------------------- ------------------------ ----------------------- ----------
@@ -471,6 +472,7 @@ static const CRPCCommand commands[] =
471472
{ "hidden", "echo", &echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}},
472473
{ "hidden", "echojson", &echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}},
473474
};
475+
// clang-format on
474476

475477
void RegisterMiscRPCCommands(CRPCTable &t)
476478
{

src/rpc/net.cpp

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

627+
// clang-format off
627628
static const CRPCCommand commands[] =
628629
{ // category name actor (function) argNames
629630
// --------------------- ------------------------ ----------------------- ----------
@@ -640,6 +641,7 @@ static const CRPCCommand commands[] =
640641
{ "network", "clearbanned", &clearbanned, {} },
641642
{ "network", "setnetworkactive", &setnetworkactive, {"state"} },
642643
};
644+
// clang-format on
643645

644646
void RegisterNetRPCCommands(CRPCTable &t)
645647
{

src/rpc/rawtransaction.cpp

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

1804+
// clang-format off
18041805
static const CRPCCommand commands[] =
18051806
{ // category name actor (function) argNames
18061807
// --------------------- ------------------------ ----------------------- ----------
@@ -1822,6 +1823,7 @@ static const CRPCCommand commands[] =
18221823
{ "blockchain", "gettxoutproof", &gettxoutproof, {"txids", "blockhash"} },
18231824
{ "blockchain", "verifytxoutproof", &verifytxoutproof, {"proof"} },
18241825
};
1826+
// clang-format on
18251827

18261828
void RegisterRawTransactionRPCCommands(CRPCTable &t)
18271829
{

src/rpc/server.cpp

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

258+
// clang-format off
258259
/**
259260
* Call Table
260261
*/
@@ -266,6 +267,7 @@ static const CRPCCommand vRPCCommands[] =
266267
{ "control", "stop", &stop, {} },
267268
{ "control", "uptime", &uptime, {} },
268269
};
270+
// clang-format on
269271

270272
CRPCTable::CRPCTable()
271273
{

src/wallet/rpcwallet.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4760,6 +4760,7 @@ UniValue importprunedfunds(const JSONRPCRequest& request);
47604760
UniValue removeprunedfunds(const JSONRPCRequest& request);
47614761
UniValue importmulti(const JSONRPCRequest& request);
47624762

4763+
// clang-format off
47634764
static const CRPCCommand commands[] =
47644765
{ // category name actor (function) argNames
47654766
// --------------------- ------------------------ ----------------------- ----------
@@ -4834,6 +4835,7 @@ static const CRPCCommand commands[] =
48344835

48354836
{ "generating", "generate", &generate, {"nblocks","maxtries"} },
48364837
};
4838+
// clang-format on
48374839

48384840
void RegisterWalletRPCCommands(CRPCTable &t)
48394841
{

0 commit comments

Comments
 (0)