mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 05:25:55 +00:00
Change RPCs to use account instead of ident.
This commit is contained in:
@@ -559,7 +559,7 @@ Json::Value RPCHandler::accountFromString(Ledger::ref lrLedger, RippleAddress& n
|
||||
}
|
||||
|
||||
// {
|
||||
// ident : <indent>,
|
||||
// account: <indent>,
|
||||
// account_index : <index> // optional
|
||||
// strict: <bool> // true, only allow public keys and addresses. false, default.
|
||||
// ledger_hash : <ledger>
|
||||
@@ -573,10 +573,10 @@ Json::Value RPCHandler::doAccountInfo(Json::Value jvRequest)
|
||||
if (!lpLedger)
|
||||
return jvResult;
|
||||
|
||||
if (!jvRequest.isMember("ident"))
|
||||
if (!jvRequest.isMember("account") && !jvRequest.isMember("ident"))
|
||||
return rpcError(rpcINVALID_PARAMS);
|
||||
|
||||
std::string strIdent = jvRequest["ident"].asString();
|
||||
std::string strIdent = jvRequest.isMember("account") ? jvRequest["account"].asString() : jvRequest["ident"].asString();
|
||||
bool bIndex;
|
||||
int iIndex = jvRequest.isMember("account_index") ? jvRequest["account_index"].asUInt() : 0;
|
||||
bool bStrict = jvRequest.isMember("strict") && jvRequest["strict"].asBool();
|
||||
@@ -742,10 +742,10 @@ Json::Value RPCHandler::doNicknameInfo(Json::Value params)
|
||||
// XXX This would be better if it took the ledger.
|
||||
Json::Value RPCHandler::doOwnerInfo(Json::Value jvRequest)
|
||||
{
|
||||
if (!jvRequest.isMember("ident"))
|
||||
if (!jvRequest.isMember("account") && !jvRequest.isMember("ident"))
|
||||
return rpcError(rpcINVALID_PARAMS);
|
||||
|
||||
std::string strIdent = jvRequest["ident"].asString();
|
||||
std::string strIdent = jvRequest.isMember("account") ? jvRequest["account"].asString() : jvRequest["ident"].asString();
|
||||
bool bIndex;
|
||||
int iIndex = jvRequest.isMember("account_index") ? jvRequest["account_index"].asUInt() : 0;
|
||||
RippleAddress raAccount;
|
||||
|
||||
@@ -890,7 +890,8 @@ Remote.prototype.request_tx = function (hash) {
|
||||
Remote.prototype.request_account_info = function (accountID) {
|
||||
var request = new Request(this, 'account_info');
|
||||
|
||||
request.message.ident = UInt160.json_rewrite(accountID);
|
||||
request.message.ident = UInt160.json_rewrite(accountID); // DEPRECATED
|
||||
request.message.account = UInt160.json_rewrite(accountID);
|
||||
|
||||
return request;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user