mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
fix: Error message for ledger_entry rpc (#5344)
Changes the error to `malformedAddress` for `permissioned_domain` in the `ledger_entry` rpc, when the account is not a string. This change makes it more clear to a user what is wrong with their request.
This commit is contained in:
@@ -3189,7 +3189,18 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
params[jss::permissioned_domain][jss::account] = 1;
|
||||
params[jss::permissioned_domain][jss::seq] = seq;
|
||||
auto const jrr = env.rpc("json", "ledger_entry", to_string(params));
|
||||
checkErrorValue(jrr[jss::result], "malformedRequest", "");
|
||||
checkErrorValue(jrr[jss::result], "malformedAddress", "");
|
||||
}
|
||||
|
||||
{
|
||||
// Fail, account is an object
|
||||
Json::Value params;
|
||||
params[jss::ledger_index] = jss::validated;
|
||||
params[jss::permissioned_domain][jss::account] =
|
||||
Json::Value{Json::ValueType::objectValue};
|
||||
params[jss::permissioned_domain][jss::seq] = seq;
|
||||
auto const jrr = env.rpc("json", "ledger_entry", to_string(params));
|
||||
checkErrorValue(jrr[jss::result], "malformedAddress", "");
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user