mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
JSON API clean up.
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
Critical protocol changes
|
Critical protocol changes
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
|
Mon Apr 8 16:13:12 PDT 2013
|
||||||
|
* The JSON field "inLedger" changing to "ledger_index"
|
||||||
|
|
||||||
|
Previous
|
||||||
* The JSON field "metaData" changing to "meta".
|
* The JSON field "metaData" changing to "meta".
|
||||||
* RPC ledger will no longer take "ledger", use "ledger_hash" or "ledger_index".
|
* RPC ledger will no longer take "ledger", use "ledger_hash" or "ledger_index".
|
||||||
* "ledgerClose" events:
|
* "ledgerClose" events:
|
||||||
|
|||||||
@@ -295,35 +295,21 @@ bool Transaction::convertToTransactions(uint32 firstLedgerSeq, uint32 secondLedg
|
|||||||
// options 1 to include the date of the transaction
|
// options 1 to include the date of the transaction
|
||||||
Json::Value Transaction::getJson(int options, bool binary) const
|
Json::Value Transaction::getJson(int options, bool binary) const
|
||||||
{
|
{
|
||||||
|
|
||||||
Json::Value ret(mTransaction->getJson(0, binary));
|
Json::Value ret(mTransaction->getJson(0, binary));
|
||||||
|
|
||||||
if (mInLedger)
|
if (mInLedger)
|
||||||
{
|
{
|
||||||
ret["inLedger"] = mInLedger;
|
ret["inLedger"] = mInLedger; // Deprecated.
|
||||||
|
ret["ledger_index"] = mInLedger;
|
||||||
|
|
||||||
if(options == 1)
|
if (options == 1)
|
||||||
{
|
{
|
||||||
Ledger::pointer ledger=theApp->getLedgerMaster().getLedgerBySeq(mInLedger);
|
Ledger::pointer ledger=theApp->getLedgerMaster().getLedgerBySeq(mInLedger);
|
||||||
if(ledger)
|
if (ledger)
|
||||||
ret["date"] = ledger->getCloseTimeNC();
|
ret["date"] = ledger->getCloseTimeNC();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (mStatus)
|
|
||||||
{
|
|
||||||
case NEW: ret["status"] = "new"; break;
|
|
||||||
case INVALID: ret["status"] = "invalid"; break;
|
|
||||||
case INCLUDED: ret["status"] = "included"; break;
|
|
||||||
case CONFLICTED: ret["status"] = "conflicted"; break;
|
|
||||||
case COMMITTED: ret["status"] = "committed"; break;
|
|
||||||
case HELD: ret["status"] = "held"; break;
|
|
||||||
case REMOVED: ret["status"] = "removed"; break;
|
|
||||||
case OBSOLETE: ret["status"] = "obsolete"; break;
|
|
||||||
case INCOMPLETE: ret["status"] = "incomplete"; break;
|
|
||||||
default: ret["status"] = "unknown"; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user