mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Change order of checks in amm_info: (#4924)
* Change order of checks in amm_info * Change amm_info error message in API version 3 * Change amm_info error tests
This commit is contained in:
@@ -163,7 +163,8 @@ AMM::ammRpcInfo(
|
||||
std::optional<Issue> issue1,
|
||||
std::optional<Issue> issue2,
|
||||
std::optional<AccountID> const& ammAccount,
|
||||
bool ignoreParams) const
|
||||
bool ignoreParams,
|
||||
unsigned apiVersion) const
|
||||
{
|
||||
Json::Value jv;
|
||||
if (account)
|
||||
@@ -191,7 +192,10 @@ AMM::ammRpcInfo(
|
||||
if (ammAccount)
|
||||
jv[jss::amm_account] = to_string(*ammAccount);
|
||||
}
|
||||
auto jr = env_.rpc("json", "amm_info", to_string(jv));
|
||||
auto jr =
|
||||
(apiVersion == RPC::apiInvalidVersion
|
||||
? env_.rpc("json", "amm_info", to_string(jv))
|
||||
: env_.rpc(apiVersion, "json", "amm_info", to_string(jv)));
|
||||
if (jr.isObject() && jr.isMember(jss::result) &&
|
||||
jr[jss::result].isMember(jss::status))
|
||||
return jr[jss::result];
|
||||
|
||||
Reference in New Issue
Block a user