From bdb123db8c3eb0854c322e8f01af28891373d299 Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Tue, 7 Nov 2023 00:24:40 +0000 Subject: [PATCH] Minor fixes --- src/ripple/net/impl/RPCCall.cpp | 2 +- src/ripple/rpc/impl/RPCHelpers.h | 3 ++- src/test/jtx/Env.h | 14 +++++++------- src/test/jtx/impl/Env.cpp | 2 +- src/test/rpc/LedgerRequestRPC_test.cpp | 1 - 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ripple/net/impl/RPCCall.cpp b/src/ripple/net/impl/RPCCall.cpp index 37a89656762..4e3e6c09fc4 100644 --- a/src/ripple/net/impl/RPCCall.cpp +++ b/src/ripple/net/impl/RPCCall.cpp @@ -1603,7 +1603,7 @@ fromCommandLine( Logs& logs) { auto const result = - rpcClient(vCmd, config, logs, RPC::apiMinimumSupportedVersion); + rpcClient(vCmd, config, logs, RPC::apiCommandLineVersion); std::cout << result.second.toStyledString(); diff --git a/src/ripple/rpc/impl/RPCHelpers.h b/src/ripple/rpc/impl/RPCHelpers.h index 7d0c9cc65ea..2e0f45b5148 100644 --- a/src/ripple/rpc/impl/RPCHelpers.h +++ b/src/ripple/rpc/impl/RPCHelpers.h @@ -241,7 +241,8 @@ constexpr unsigned int apiInvalidVersion = 0; constexpr unsigned int apiVersionIfUnspecified = 1; constexpr unsigned int apiMinimumSupportedVersion = 1; constexpr unsigned int apiMaximumSupportedVersion = 2; -constexpr unsigned int apiBetaVersion = 2; +constexpr unsigned int apiCommandLineVersion = 1; // TODO Bump to 2 later +constexpr unsigned int apiBetaVersion = 3; constexpr unsigned int apiMaximumValidVersion = apiBetaVersion; static_assert(apiMinimumSupportedVersion >= apiVersionIfUnspecified); diff --git a/src/test/jtx/Env.h b/src/test/jtx/Env.h index 383c116abfc..6a55f2f9141 100644 --- a/src/test/jtx/Env.h +++ b/src/test/jtx/Env.h @@ -281,8 +281,8 @@ class Env */ template Json::Value - rpc(std::unordered_map const& headers, - unsigned apiVersion, + rpc(unsigned apiVersion, + std::unordered_map const& headers, std::string const& cmd, Args&&... args); @@ -666,8 +666,8 @@ class Env Json::Value do_rpc( - std::vector const& args, unsigned apiVersion, + std::vector const& args, std::unordered_map const& headers = {}); void @@ -710,14 +710,14 @@ class Env template Json::Value Env::rpc( - std::unordered_map const& headers, unsigned apiVersion, + std::unordered_map const& headers, std::string const& cmd, Args&&... args) { return do_rpc( - std::vector{cmd, std::forward(args)...}, apiVersion, + std::vector{cmd, std::forward(args)...}, headers); } @@ -726,8 +726,8 @@ Json::Value Env::rpc(unsigned apiVersion, std::string const& cmd, Args&&... args) { return rpc( - std::unordered_map(), apiVersion, + std::unordered_map(), cmd, std::forward(args)...); } @@ -740,8 +740,8 @@ Env::rpc( Args&&... args) { return do_rpc( + RPC::apiCommandLineVersion, std::vector{cmd, std::forward(args)...}, - RPC::apiMinimumSupportedVersion, headers); } diff --git a/src/test/jtx/impl/Env.cpp b/src/test/jtx/impl/Env.cpp index 67f9dc2eaa1..e82183c0001 100644 --- a/src/test/jtx/impl/Env.cpp +++ b/src/test/jtx/impl/Env.cpp @@ -460,8 +460,8 @@ Env::st(JTx const& jt) Json::Value Env::do_rpc( - std::vector const& args, unsigned apiVersion, + std::vector const& args, std::unordered_map const& headers) { return rpcClient(args, app().config(), app().logs(), apiVersion, headers) diff --git a/src/test/rpc/LedgerRequestRPC_test.cpp b/src/test/rpc/LedgerRequestRPC_test.cpp index 6d14eee212a..a1f3daafb30 100644 --- a/src/test/rpc/LedgerRequestRPC_test.cpp +++ b/src/test/rpc/LedgerRequestRPC_test.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include