mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-22 03:55:53 +00:00
Add support for strict to CLI for account_info.
This commit is contained in:
@@ -437,7 +437,18 @@ Json::Value RPCParser::parseAccountLines(const Json::Value& jvParams)
|
|||||||
Json::Value RPCParser::parseAccountRaw(const Json::Value& jvParams, bool bPeer)
|
Json::Value RPCParser::parseAccountRaw(const Json::Value& jvParams, bool bPeer)
|
||||||
{
|
{
|
||||||
std::string strIdent = jvParams[0u].asString();
|
std::string strIdent = jvParams[0u].asString();
|
||||||
std::string strPeer = bPeer && jvParams.size() >= 2 ? jvParams[1u].asString() : "";
|
unsigned int iCursor = jvParams.size();
|
||||||
|
bool bStrict = false;
|
||||||
|
std::string strPeer;
|
||||||
|
|
||||||
|
if (!bPeer && iCursor >= 2 && jvParams[iCursor-1] == "strict")
|
||||||
|
{
|
||||||
|
bStrict = true;
|
||||||
|
--iCursor;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bPeer && iCursor >= 2)
|
||||||
|
strPeer = jvParams[iCursor].asString();
|
||||||
|
|
||||||
int iIndex = 0;
|
int iIndex = 0;
|
||||||
// int iIndex = jvParams.size() >= 2 ? lexical_cast_s<int>(jvParams[1u].asString()) : 0;
|
// int iIndex = jvParams.size() >= 2 ? lexical_cast_s<int>(jvParams[1u].asString()) : 0;
|
||||||
@@ -452,6 +463,9 @@ Json::Value RPCParser::parseAccountRaw(const Json::Value& jvParams, bool bPeer)
|
|||||||
|
|
||||||
jvRequest["account"] = strIdent;
|
jvRequest["account"] = strIdent;
|
||||||
|
|
||||||
|
if (bStrict)
|
||||||
|
jvRequest["strict"] = 1;
|
||||||
|
|
||||||
if (iIndex)
|
if (iIndex)
|
||||||
jvRequest["account_index"] = iIndex;
|
jvRequest["account_index"] = iIndex;
|
||||||
|
|
||||||
@@ -465,7 +479,7 @@ Json::Value RPCParser::parseAccountRaw(const Json::Value& jvParams, bool bPeer)
|
|||||||
jvRequest["peer"] = strPeer;
|
jvRequest["peer"] = strPeer;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jvParams.size() == (2+bPeer) && !jvParseLedger(jvRequest, jvParams[1u+bPeer].asString()))
|
if (iCursor == (2+bPeer) && !jvParseLedger(jvRequest, jvParams[1u+bPeer].asString()))
|
||||||
return rpcError(rpcLGR_IDX_MALFORMED);
|
return rpcError(rpcLGR_IDX_MALFORMED);
|
||||||
|
|
||||||
return jvRequest;
|
return jvRequest;
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ void printHelp(const po::options_description& desc)
|
|||||||
cerr << desc << endl;
|
cerr << desc << endl;
|
||||||
|
|
||||||
cerr << "Commands: " << endl;
|
cerr << "Commands: " << endl;
|
||||||
cerr << " account_info <account>|<nickname>|<seed>|<pass_phrase>|<key> [<ledger>]" << endl;
|
cerr << " account_info <account>|<nickname>|<seed>|<pass_phrase>|<key> [<ledger>] [strict]" << endl;
|
||||||
cerr << " account_lines <account> <account>|\"\" [<ledger>]" << endl;
|
cerr << " account_lines <account> <account>|\"\" [<ledger>]" << endl;
|
||||||
cerr << " account_offers <account>|<nickname>|<account_public_key> [<ledger>]" << endl;
|
cerr << " account_offers <account>|<nickname>|<account_public_key> [<ledger>]" << endl;
|
||||||
cerr << " account_tx accountID [ledger_min [ledger_max [limit [offset]]]] [binary] [count] [descending]" << endl;
|
cerr << " account_tx accountID [ledger_min [ledger_max [limit [offset]]]] [binary] [count] [descending]" << endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user