mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Rename SerializedLedger to SerializedLedgerEntry. It's not a whole ledger.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
#include "SerializedLedger.h"
|
||||
|
||||
SerializedLedger::SerializedLedger(SerializerIterator& sit, const uint256& index)
|
||||
SerializedLedgerEntry::SerializedLedgerEntry(SerializerIterator& sit, const uint256& index)
|
||||
: STObject("LedgerEntry"), mIndex(index)
|
||||
{
|
||||
uint16 type=sit.get16();
|
||||
@@ -12,7 +12,7 @@ SerializedLedger::SerializedLedger(SerializerIterator& sit, const uint256& index
|
||||
mObject=STObject(mFormat->elements, sit, "Entry");
|
||||
}
|
||||
|
||||
SerializedLedger::SerializedLedger(LedgerEntryType type) : STObject("LedgerEntry"), mType(type)
|
||||
SerializedLedgerEntry::SerializedLedgerEntry(LedgerEntryType type) : STObject("LedgerEntry"), mType(type)
|
||||
{
|
||||
mFormat=getLgrFormat(type);
|
||||
if(mFormat==NULL) throw std::runtime_error("invalid ledger entry type");
|
||||
@@ -20,7 +20,7 @@ SerializedLedger::SerializedLedger(LedgerEntryType type) : STObject("LedgerEntry
|
||||
mObject=STObject(mFormat->elements, "Entry");
|
||||
}
|
||||
|
||||
std::string SerializedLedger::getFullText() const
|
||||
std::string SerializedLedgerEntry::getFullText() const
|
||||
{
|
||||
std::string ret="\"";
|
||||
ret+=mIndex.GetHex();
|
||||
@@ -32,7 +32,7 @@ std::string SerializedLedger::getFullText() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string SerializedLedger::getText() const
|
||||
std::string SerializedLedgerEntry::getText() const
|
||||
{
|
||||
std::string ret="{";
|
||||
ret+=mIndex.GetHex();
|
||||
@@ -42,9 +42,9 @@ std::string SerializedLedger::getText() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool SerializedLedger::isEquivalent(const SerializedType& t) const
|
||||
bool SerializedLedgerEntry::isEquivalent(const SerializedType& t) const
|
||||
{ // locators are not compared
|
||||
const SerializedLedger* v=dynamic_cast<const SerializedLedger*>(&t);
|
||||
const SerializedLedgerEntry* v=dynamic_cast<const SerializedLedgerEntry*>(&t);
|
||||
if(!v) return false;
|
||||
if(mType != v->mType) return false;
|
||||
if(mObject != v->mObject) return false;
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
#include "SerializedObject.h"
|
||||
#include "LedgerFormats.h"
|
||||
|
||||
class SerializedLedger : public STObject
|
||||
class SerializedLedgerEntry : public STObject
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<SerializedLedger> pointer;
|
||||
typedef boost::shared_ptr<SerializedLedgerEntry> pointer;
|
||||
|
||||
protected:
|
||||
uint256 mIndex;
|
||||
@@ -17,12 +17,12 @@ protected:
|
||||
LedgerEntryFormat* mFormat;
|
||||
|
||||
public:
|
||||
SerializedLedger(SerializerIterator& sit, const uint256& index);
|
||||
SerializedLedger(LedgerEntryType type);
|
||||
SerializedLedgerEntry(SerializerIterator& sit, const uint256& index);
|
||||
SerializedLedgerEntry(LedgerEntryType type);
|
||||
|
||||
int getLength() const { return mVersion.getLength() + mObject.getLength(); }
|
||||
SerializedTypeID getSType() const { return STI_LEDGERENTRY; }
|
||||
SerializedLedger* duplicate() const { return new SerializedLedger(*this); }
|
||||
SerializedLedgerEntry* duplicate() const { return new SerializedLedgerEntry(*this); }
|
||||
std::string getFullText() const;
|
||||
std::string getText() const;
|
||||
void add(Serializer& s) const { mVersion.add(s); mObject.add(s); }
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "Ledger.h"
|
||||
#include "SerializedTransaction.h"
|
||||
#include "SerializedLedger.h"
|
||||
|
||||
// A TransactionEngine applies serialized transactions to a ledger
|
||||
// It can also, verify signatures, verify fees, and give rejection reasons
|
||||
@@ -33,13 +34,13 @@ class TransactionEngine
|
||||
protected:
|
||||
Ledger::pointer mTargetLedger;
|
||||
|
||||
TransactionEngineResult doPayment(const SerializedTransaction&);
|
||||
TransactionEngineResult doInvoice(const SerializedTransaction&);
|
||||
TransactionEngineResult doOffer(const SerializedTransaction&);
|
||||
TransactionEngineResult doTake(const SerializedTransaction&);
|
||||
TransactionEngineResult doCancel(const SerializedTransaction&);
|
||||
TransactionEngineResult doStore(const SerializedTransaction&);
|
||||
TransactionEngineResult doDelete(const SerializedTransaction&);
|
||||
TransactionEngineResult doPayment(const SerializedTransaction&, SerializedLedgerEntry& source);
|
||||
TransactionEngineResult doInvoice(const SerializedTransaction&, SerializedLedgerEntry& source);
|
||||
TransactionEngineResult doOffer(const SerializedTransaction&, SerializedLedgerEntry& source);
|
||||
TransactionEngineResult doTake(const SerializedTransaction&, SerializedLedgerEntry& source);
|
||||
TransactionEngineResult doCancel(const SerializedTransaction&, SerializedLedgerEntry& source);
|
||||
TransactionEngineResult doStore(const SerializedTransaction&, SerializedLedgerEntry& source);
|
||||
TransactionEngineResult doDelete(const SerializedTransaction&, SerializedLedgerEntry& source);
|
||||
|
||||
public:
|
||||
TransactionEngine(Ledger::pointer targetLedger) : mTargetLedger(targetLedger) { ; }
|
||||
|
||||
Reference in New Issue
Block a user