Skip to content

Commit

Permalink
Remove tx_history in API v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek committed Oct 13, 2023
1 parent 0ecbda5 commit 981c606
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ripple/rpc/impl/Handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Handler const handlerArray[]{
{"stop", byRef(&doStop), Role::ADMIN, NO_CONDITION},
{"transaction_entry", byRef(&doTransactionEntry), Role::USER, NO_CONDITION},
{"tx", byRef(&doTxJson), Role::USER, NEEDS_NETWORK_CONNECTION},
{"tx_history", byRef(&doTxHistory), Role::USER, NO_CONDITION},
{"tx_history", byRef(&doTxHistory), Role::USER, NO_CONDITION, 1, 1},
{"tx_reduce_relay", byRef(&doTxReduceRelay), Role::USER, NO_CONDITION},
{"unl_list", byRef(&doUnlList), Role::ADMIN, NO_CONDITION},
{"validation_create",
Expand Down
16 changes: 16 additions & 0 deletions src/test/rpc/TransactionHistory_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ class TransactionHistory_test : public beast::unit_test::suite
}
}

void
testCommandRetired()
{
testcase("Command retired from API v2");
using namespace test::jtx;
Env env{*this, envconfig(no_admin)};

Json::Value params{Json::objectValue};
params[jss::api_version] = 2;
auto const result =
env.client().invoke("tx_history", params)[jss::result];
BEAST_EXPECT(result[jss::error] == "unknownCmd");
BEAST_EXPECT(result[jss::status] == "error");
}

void
testRequest()
{
Expand Down Expand Up @@ -148,6 +163,7 @@ class TransactionHistory_test : public beast::unit_test::suite
{
testBadInput();
testRequest();
testCommandRetired();
}
};

Expand Down

0 comments on commit 981c606

Please sign in to comment.