Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek committed Nov 7, 2023
1 parent f2619cb commit bdb123d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/ripple/net/impl/RPCCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
3 changes: 2 additions & 1 deletion src/ripple/rpc/impl/RPCHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions src/test/jtx/Env.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ class Env
*/
template <class... Args>
Json::Value
rpc(std::unordered_map<std::string, std::string> const& headers,
unsigned apiVersion,
rpc(unsigned apiVersion,
std::unordered_map<std::string, std::string> const& headers,
std::string const& cmd,
Args&&... args);

Expand Down Expand Up @@ -666,8 +666,8 @@ class Env

Json::Value
do_rpc(
std::vector<std::string> const& args,
unsigned apiVersion,
std::vector<std::string> const& args,
std::unordered_map<std::string, std::string> const& headers = {});

void
Expand Down Expand Up @@ -710,14 +710,14 @@ class Env
template <class... Args>
Json::Value
Env::rpc(
std::unordered_map<std::string, std::string> const& headers,
unsigned apiVersion,
std::unordered_map<std::string, std::string> const& headers,
std::string const& cmd,
Args&&... args)
{
return do_rpc(
std::vector<std::string>{cmd, std::forward<Args>(args)...},
apiVersion,
std::vector<std::string>{cmd, std::forward<Args>(args)...},
headers);
}

Expand All @@ -726,8 +726,8 @@ Json::Value
Env::rpc(unsigned apiVersion, std::string const& cmd, Args&&... args)
{
return rpc(
std::unordered_map<std::string, std::string>(),
apiVersion,
std::unordered_map<std::string, std::string>(),
cmd,
std::forward<Args>(args)...);
}
Expand All @@ -740,8 +740,8 @@ Env::rpc(
Args&&... args)
{
return do_rpc(
RPC::apiCommandLineVersion,
std::vector<std::string>{cmd, std::forward<Args>(args)...},
RPC::apiMinimumSupportedVersion,
headers);
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/jtx/impl/Env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ Env::st(JTx const& jt)

Json::Value
Env::do_rpc(
std::vector<std::string> const& args,
unsigned apiVersion,
std::vector<std::string> const& args,
std::unordered_map<std::string, std::string> const& headers)
{
return rpcClient(args, app().config(), app().logs(), apiVersion, headers)
Expand Down
1 change: 0 additions & 1 deletion src/test/rpc/LedgerRequestRPC_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <ripple/protocol/jss.h>
#include <ripple/rpc/impl/RPCHelpers.h>
#include <test/jtx.h>
#include <test/jtx/Env.h>

#include <functional>

Expand Down

0 comments on commit bdb123d

Please sign in to comment.