From e00426a3bed5921669a1cd2a48555f59fd5131e0 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Wed, 22 Aug 2012 14:56:01 -0700 Subject: [PATCH] Finalizing of metadata building. --- src/LedgerEntrySet.cpp | 18 ++++++++++++++---- src/LedgerEntrySet.h | 5 +++-- src/TransactionMeta.h | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/LedgerEntrySet.cpp b/src/LedgerEntrySet.cpp index 390cec2301..ac110df3c3 100644 --- a/src/LedgerEntrySet.cpp +++ b/src/LedgerEntrySet.cpp @@ -230,26 +230,36 @@ Json::Value LedgerEntrySet::getJson(int) const return ret; } -void LedgerEntrySet::addRawMeta(Serializer& s) +void LedgerEntrySet::addRawMeta(Serializer& s, Ledger::pointer origLedger) { for (boost::unordered_map::const_iterator it = mEntries.begin(), end = mEntries.end(); it != end; ++it) { + int nType = TMNEndOfMetadata; + switch (it->second.mAction) { case taaMODIFY: - // WRITEME + nType = TMNModifiedNode; break; case taaDELETE: - // WRITEME + nType = TMNDeletedNode; break; case taaCREATE: - // WRITEME + nType = TMNCreatedNode; break; default: // ignore these break; } + if (nType != TMNEndOfMetadata) + { + SLE::pointer origNode = origLedger->getSLE(it->first); + SLE::pointer curNode = it->second.mEntry; + + // FINISH + + } } mSet.addRaw(s); } diff --git a/src/LedgerEntrySet.h b/src/LedgerEntrySet.h index 0980d094b3..cf4ee9b281 100644 --- a/src/LedgerEntrySet.h +++ b/src/LedgerEntrySet.h @@ -5,6 +5,7 @@ #include "SerializedLedger.h" #include "TransactionMeta.h" +#include "Ledger.h" enum LedgerEntryAction { @@ -42,7 +43,7 @@ public: // set functions LedgerEntrySet duplicate() const; // Make a duplicate of this set - void setTo(const LedgerEntrySet&); // Set this set to have the same contents as another + void setTo(const LedgerEntrySet&); // Set this set to have the same contents as another void swapWith(LedgerEntrySet&); // Swap the contents of two sets int getSeq() const { return mSeq; } @@ -59,7 +60,7 @@ public: void entryModify(const SLE::pointer&); // This entry will be modified Json::Value getJson(int) const; - void addRawMeta(Serializer&); + void addRawMeta(Serializer&, Ledger::pointer originalLedger); // iterator functions bool isEmpty() const { return mEntries.empty(); } diff --git a/src/TransactionMeta.h b/src/TransactionMeta.h index e3a5f359eb..4060353221 100644 --- a/src/TransactionMeta.h +++ b/src/TransactionMeta.h @@ -175,7 +175,7 @@ public: void swap(TransactionMetaSet&); bool isNodeAffected(const uint256&) const; - TransactionMetaNode& getAffectedNode(const uint256&); + TransactionMetaNode& getAffectedNode(const uint256&, int type); const TransactionMetaNode& peekAffectedNode(const uint256&) const; Json::Value getJson(int) const;