mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add test for feature RPC (RIPD-1391):
Create unit test for feature RPC method. Add client_error field to env RPC requests to provide information about parsing errors.
This commit is contained in:
committed by
Nik Bougalis
parent
aea54b7230
commit
7b82051bdb
@@ -517,13 +517,23 @@ Env::do_rpc(std::vector<std::string> const& args)
|
||||
jv[jss::ripplerpc] = "2.0";
|
||||
jv[jss::id] = 5;
|
||||
}
|
||||
auto response = client().invoke(jv[jss::method].asString(), jv[jss::params][0U]);
|
||||
auto response = client().invoke(
|
||||
jv[jss::method].asString(),
|
||||
jv[jss::params][0U]);
|
||||
|
||||
if (jv.isMember(jss::jsonrpc))
|
||||
{
|
||||
response[jss::jsonrpc] = jv[jss::jsonrpc];
|
||||
response[jss::ripplerpc] = jv[jss::ripplerpc];
|
||||
response[jss::id] = jv[jss::id];
|
||||
}
|
||||
|
||||
if (jv[jss::params][0u].isMember(jss::error) &&
|
||||
(! response.isMember(jss::error)))
|
||||
{
|
||||
response["client_error"] = jv[jss::params][0u];
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user