From fd7e0db763ca4967036badacdad7daefb6578b71 Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Sat, 4 Nov 2023 10:12:33 +0000 Subject: [PATCH] Fix RPCCall test --- src/test/rpc/RPCCall_test.cpp | 447 +++++++++++++++++----------------- 1 file changed, 226 insertions(+), 221 deletions(-) diff --git a/src/test/rpc/RPCCall_test.cpp b/src/test/rpc/RPCCall_test.cpp index 00482281aa4..86e3ff6d9d1 100644 --- a/src/test/rpc/RPCCall_test.cpp +++ b/src/test/rpc/RPCCall_test.cpp @@ -24,6 +24,8 @@ #include #include + +#include #include #include @@ -42,19 +44,22 @@ struct RPCCallTestData Exception const throwsWhat; // Expected JSON response. - char const* const exp; + char const* const expV1; + char const* const expV2; RPCCallTestData( char const* description_, int line_, std::initializer_list const& args_, Exception throwsWhat_, - char const* exp_) + char const* expV1_, + char const* expV2_ = nullptr) : description(description_) , line(line_) , args(args_) , throwsWhat(throwsWhat_) - , exp(exp_) + , expV1(expV1_) + , expV2(expV2_ ? expV2_ : expV1_) { } @@ -78,7 +83,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_channels", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" } ] @@ -93,7 +98,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_channels", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "destination_account" : "rD5MbavGfiSC5m7mkxy1FANuT7s3HxqpoF" } @@ -109,7 +114,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_channels", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "destination_account" : "r9emE59aTWb85t64dAebKrxYMBTpzK5yR7" } @@ -125,7 +130,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_channels", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA" } @@ -142,7 +147,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_channels", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA", "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" @@ -160,7 +165,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_channels", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "destination_account" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA", "ledger_index" : 90210 @@ -229,7 +234,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_currencies", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" } ] @@ -242,7 +247,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_currencies", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "racb4o3DrdYxuCfyVa6vsLb7vgju9RFbBr" } ] @@ -255,7 +260,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_currencies", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 42 } @@ -269,7 +274,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_currencies", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : "validated" } @@ -284,7 +289,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "params" : [ { "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : "current" } ] @@ -331,7 +336,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_currencies", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 0 } @@ -367,7 +372,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" } ] @@ -380,7 +385,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 77777 } @@ -394,7 +399,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : "closed" } @@ -410,7 +415,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" } @@ -425,7 +430,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "params" : [ { "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : "validated" } ] @@ -494,7 +499,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_lines", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", } ] @@ -509,7 +514,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_lines", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA" } @@ -526,7 +531,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_lines", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 888888888, "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA" @@ -544,7 +549,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_lines", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : "closed", "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA" @@ -562,7 +567,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_lines", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_hash" : "FFFFEEEEDDDDCCCCBBBBAAAA9999888877776666555544443333222211110000", "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA" @@ -598,7 +603,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_lines", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 12345678, "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA" @@ -619,7 +624,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_lines", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 12345678, "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA" @@ -678,7 +683,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_lines", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" } ] @@ -696,7 +701,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_lines", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 0, "peer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA" @@ -715,7 +720,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_objects", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" } ] @@ -728,7 +733,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_objects", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 77777 } @@ -742,7 +747,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_objects", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : "closed" } @@ -758,7 +763,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_objects", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" } @@ -772,7 +777,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_objects", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : "validated" } @@ -809,7 +814,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_objects", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" } ] @@ -830,7 +835,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_objects", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" } ] @@ -887,7 +892,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_objects", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 0 } @@ -905,7 +910,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_objects", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 0 } @@ -923,7 +928,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" } ] @@ -936,7 +941,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 987654321 } @@ -950,7 +955,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : "validated" } @@ -966,7 +971,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" } @@ -980,7 +985,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : "validated" } @@ -1014,7 +1019,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" } ] @@ -1070,7 +1075,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 0 } @@ -1088,7 +1093,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 0 } @@ -1106,7 +1111,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", } ] @@ -1119,7 +1124,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 444 } @@ -1138,7 +1143,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "count" : true, "binary" : true, @@ -1155,7 +1160,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index_max" : -1, "ledger_index_min" : -1 @@ -1176,7 +1181,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "binary" : true, "count" : true, @@ -1194,7 +1199,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index_max" : -1, "ledger_index_min" : 247, @@ -1217,7 +1222,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "binary" : true, "count" : true, @@ -1241,7 +1246,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index_max" : 590, "ledger_index_min" : 589, @@ -1265,7 +1270,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "count" : true, "descending" : true, @@ -1341,7 +1346,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "account_tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 0 } @@ -1353,8 +1358,7 @@ static RPCCallTestData const rpcCallTestArray[] = { __LINE__, {"account_tx", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "580", "579"}, RPCCallTestData::no_exception, - RPC::apiMaximumSupportedVersion == 1 ? - R"({ + R"({ "method" : "account_tx", "params" : [ { @@ -1363,9 +1367,8 @@ static RPCCallTestData const rpcCallTestArray[] = { "error_message" : "Ledger indexes invalid." } ] - })" - : - R"({ + })", + R"({ "method" : "account_tx", "params" : [ { @@ -1445,7 +1448,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "book_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "taker_gets" : { "currency" : "EUR" }, @@ -1467,7 +1470,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "book_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "taker_gets" : { "currency" : "EUR", "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA" @@ -1489,7 +1492,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "book_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA", "taker_gets" : { "currency" : "EUR" @@ -1512,7 +1515,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "book_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA", "ledger_index" : 666, "taker_gets" : { @@ -1537,7 +1540,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "book_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA", "ledger_index" : "current", "taker_gets" : { @@ -1562,7 +1565,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "book_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA", "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789", "taker_gets" : { @@ -1593,7 +1596,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "book_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA", "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789", "limit" : 200, @@ -1625,7 +1628,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "book_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA", "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789", "limit" : 200, @@ -1725,7 +1728,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "book_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "issuer" : "not_a_valid_issuer", "taker_gets" : { "currency" : "EUR" @@ -1748,7 +1751,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "book_offers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "issuer" : "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA", "ledger_index" : 0, "taker_gets" : { @@ -1789,7 +1792,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "can_delete", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -1804,7 +1807,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "can_delete", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "can_delete" : 4294967295 } ] @@ -1820,7 +1823,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "can_delete", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "can_delete" : "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210" } ] @@ -1836,7 +1839,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "can_delete", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "can_delete" : "always" } ] @@ -1852,7 +1855,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "can_delete", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "can_delete" : "never" } ] @@ -1868,7 +1871,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "can_delete", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "can_delete" : "now" } ] @@ -1895,7 +1898,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "can_delete", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "can_delete" : "invalid" } ] @@ -1932,7 +1935,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "channel_authorize", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "amount" : "18446744073709551615", "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF", "secret" : "secret_can_be_anything" @@ -2094,7 +2097,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "channel_verify", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "amount" : "0", "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF", "public_key" : "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov", @@ -2114,7 +2117,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "channel_verify", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "amount" : "18446744073709551615", "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF", "public_key" : "021D93E21C44160A1B3B66DA1F37B86BE39FFEA3FC4B95FAA2063F82EE823599F6", @@ -2277,7 +2280,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "channel_verify", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "amount" : "40000000", "channel_id" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF", "public_key" : "aB4BXXLuPu8DpVuyq1DBiu3SrPdtK9AYZisKhu8mvkoiUD8J9Gov", @@ -2299,7 +2302,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "connect", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ip" : "ThereIsNoCheckingOnTheIPFormat" } ] @@ -2312,7 +2315,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "connect", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ip" : "ThereIsNoCheckingOnTheIPFormat", "port" : 6561 } @@ -2381,7 +2384,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "consensus_info", "params" : [ { - "api_version" : %MAX_API_VER% + "api_version" : %API_VER% } ] })"}, @@ -2414,7 +2417,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "deposit_authorized", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "destination_account" : "destination_account_NotValidated", "source_account" : "source_account_NotValidated" } @@ -2431,7 +2434,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "deposit_authorized", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "destination_account" : "destination_account_NotValidated", "ledger_index" : "validated", "source_account" : "source_account_NotValidated" @@ -2449,7 +2452,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "deposit_authorized", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "destination_account" : "destination_account_NotValidated", "ledger_index" : 4294967295, "source_account" : "source_account_NotValidated" @@ -2467,7 +2470,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "deposit_authorized", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "destination_account" : "destination_account_NotValidated", "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789", "source_account" : "source_account_NotValidated" @@ -2522,7 +2525,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "deposit_authorized", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "destination_account" : "destination_account_NotValidated", "ledger_index" : 0, "source_account" : "source_account_NotValidated" @@ -2544,7 +2547,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "download_shard", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "shards" : [ { "index" : 20, @@ -2566,7 +2569,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "download_shard", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "shards" : [ { "index" : 20, @@ -2594,7 +2597,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "download_shard", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "shards" : [ { "index" : 200000000, @@ -2636,7 +2639,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "download_shard", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "shards" : [ { "index" : 2000000, @@ -2695,7 +2698,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "download_shard", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "shards" : [ { "index" : 20, @@ -2767,7 +2770,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "feature", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -2779,7 +2782,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "feature", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "feature" : "featureNameOrHexIsNotValidated" } ] @@ -2795,7 +2798,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "feature", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "feature" : "FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210", "vetoed" : false } @@ -2809,7 +2812,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "feature", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "feature" : "0", "vetoed" : true } @@ -2860,7 +2863,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "fetch_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -2872,7 +2875,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "fetch_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "clear" : true } ] @@ -2899,7 +2902,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "fetch_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "too" : true } ] @@ -2915,7 +2918,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "gateway_balances", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", } ] @@ -2928,7 +2931,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "gateway_balances", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : "890765" } @@ -2942,7 +2945,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "gateway_balances", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : "current" } @@ -2958,7 +2961,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "gateway_balances", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV" } @@ -2974,7 +2977,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "gateway_balances", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "hotwallet" : [ "hotwallet_is_not_validated" ] } @@ -2995,7 +2998,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "gateway_balances", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "hotwallet" : [ "hotwallet_is_not_validated_1", @@ -3100,7 +3103,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "get_counts", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -3112,7 +3115,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "get_counts", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "min_count" : 100 } ] @@ -3159,7 +3162,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "command", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "json_argument" : true, "method" : "command" } @@ -3177,7 +3180,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "command", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "method" : "command" } ] @@ -3262,7 +3265,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "call_1", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "id" : "A1", "jsonrpc" : "2.0", "method" : "call_1", @@ -3290,7 +3293,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "call_1", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "0" : { "inner_arg" : "yup" }, @@ -3314,7 +3317,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "params" : [ [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "id" : "A1", "jsonrpc" : "2.0", "method" : "call_1", @@ -3341,7 +3344,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "params" : [ [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "0" : { "inner_arg" : "yup" }, @@ -3636,7 +3639,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -3648,7 +3651,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 4294967295 } ] @@ -3661,7 +3664,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : "validated" } ] @@ -3675,7 +3678,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789" } ] @@ -3688,7 +3691,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "full" : true, "ledger_index" : "current" } @@ -3702,7 +3705,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "expand" : true, "ledger_index" : "closed", "transactions" : true @@ -3717,7 +3720,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 4294967295 } ] @@ -3730,7 +3733,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 0 } ] @@ -3743,7 +3746,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 0 } ] @@ -3756,7 +3759,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 0 } ] @@ -3769,7 +3772,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : "current" } ] @@ -3785,7 +3788,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_closed", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -3814,7 +3817,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_current", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -3843,7 +3846,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_header", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 4294967295 } ] @@ -3857,7 +3860,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_header", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789" } ] @@ -3900,7 +3903,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_header", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 0 } ] @@ -3913,7 +3916,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_header", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 0 } ] @@ -3926,7 +3929,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_header", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 0 } ] @@ -3942,7 +3945,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_request", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 4294967295 } ] @@ -3956,7 +3959,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_request", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_hash" : "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789" } ] @@ -3999,7 +4002,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_request", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 0 } ] @@ -4012,7 +4015,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_request", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 0 } ] @@ -4025,7 +4028,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ledger_request", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 0 } ] @@ -4043,7 +4046,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "log_level", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -4055,7 +4058,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "log_level", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "severity" : "fatal" } ] @@ -4068,7 +4071,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "log_level", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "severity" : "error" } ] @@ -4081,7 +4084,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "log_level", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "severity" : "warn" } ] @@ -4094,7 +4097,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "log_level", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "severity" : "debug" } ] @@ -4107,7 +4110,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "log_level", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "severity" : "trace" } ] @@ -4120,7 +4123,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "log_level", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "partition" : "base", "severity" : "trace" } @@ -4134,7 +4137,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "log_level", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "partition" : "partition_name", "severity" : "fatal" } @@ -4162,7 +4165,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "log_level", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "severity" : "err" } ] @@ -4179,7 +4182,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "log_level", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "partition" : "fatal", "severity" : "partition_name" } @@ -4198,7 +4201,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "logrotate", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -4227,7 +4230,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "node_to_shard", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "action" : "status" } ] @@ -4240,7 +4243,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "node_to_shard", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "action" : "start" } ] @@ -4253,7 +4256,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "node_to_shard", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "action" : "stop" } ] @@ -4280,7 +4283,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "node_to_shard", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "action" : "invalid" } ] @@ -4296,7 +4299,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "owner_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" } ] @@ -4309,7 +4312,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "owner_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 987654321 } @@ -4323,7 +4326,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "owner_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : "validated" } @@ -4339,7 +4342,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "owner_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_hash" : "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" } @@ -4354,7 +4357,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "params" : [ { "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : "validated" } ] @@ -4425,7 +4428,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "owner_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "ledger_index" : 0 } @@ -4444,7 +4447,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "params" : [ { "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 0 } ] @@ -4463,7 +4466,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "peers", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -4492,7 +4495,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "peer_reservations_add", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "public_key" : "public_key_string" } ] @@ -4505,7 +4508,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "peer_reservations_add", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "description" : "public_key_description", "public_key" : "public_key_string" } @@ -4553,7 +4556,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "peer_reservations_del", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "public_key" : "public_key_string" } ] @@ -4602,7 +4605,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ping", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -4633,7 +4636,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "print", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -4646,7 +4649,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "print", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "params" : [ "extra" ] } ] @@ -4678,7 +4681,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "random", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -4710,7 +4713,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ripple_path_find", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "json_argument" : true } ] @@ -4723,7 +4726,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ripple_path_find", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "json_argument" : true, "ledger_index" : 4294967295 } @@ -4737,7 +4740,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ripple_path_find", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "json_argument" : true, "ledger_index" : "closed" } @@ -4753,7 +4756,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ripple_path_find", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "json_argument" : true, "ledger_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV" } @@ -4815,7 +4818,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ripple_path_find", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "json_argument" : true, "ledger_index" : 0 } @@ -4829,7 +4832,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ripple_path_find", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "json_argument" : true, "ledger_index" : 0 } @@ -4843,7 +4846,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "ripple_path_find", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "json_argument" : true, "ledger_index" : 0 } @@ -4864,7 +4867,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "sign", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "secret" : "my_secret", "tx_json" : { "json_argument" : true @@ -4880,7 +4883,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "sign", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "offline" : true, "secret" : "my_secret", "tx_json" : { @@ -4965,7 +4968,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "sign_for", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "secret" : "my_secret", "tx_json" : { @@ -4986,7 +4989,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "sign_for", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "offline" : true, "secret" : "my_secret", @@ -5081,7 +5084,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "submit", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "tx_blob" : "the blob is unvalidated and may be any length..." } ] @@ -5098,7 +5101,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "submit", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "secret" : "my_secret", "tx_json" : { "json_argument" : true @@ -5131,7 +5134,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "submit", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "offline" : true, "secret" : "my_secret", "tx_json" : { @@ -5200,7 +5203,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "submit_multisigned", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "tx_json" : { "json_argument" : true } @@ -5268,7 +5271,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "server_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -5280,7 +5283,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "server_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "counters" : true } ] @@ -5307,7 +5310,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "server_info", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -5324,7 +5327,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "server_state", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -5336,7 +5339,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "server_state", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "counters" : true } ] @@ -5363,7 +5366,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "server_state", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -5380,7 +5383,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "stop", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -5411,7 +5414,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "transaction_entry", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : 4294967295, "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV" } @@ -5427,7 +5430,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "transaction_entry", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_index" : "current", "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV" } @@ -5443,7 +5446,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "transaction_entry", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ledger_hash" : "VUTSRQPONMLKJIHGFEDCBA9876543210VUTSRQPONMLKJIHGFEDCBA9876543210", "tx_hash" : "0123456789ABCDEFGHIJKLMNOPQRSTUV0123456789ABCDEFGHIJKLMNOPQRSTUV" } @@ -5602,7 +5605,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "ctid" : "FFFFFFFFFFFFFFFF", "max_ledger" : "2", "min_ledger" : "1" @@ -5617,7 +5620,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "binary" : true, "ctid" : "FFFFFFFFFFFFFFFF", "max_ledger" : "2", @@ -5633,7 +5636,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "transaction" : "transaction_hash_is_not_validated" } ] @@ -5646,7 +5649,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "binary" : true, "transaction" : "transaction_hash_is_not_validated" } @@ -5690,7 +5693,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "tx", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "transaction" : "transaction_hash_is_not_validated" } ] @@ -5706,7 +5709,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "tx_history", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "start" : 0 } ] @@ -5778,7 +5781,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "unl_list", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -5809,7 +5812,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "validation_create", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -5821,7 +5824,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "validation_create", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "secret" : "the form of the secret is not validated" } ] @@ -5853,7 +5856,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "version", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -5884,7 +5887,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "wallet_propose", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -5896,7 +5899,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "wallet_propose", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "passphrase" : "the form of the passphrase is not validated" } ] @@ -5926,7 +5929,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "internal", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "internal_command" : "command_name", "params" : [] } @@ -5946,7 +5949,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "internal", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "internal_command" : "command_name", "params" : [ "string_arg", "1", "-1", "4294967296", "3.14159" ] } @@ -6080,7 +6083,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "unknown_command", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, } ] })"}, @@ -6092,7 +6095,7 @@ static RPCCallTestData const rpcCallTestArray[] = { "method" : "unknown_command", "params" : [ { - "api_version" : %MAX_API_VER%, + "api_version" : %API_VER%, "params" : [ "string_arg", "1", "-1", "4294967296", "3.14159" ] } ] @@ -6100,11 +6103,10 @@ static RPCCallTestData const rpcCallTestArray[] = { }; std::string -updateAPIVersionString(const char* const req) +updateAPIVersionString(const char* const req, unsigned apiVersion) { - static std::string version_str = - std::to_string(RPC::apiMaximumSupportedVersion); - static auto place_holder = "%MAX_API_VER%"; + std::string const version_str = std::to_string(apiVersion); + static auto place_holder = "%API_VER%"; std::string jr(req); boost::replace_all(jr, place_holder, version_str); return jr; @@ -6124,9 +6126,9 @@ class RPCCall_test : public beast::unit_test::suite { public: void - testRPCCall() + testRPCCall(unsigned apiVersion) { - testcase << "RPCCall"; + testcase << "RPCCall API version " << apiVersion; test::jtx::Env env( *this, makeNetworkConfig(11111)); // Used only for its Journal. @@ -6136,19 +6138,20 @@ class RPCCall_test : public beast::unit_test::suite { std::vector const args{ rpcCallTest.args.begin(), rpcCallTest.args.end()}; + const char* const expVersioned = + apiVersion == 1 ? rpcCallTest.expV1 : rpcCallTest.expV2; // Note that, over the long term, none of these tests should // throw. But, for the moment, some of them do. So handle it. Json::Value got; try { - got = jtx::cmdToJSONRPC( - args, env.journal, RPC::apiMaximumSupportedVersion); + got = jtx::cmdToJSONRPC(args, env.journal, apiVersion); } catch (std::bad_cast const&) { if ((rpcCallTest.throwsWhat == RPCCallTestData::bad_cast) && - (std::strlen(rpcCallTest.exp) == 0)) + (std::strlen(expVersioned) == 0)) { pass(); } @@ -6161,7 +6164,8 @@ class RPCCall_test : public beast::unit_test::suite } Json::Value exp; - Json::Reader{}.parse(updateAPIVersionString(rpcCallTest.exp), exp); + Json::Reader{}.parse( + updateAPIVersionString(expVersioned, apiVersion), exp); // Lambda to remove the "params[0u]:error_code" field if present. // Error codes are not expected to be stable between releases. @@ -6192,7 +6196,8 @@ class RPCCall_test : public beast::unit_test::suite void run() override { - testRPCCall(); + test::jtx::forAllApiVersions( + std::bind_front(&RPCCall_test::testRPCCall, this)); } };