mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Promote API version 2 to supported (#4803)
* Promote API version 2 to supported * Switch command line to API version 1 * Fix LedgerRequestRPC test * Remove obsolete tx_account method This method is not implemented, the only parts which are removed are related to command-line parsing * Fix RPCCall test * Reduce diff size, small test improvements * Minor fixes * Support for the mold linker * [fold] handle case where both mold and gold are installed * [fold] Use first non-default linker * Fix TransactionEntry_test * Fix AccountTx_test --------- Co-authored-by: seelabs <scott.determan@yahoo.com>
This commit is contained in:
@@ -137,6 +137,7 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
j[jss::result][jss::transactions][1u][jss::tx]
|
||||
[jss::DeliverMax]);
|
||||
case 2:
|
||||
case 3:
|
||||
if (j.isMember(jss::result) &&
|
||||
(j[jss::result][jss::status] == "success") &&
|
||||
(j[jss::result][jss::transactions].size() == 2) &&
|
||||
@@ -198,20 +199,22 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
rpcACT_MALFORMED));
|
||||
|
||||
jParms[jss::account] = A1.human();
|
||||
BEAST_EXPECT(hasTxs(env.rpc("json", "account_tx", to_string(jParms))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(jParms))));
|
||||
|
||||
// Ledger min/max index
|
||||
{
|
||||
Json::Value p{jParms};
|
||||
p[jss::ledger_index_min] = -1;
|
||||
p[jss::ledger_index_max] = -1;
|
||||
BEAST_EXPECT(hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
|
||||
p[jss::ledger_index_min] = 0;
|
||||
p[jss::ledger_index_max] = 100;
|
||||
if (apiVersion < 2u)
|
||||
BEAST_EXPECT(
|
||||
hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
else
|
||||
BEAST_EXPECT(isErr(
|
||||
env.rpc("json", "account_tx", to_string(p)),
|
||||
@@ -238,12 +241,13 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
{
|
||||
Json::Value p{jParms};
|
||||
p[jss::ledger_index_min] = -1;
|
||||
BEAST_EXPECT(hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
|
||||
p[jss::ledger_index_min] = 1;
|
||||
if (apiVersion < 2u)
|
||||
BEAST_EXPECT(
|
||||
hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
else
|
||||
BEAST_EXPECT(isErr(
|
||||
env.rpc("json", "account_tx", to_string(p)),
|
||||
@@ -260,22 +264,25 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
{
|
||||
Json::Value p{jParms};
|
||||
p[jss::ledger_index_max] = -1;
|
||||
BEAST_EXPECT(hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
|
||||
p[jss::ledger_index_max] = env.current()->info().seq;
|
||||
if (apiVersion < 2u)
|
||||
BEAST_EXPECT(
|
||||
hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
else
|
||||
BEAST_EXPECT(isErr(
|
||||
env.rpc("json", "account_tx", to_string(p)),
|
||||
rpcLGR_IDX_MALFORMED));
|
||||
|
||||
p[jss::ledger_index_max] = 3;
|
||||
BEAST_EXPECT(hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
|
||||
p[jss::ledger_index_max] = env.closed()->info().seq;
|
||||
BEAST_EXPECT(hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
|
||||
p[jss::ledger_index_max] = env.closed()->info().seq - 1;
|
||||
BEAST_EXPECT(noTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
@@ -286,7 +293,8 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
Json::Value p{jParms};
|
||||
|
||||
p[jss::ledger_index] = env.closed()->info().seq;
|
||||
BEAST_EXPECT(hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
|
||||
p[jss::ledger_index] = env.closed()->info().seq - 1;
|
||||
BEAST_EXPECT(noTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
@@ -306,7 +314,8 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
Json::Value p{jParms};
|
||||
|
||||
p[jss::ledger_hash] = to_string(env.closed()->info().hash);
|
||||
BEAST_EXPECT(hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
|
||||
p[jss::ledger_hash] = to_string(env.closed()->info().parentHash);
|
||||
BEAST_EXPECT(noTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
@@ -324,8 +333,8 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
p[jss::ledger_index] = -1;
|
||||
|
||||
if (apiVersion < 2u)
|
||||
BEAST_EXPECT(
|
||||
hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
else
|
||||
BEAST_EXPECT(isErr(
|
||||
env.rpc("json", "account_tx", to_string(p)),
|
||||
@@ -337,8 +346,8 @@ class AccountTx_test : public beast::unit_test::suite
|
||||
Json::Value p{jParms};
|
||||
p[jss::ledger_index_max] = env.current()->info().seq;
|
||||
if (apiVersion < 2u)
|
||||
BEAST_EXPECT(
|
||||
hasTxs(env.rpc("json", "account_tx", to_string(p))));
|
||||
BEAST_EXPECT(hasTxs(
|
||||
env.rpc(apiVersion, "json", "account_tx", to_string(p))));
|
||||
else
|
||||
BEAST_EXPECT(isErr(
|
||||
env.rpc("json", "account_tx", to_string(p)),
|
||||
|
||||
Reference in New Issue
Block a user