mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
Finish moving Json code.
This commit is contained in:
@@ -204,14 +204,8 @@ Json::Value RPCServer::doAccountInfo(Json::Value ¶ms)
|
|||||||
LocalAccount::pointer account=theApp->getWallet().parseAccount(acct);
|
LocalAccount::pointer account=theApp->getWallet().parseAccount(acct);
|
||||||
if(!account)
|
if(!account)
|
||||||
return JSONRPCError(500, "Account not found");
|
return JSONRPCError(500, "Account not found");
|
||||||
|
|
||||||
Json::Value ret(Json::objectValue);
|
return account->getJson();
|
||||||
ret["Family"]=account->getFamilyName();
|
|
||||||
ret["ShortName"]=account->getShortName();
|
|
||||||
ret["FullName"]=account->getFullName();
|
|
||||||
ret["AccountID"]=NewcoinAddress(account->getAddress()).GetString();
|
|
||||||
ret["Issued"]=Json::Value(account->isIssued());
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value RPCServer::doNewAccount(Json::Value ¶ms)
|
Json::Value RPCServer::doNewAccount(Json::Value ¶ms)
|
||||||
@@ -226,14 +220,7 @@ Json::Value RPCServer::doNewAccount(Json::Value ¶ms)
|
|||||||
LocalAccount::pointer account(theApp->getWallet().getNewLocalAccount(family));
|
LocalAccount::pointer account(theApp->getWallet().getNewLocalAccount(family));
|
||||||
if(!account)
|
if(!account)
|
||||||
return JSONRPCError(500, "Family not found");
|
return JSONRPCError(500, "Family not found");
|
||||||
|
return account->getJson();
|
||||||
Json::Value ret(Json::objectValue);
|
|
||||||
ret["Family"]=account->getFamilyName();
|
|
||||||
ret["ShortName"]=account->getShortName();
|
|
||||||
ret["FullName"]=account->getFullName();
|
|
||||||
ret["AccountID"]=NewcoinAddress(account->getAddress()).GetString();
|
|
||||||
ret["Issued"]=Json::Value(account->isIssued());
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value RPCServer::doLock(Json::Value ¶ms)
|
Json::Value RPCServer::doLock(Json::Value ¶ms)
|
||||||
|
|||||||
12
Wallet.cpp
12
Wallet.cpp
@@ -366,6 +366,18 @@ std::string LocalAccount::getFamilyName() const
|
|||||||
return mFamily->getShortName();
|
return mFamily->getShortName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Json::Value LocalAccount::getJson() const
|
||||||
|
{
|
||||||
|
Json::Value ret(Json::objectValue);
|
||||||
|
ret["Family"]=getFamilyName();
|
||||||
|
ret["AccountID"]=NewcoinAddress(getAddress()).GetString();
|
||||||
|
ret["ShortName"]=getShortName();
|
||||||
|
ret["FullName"]=getFullName();
|
||||||
|
ret["Issued"]=Json::Value(isIssued());
|
||||||
|
ret["IsLocked"]=mFamily->isLocked();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
bool LocalAccount::isIssued() const
|
bool LocalAccount::isIssued() const
|
||||||
{
|
{
|
||||||
return mSeq < mFamily->getSeq();
|
return mSeq < mFamily->getSeq();
|
||||||
|
|||||||
Reference in New Issue
Block a user