Skip to content

Commit 1577d88

Browse files
committed
Remove tx_history in API v2
1 parent d905a55 commit 1577d88

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/ripple/rpc/impl/Handler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Handler const handlerArray[]{
152152
{"stop", byRef(&doStop), Role::ADMIN, NO_CONDITION},
153153
{"transaction_entry", byRef(&doTransactionEntry), Role::USER, NO_CONDITION},
154154
{"tx", byRef(&doTxJson), Role::USER, NEEDS_NETWORK_CONNECTION},
155-
{"tx_history", byRef(&doTxHistory), Role::USER, NO_CONDITION},
155+
{"tx_history", byRef(&doTxHistory), Role::USER, NO_CONDITION, 1, 1},
156156
{"tx_reduce_relay", byRef(&doTxReduceRelay), Role::USER, NO_CONDITION},
157157
{"unl_list", byRef(&doUnlList), Role::ADMIN, NO_CONDITION},
158158
{"validation_create",

src/test/rpc/TransactionHistory_test.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@ class TransactionHistory_test : public beast::unit_test::suite
5454
}
5555
}
5656

57+
void
58+
testCommandRetired()
59+
{
60+
testcase("Command retired from API v2");
61+
using namespace test::jtx;
62+
Env env{*this, envconfig(no_admin)};
63+
64+
Json::Value params{Json::objectValue};
65+
params[jss::api_version] = 2;
66+
auto const result =
67+
env.client().invoke("tx_history", params)[jss::result];
68+
std::cout << result << '\n';
69+
BEAST_EXPECT(result[jss::error] == "unknownCmd");
70+
BEAST_EXPECT(result[jss::status] == "error");
71+
}
72+
5773
void
5874
testRequest()
5975
{
@@ -148,6 +164,7 @@ class TransactionHistory_test : public beast::unit_test::suite
148164
{
149165
testBadInput();
150166
testRequest();
167+
testCommandRetired();
151168
}
152169
};
153170

0 commit comments

Comments
 (0)