mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Improved error message on mistyped command [RIPD-1527]:
Previously if you mistyped the "submit_multisigned" command as "submit_multisign", the returned message was "Internal error". Not very helpful. It turns out this was caused by a small amount of code in RPCCall.cpp. Removing that code improves two situations: 1. It improves the situation with a mistyped command. Now the command returns "Unknown method" and provides the string of the mistyped command. 2. The "transaction_entry", if properly entered in its command line form, would fire an assert. That assert is now removed. In the process, it was discovered that the command line form of the "transaction_entry" command has not worked correctly for at least a year. Therefore support for that the command line form of "transaction_entry" is added along with appropriate unit tests.
This commit is contained in:
@@ -1840,6 +1840,17 @@ R"({
|
||||
class JSONRPC_test : public beast::unit_test::suite
|
||||
{
|
||||
public:
|
||||
void testBadRpcCommand ()
|
||||
{
|
||||
test::jtx::Env env(*this);
|
||||
Json::Value const result {
|
||||
env.rpc ("bad_command", R"({"MakingThisUp": 0})")};
|
||||
|
||||
BEAST_EXPECT (result[jss::result][jss::error] == "unknownCmd");
|
||||
BEAST_EXPECT (
|
||||
result[jss::result][jss::request][jss::command] == "bad_command");
|
||||
}
|
||||
|
||||
void testAutoFillFees ()
|
||||
{
|
||||
test::jtx::Env env(*this);
|
||||
@@ -2345,6 +2356,7 @@ public:
|
||||
|
||||
void run ()
|
||||
{
|
||||
testBadRpcCommand ();
|
||||
testAutoFillFees ();
|
||||
testAutoFillEscalatedFees ();
|
||||
testTransactionRPC ();
|
||||
|
||||
Reference in New Issue
Block a user