From 7ff41d62a1625d421575a3958c9f7c0011405683 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sat, 7 Jul 2012 19:44:52 -0700 Subject: [PATCH] Breaking Json API, return versions as chars. --- src/RPCServer.cpp | 18 +++++++++--------- src/SerializedLedger.cpp | 8 +++++--- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/RPCServer.cpp b/src/RPCServer.cpp index db71fb62c7..560e1cf845 100644 --- a/src/RPCServer.cpp +++ b/src/RPCServer.cpp @@ -487,18 +487,18 @@ Json::Value RPCServer::doAccountInfo(const Json::Value ¶ms) // Get info on account. - uint256 uClosed = mNetOps->getClosedLedger(); - Json::Value jClosed = accountFromString(uClosed, naAccount, bIndex, strIdent, iIndex); + uint256 uAccepted = mNetOps->getClosedLedger(); + Json::Value jAccepted = accountFromString(uAccepted, naAccount, bIndex, strIdent, iIndex); - if (jClosed.empty()) + if (jAccepted.empty()) { - AccountState::pointer asClosed = mNetOps->getAccountState(uClosed, naAccount); + AccountState::pointer asAccepted = mNetOps->getAccountState(uAccepted, naAccount); - if (asClosed) - asClosed->addJson(jClosed); + if (asAccepted) + asAccepted->addJson(jAccepted); } - ret["closed"] = jClosed; + ret["accepted"] = jAccepted; uint256 uCurrent = mNetOps->getCurrentLedger(); Json::Value jCurrent = accountFromString(uCurrent, naAccount, bIndex, strIdent, iIndex); @@ -514,7 +514,7 @@ Json::Value RPCServer::doAccountInfo(const Json::Value ¶ms) ret["current"] = jCurrent; #if 0 - if (!jClosed && !asCurrent) + if (!jAccepted && !asCurrent) { ret["account"] = naAccount.humanAccountID(); ret["status"] = "NotFound"; @@ -528,7 +528,7 @@ Json::Value RPCServer::doAccountInfo(const Json::Value ¶ms) // account_lines || [] Json::Value RPCServer::doAccountLines(const Json::Value ¶ms) { -// uint256 uClosed = mNetOps->getClosedLedger(); +// uint256 uAccepted = mNetOps->getClosedLedger(); uint256 uCurrent = mNetOps->getCurrentLedger(); std::string strIdent = params[0u].asString(); diff --git a/src/SerializedLedger.cpp b/src/SerializedLedger.cpp index 0dac98c623..372e9cd730 100644 --- a/src/SerializedLedger.cpp +++ b/src/SerializedLedger.cpp @@ -57,9 +57,11 @@ std::string SerializedLedgerEntry::getText() const Json::Value SerializedLedgerEntry::getJson(int options) const { Json::Value ret(mObject.getJson(options)); - ret["type"] = mFormat->t_name; - ret["index"] = mIndex.GetHex(); - ret["version"] = mVersion.getText(); + + ret["type"] = mFormat->t_name; + ret["index"] = mIndex.GetHex(); + ret["version"] = std::string(1, mVersion); + return ret; }