mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 14:35:52 +00:00
fix tx_history
This commit is contained in:
@@ -5616,24 +5616,51 @@ static RPCCallTestData const rpcCallTestArray[] = {
|
||||
"tx_history: start too small.",
|
||||
__LINE__,
|
||||
{"tx_history", "-1"},
|
||||
RPCCallTestData::bad_cast,
|
||||
R"()",
|
||||
RPCCallTestData::no_exception,
|
||||
R"({
|
||||
"method" : "tx_history",
|
||||
"params" : [
|
||||
{
|
||||
"error" : "invalidParams",
|
||||
"error_code" : 31,
|
||||
"error_message" : "Invalid field 'start'."
|
||||
}
|
||||
]
|
||||
})",
|
||||
},
|
||||
{
|
||||
// Note: this really shouldn't throw, but does at the moment.
|
||||
"tx_history: start too big.",
|
||||
__LINE__,
|
||||
{"tx_history", "4294967296"},
|
||||
RPCCallTestData::bad_cast,
|
||||
R"()",
|
||||
RPCCallTestData::no_exception,
|
||||
R"({
|
||||
"method" : "tx_history",
|
||||
"params" : [
|
||||
{
|
||||
"error" : "invalidParams",
|
||||
"error_code" : 31,
|
||||
"error_message" : "Invalid field 'start'."
|
||||
}
|
||||
]
|
||||
})",
|
||||
},
|
||||
{
|
||||
// Note: this really shouldn't throw, but does at the moment.
|
||||
"tx_history: start not integer.",
|
||||
__LINE__,
|
||||
{"tx_history", "beginning"},
|
||||
RPCCallTestData::bad_cast,
|
||||
R"()",
|
||||
RPCCallTestData::no_exception,
|
||||
R"({
|
||||
"method" : "tx_history",
|
||||
"params" : [
|
||||
{
|
||||
"error" : "invalidParams",
|
||||
"error_code" : 31,
|
||||
"error_message" : "Invalid field 'start'."
|
||||
}
|
||||
]
|
||||
})",
|
||||
},
|
||||
|
||||
// unl_list
|
||||
|
||||
@@ -1163,7 +1163,10 @@ private:
|
||||
{
|
||||
Json::Value jvRequest{Json::objectValue};
|
||||
|
||||
jvRequest[jss::start] = jvParams[0u].asUInt();
|
||||
if (auto const start = jvParseUInt(jvParams[0u]))
|
||||
jvRequest[jss::start] = *start;
|
||||
else
|
||||
return RPC::invalid_field_error(jss::start);
|
||||
|
||||
return jvRequest;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user