mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Make this code easier to debug.
This commit is contained in:
@@ -49,4 +49,12 @@ void AccountItems::fillItems(const uint160& accountID, Ledger::ref ledger)
|
||||
}
|
||||
}
|
||||
|
||||
Json::Value AccountItems::getJson(int v)
|
||||
{
|
||||
Json::Value ret(Json::arrayValue);
|
||||
BOOST_FOREACH(AccountItem::ref ai, mItems)
|
||||
ret.append(ai->getJson(v));
|
||||
return ret;
|
||||
}
|
||||
|
||||
// vim:ts=4
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
virtual ~AccountItem() { ; }
|
||||
virtual AccountItem::pointer makeItem(const uint160& accountID, SerializedLedgerEntry::ref ledgerEntry)=0;
|
||||
virtual LedgerEntryType getType()=0;
|
||||
virtual Json::Value getJson(int)=0;
|
||||
|
||||
SerializedLedgerEntry::pointer getSLE() { return mLedgerEntry; }
|
||||
const SerializedLedgerEntry& peekSLE() const { return *mLedgerEntry; }
|
||||
@@ -41,6 +42,7 @@ public:
|
||||
AccountItems(const uint160& accountID, Ledger::ref ledger, AccountItem::pointer ofType);
|
||||
|
||||
std::vector<AccountItem::pointer>& getItems() { return(mItems); }
|
||||
Json::Value getJson(int);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,4 +15,13 @@ Offer::Offer(SerializedLedgerEntry::pointer ledgerEntry) : AccountItem(ledgerEnt
|
||||
mSeq = mLedgerEntry->getFieldU32(sfSequence);
|
||||
}
|
||||
|
||||
Json::Value Offer::getJson(int)
|
||||
{
|
||||
Json::Value ret(Json::objectValue);
|
||||
ret["account"] = mAccount.humanAccountID();
|
||||
ret["taker_gets"] = getTakerGets().getFullText();
|
||||
ret["taker_pays"] = getTakerPays().getFullText();
|
||||
return ret;
|
||||
}
|
||||
|
||||
// vim:ts=4
|
||||
|
||||
@@ -19,6 +19,7 @@ public:
|
||||
STAmount getTakerGets(){ return(mTakerGets); }
|
||||
RippleAddress getAccount(){ return(mAccount); }
|
||||
int getSeq(){ return(mSeq); }
|
||||
Json::Value getJson(int);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -44,4 +44,12 @@ void RippleState::setViewAccount(const uint160& accountID)
|
||||
}
|
||||
}
|
||||
|
||||
Json::Value RippleState::getJson(int)
|
||||
{
|
||||
Json::Value ret(Json::objectValue);
|
||||
ret["low_id"] = mLowID.GetHex();
|
||||
ret["high_id"] = mHighID.GetHex();
|
||||
return ret;
|
||||
}
|
||||
|
||||
// vim:ts=4
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
SerializedLedgerEntry::pointer getSLE() { return mLedgerEntry; }
|
||||
const SerializedLedgerEntry& peekSLE() const { return *mLedgerEntry; }
|
||||
SerializedLedgerEntry& peekSLE() { return *mLedgerEntry; }
|
||||
Json::Value getJson(int);
|
||||
|
||||
std::vector<unsigned char> getRaw() const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user