mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 06:55:50 +00:00
fix tx_history
This commit is contained in:
@@ -5616,24 +5616,51 @@ static RPCCallTestData const rpcCallTestArray[] = {
|
|||||||
"tx_history: start too small.",
|
"tx_history: start too small.",
|
||||||
__LINE__,
|
__LINE__,
|
||||||
{"tx_history", "-1"},
|
{"tx_history", "-1"},
|
||||||
RPCCallTestData::bad_cast,
|
RPCCallTestData::no_exception,
|
||||||
R"()",
|
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.
|
// Note: this really shouldn't throw, but does at the moment.
|
||||||
"tx_history: start too big.",
|
"tx_history: start too big.",
|
||||||
__LINE__,
|
__LINE__,
|
||||||
{"tx_history", "4294967296"},
|
{"tx_history", "4294967296"},
|
||||||
RPCCallTestData::bad_cast,
|
RPCCallTestData::no_exception,
|
||||||
R"()",
|
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.
|
// Note: this really shouldn't throw, but does at the moment.
|
||||||
"tx_history: start not integer.",
|
"tx_history: start not integer.",
|
||||||
__LINE__,
|
__LINE__,
|
||||||
{"tx_history", "beginning"},
|
{"tx_history", "beginning"},
|
||||||
RPCCallTestData::bad_cast,
|
RPCCallTestData::no_exception,
|
||||||
R"()",
|
R"({
|
||||||
|
"method" : "tx_history",
|
||||||
|
"params" : [
|
||||||
|
{
|
||||||
|
"error" : "invalidParams",
|
||||||
|
"error_code" : 31,
|
||||||
|
"error_message" : "Invalid field 'start'."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})",
|
||||||
},
|
},
|
||||||
|
|
||||||
// unl_list
|
// unl_list
|
||||||
|
|||||||
@@ -1163,7 +1163,10 @@ private:
|
|||||||
{
|
{
|
||||||
Json::Value jvRequest{Json::objectValue};
|
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;
|
return jvRequest;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user