From 3fafde063f2d90799761b4868492a976d9ba39c9 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 3 Jun 2013 18:34:32 -0700 Subject: [PATCH] Move serialization and error code stuff into ripple_data --- .../{types => format}/ripple_FieldNames.cpp | 4 +- .../{types => format}/ripple_FieldNames.h | 24 +-- .../format/ripple_LedgerFormat.cpp | 7 +- .../ripple_data/format/ripple_LedgerFormat.h | 6 +- .../ripple_RippleAddress.cpp | 0 .../{types => format}/ripple_RippleAddress.h | 0 .../ripple_SerializeDeclarations.h | 0 .../format/ripple_SerializedObject.cpp | 0 .../format/ripple_SerializedObject.h | 10 +- .../format/ripple_SerializedTypes.cpp | 0 .../format/ripple_SerializedTypes.h | 9 +- .../{types => format}/ripple_Serializer.cpp | 0 .../{types => format}/ripple_Serializer.h | 0 .../ripple_data/format/ripple_TER.cpp | 0 .../ripple_data/format/ripple_TER.h | 22 +- .../format/ripple_TransactionFormat.cpp | 2 + .../format/ripple_TransactionFormat.h | 7 +- modules/ripple_data/ripple_data.cpp | 38 ++-- modules/ripple_data/ripple_data.h | 45 ++--- modules/ripple_ledger/ripple_ledger.h | 2 - modules/ripple_main/ripple_main.cpp | 10 - newcoin.vcxproj | 100 ++++++---- newcoin.vcxproj.filters | 188 ++++++++++-------- src/cpp/ripple/Amount.cpp | 1 - src/cpp/ripple/AmountRound.cpp | 2 - src/cpp/ripple/Config.h | 1 - src/cpp/ripple/Ledger.h | 5 + src/cpp/ripple/LedgerEntrySet.h | 1 - src/cpp/ripple/PFRequest.cpp | 1 - src/cpp/ripple/PFRequest.h | 1 - src/cpp/ripple/Pathfinder.h | 1 - src/cpp/ripple/RPCHandler.h | 1 - src/cpp/ripple/SerializedLedger.h | 3 - src/cpp/ripple/SerializedTransaction.h | 7 +- src/cpp/ripple/SerializedValidation.h | 2 - src/cpp/ripple/Transaction.h | 1 - src/cpp/ripple/TransactionEngine.h | 1 - src/cpp/ripple/TransactionMeta.h | 3 - src/cpp/ripple/Transactor.h | 3 - 39 files changed, 245 insertions(+), 263 deletions(-) rename modules/ripple_data/{types => format}/ripple_FieldNames.cpp (95%) rename modules/ripple_data/{types => format}/ripple_FieldNames.h (95%) rename src/cpp/ripple/LedgerFormats.cpp => modules/ripple_data/format/ripple_LedgerFormat.cpp (95%) rename src/cpp/ripple/LedgerFormats.h => modules/ripple_data/format/ripple_LedgerFormat.h (96%) rename modules/ripple_data/{types => format}/ripple_RippleAddress.cpp (100%) rename modules/ripple_data/{types => format}/ripple_RippleAddress.h (100%) rename modules/ripple_data/{types => format}/ripple_SerializeDeclarations.h (100%) rename src/cpp/ripple/SerializedObject.cpp => modules/ripple_data/format/ripple_SerializedObject.cpp (100%) rename src/cpp/ripple/SerializedObject.h => modules/ripple_data/format/ripple_SerializedObject.h (98%) rename src/cpp/ripple/SerializedTypes.cpp => modules/ripple_data/format/ripple_SerializedTypes.cpp (100%) rename src/cpp/ripple/SerializedTypes.h => modules/ripple_data/format/ripple_SerializedTypes.h (99%) rename modules/ripple_data/{types => format}/ripple_Serializer.cpp (100%) rename modules/ripple_data/{types => format}/ripple_Serializer.h (100%) rename src/cpp/ripple/TransactionErr.cpp => modules/ripple_data/format/ripple_TER.cpp (100%) rename src/cpp/ripple/TransactionErr.h => modules/ripple_data/format/ripple_TER.h (85%) rename src/cpp/ripple/TransactionFormats.cpp => modules/ripple_data/format/ripple_TransactionFormat.cpp (97%) rename src/cpp/ripple/TransactionFormats.h => modules/ripple_data/format/ripple_TransactionFormat.h (94%) diff --git a/modules/ripple_data/types/ripple_FieldNames.cpp b/modules/ripple_data/format/ripple_FieldNames.cpp similarity index 95% rename from modules/ripple_data/types/ripple_FieldNames.cpp rename to modules/ripple_data/format/ripple_FieldNames.cpp index cd8af10d4..17d947d4b 100644 --- a/modules/ripple_data/types/ripple_FieldNames.cpp +++ b/modules/ripple_data/format/ripple_FieldNames.cpp @@ -14,7 +14,7 @@ SField sfIndex(STI_HASH256, 258, "index"); #define FIELD(name, type, index) SField sf##name(FIELD_CODE(STI_##type, index), STI_##type, index, #name); #define TYPE(name, type, index) -#include "modules/ripple_data/types/ripple_SerializeDeclarations.h" +#include "../format/ripple_SerializeDeclarations.h" #undef FIELD #undef TYPE @@ -65,7 +65,7 @@ SField::ref SField::getField(int code) #define FIELD(name, type, index) #define TYPE(name, type, index) case STI_##type: -#include "modules/ripple_data/types/ripple_SerializeDeclarations.h" +#include "../format/ripple_SerializeDeclarations.h" #undef FIELD #undef TYPE diff --git a/modules/ripple_data/types/ripple_FieldNames.h b/modules/ripple_data/format/ripple_FieldNames.h similarity index 95% rename from modules/ripple_data/types/ripple_FieldNames.h rename to modules/ripple_data/format/ripple_FieldNames.h index c4525e457..7b7fccb6b 100644 --- a/modules/ripple_data/types/ripple_FieldNames.h +++ b/modules/ripple_data/format/ripple_FieldNames.h @@ -1,10 +1,7 @@ #ifndef RIPPLE_FIELDNAMES_H #define RIPPLE_FIELDNAMES_H -#include - -#include - +// VFALCO: TODO, lose the macro. #define FIELD_CODE(type, index) ((static_cast(type) << 16) | index) enum SerializedTypeID @@ -16,7 +13,7 @@ enum SerializedTypeID #define TYPE(name, field, value) STI_##field = value, #define FIELD(name, field, value) -#include "modules/ripple_data/types/ripple_SerializeDeclarations.h" +#include "../format/ripple_SerializeDeclarations.h" #undef TYPE #undef FIELD @@ -48,13 +45,6 @@ public: static const int sMD_Always = 0x10; // value when node containing it is affected at all static const int sMD_Default = sMD_ChangeOrig | sMD_ChangeNew | sMD_DeleteFinal | sMD_Create; -protected: - static std::map codeToField; - static boost::mutex mapMutex; - static int num; - - SField(SerializedTypeID id, int val); - public: const int fieldCode; // (type<<16)|index @@ -120,13 +110,21 @@ public: bool operator!=(const SField& f) const { return fieldCode != f.fieldCode; } static int compare(SField::ref f1, SField::ref f2); + + // VFALCO: TODO, make these private +protected: + static std::map codeToField; + static boost::mutex mapMutex; + static int num; + + SField(SerializedTypeID id, int val); }; extern SField sfInvalid, sfGeneric, sfLedgerEntry, sfTransaction, sfValidation; #define FIELD(name, type, index) extern SField sf##name; #define TYPE(name, type, index) -#include "modules/ripple_data/types/ripple_SerializeDeclarations.h" +#include "../format/ripple_SerializeDeclarations.h" #undef FIELD #undef TYPE diff --git a/src/cpp/ripple/LedgerFormats.cpp b/modules/ripple_data/format/ripple_LedgerFormat.cpp similarity index 95% rename from src/cpp/ripple/LedgerFormats.cpp rename to modules/ripple_data/format/ripple_LedgerFormat.cpp index 872b3cb90..39beabf71 100644 --- a/src/cpp/ripple/LedgerFormats.cpp +++ b/modules/ripple_data/format/ripple_LedgerFormat.cpp @@ -1,6 +1,9 @@ -std::map LedgerEntryFormat::byType; -std::map LedgerEntryFormat::byName; +std::map LedgerEntryFormat::byType; + +std::map LedgerEntryFormat::byName; + +// VFALCO: TODO, surely we can think of a better way than macros? #define LEF_BASE \ << SOElement(sfLedgerIndex, SOE_OPTIONAL) \ diff --git a/src/cpp/ripple/LedgerFormats.h b/modules/ripple_data/format/ripple_LedgerFormat.h similarity index 96% rename from src/cpp/ripple/LedgerFormats.h rename to modules/ripple_data/format/ripple_LedgerFormat.h index f9f0a737b..13e3d8280 100644 --- a/src/cpp/ripple/LedgerFormats.h +++ b/modules/ripple_data/format/ripple_LedgerFormat.h @@ -1,7 +1,5 @@ -#ifndef __LEDGERFORMATS__ -#define __LEDGERFORMATS__ - -#include "SerializedObject.h" +#ifndef RIPPLE_LEDGERFORMAT_H +#define RIPPLE_LEDGERFORMAT_H // Used as the type of a transaction or the type of a ledger entry. enum LedgerEntryType diff --git a/modules/ripple_data/types/ripple_RippleAddress.cpp b/modules/ripple_data/format/ripple_RippleAddress.cpp similarity index 100% rename from modules/ripple_data/types/ripple_RippleAddress.cpp rename to modules/ripple_data/format/ripple_RippleAddress.cpp diff --git a/modules/ripple_data/types/ripple_RippleAddress.h b/modules/ripple_data/format/ripple_RippleAddress.h similarity index 100% rename from modules/ripple_data/types/ripple_RippleAddress.h rename to modules/ripple_data/format/ripple_RippleAddress.h diff --git a/modules/ripple_data/types/ripple_SerializeDeclarations.h b/modules/ripple_data/format/ripple_SerializeDeclarations.h similarity index 100% rename from modules/ripple_data/types/ripple_SerializeDeclarations.h rename to modules/ripple_data/format/ripple_SerializeDeclarations.h diff --git a/src/cpp/ripple/SerializedObject.cpp b/modules/ripple_data/format/ripple_SerializedObject.cpp similarity index 100% rename from src/cpp/ripple/SerializedObject.cpp rename to modules/ripple_data/format/ripple_SerializedObject.cpp diff --git a/src/cpp/ripple/SerializedObject.h b/modules/ripple_data/format/ripple_SerializedObject.h similarity index 98% rename from src/cpp/ripple/SerializedObject.h rename to modules/ripple_data/format/ripple_SerializedObject.h index 5ca6aec2b..c29c31251 100644 --- a/src/cpp/ripple/SerializedObject.h +++ b/modules/ripple_data/format/ripple_SerializedObject.h @@ -1,11 +1,5 @@ -#ifndef __SERIALIZEDOBJECT__ -#define __SERIALIZEDOBJECT__ - -#include - -#include - -#include "SerializedTypes.h" +#ifndef RIPPLE_SERIALIZEDOBJECT_H +#define RIPPLE_SERIALIZEDOBJECT_H DEFINE_INSTANCE(SerializedObject); DEFINE_INSTANCE(SerializedArray); diff --git a/src/cpp/ripple/SerializedTypes.cpp b/modules/ripple_data/format/ripple_SerializedTypes.cpp similarity index 100% rename from src/cpp/ripple/SerializedTypes.cpp rename to modules/ripple_data/format/ripple_SerializedTypes.cpp diff --git a/src/cpp/ripple/SerializedTypes.h b/modules/ripple_data/format/ripple_SerializedTypes.h similarity index 99% rename from src/cpp/ripple/SerializedTypes.h rename to modules/ripple_data/format/ripple_SerializedTypes.h index f88636ee9..d600867a7 100644 --- a/src/cpp/ripple/SerializedTypes.h +++ b/modules/ripple_data/format/ripple_SerializedTypes.h @@ -1,9 +1,8 @@ -#ifndef __SERIALIZEDTYPES__ -#define __SERIALIZEDTYPES__ - -#include -#include +#ifndef RIPPLE_SERIALIZEDTYPES_H +#define RIPPLE_SERIALIZEDTYPES_H +// VFALCO: TODO, fix this restriction on copy assignment. +// // CAUTION: Do not create a vector (or similar container) of any object derived from // SerializedType. Use Boost ptr_* containers. The copy assignment operator of // SerializedType has semantics that will cause contained types to change their names diff --git a/modules/ripple_data/types/ripple_Serializer.cpp b/modules/ripple_data/format/ripple_Serializer.cpp similarity index 100% rename from modules/ripple_data/types/ripple_Serializer.cpp rename to modules/ripple_data/format/ripple_Serializer.cpp diff --git a/modules/ripple_data/types/ripple_Serializer.h b/modules/ripple_data/format/ripple_Serializer.h similarity index 100% rename from modules/ripple_data/types/ripple_Serializer.h rename to modules/ripple_data/format/ripple_Serializer.h diff --git a/src/cpp/ripple/TransactionErr.cpp b/modules/ripple_data/format/ripple_TER.cpp similarity index 100% rename from src/cpp/ripple/TransactionErr.cpp rename to modules/ripple_data/format/ripple_TER.cpp diff --git a/src/cpp/ripple/TransactionErr.h b/modules/ripple_data/format/ripple_TER.h similarity index 85% rename from src/cpp/ripple/TransactionErr.h rename to modules/ripple_data/format/ripple_TER.h index 2dad42cf5..a1f5e2bdb 100644 --- a/src/cpp/ripple/TransactionErr.h +++ b/modules/ripple_data/format/ripple_TER.h @@ -1,8 +1,12 @@ -#ifndef _TRANSACTION_ERR_ -#define _TRANSACTION_ERR_ - -#include +#ifndef RIPPLE_TER_H +#define RIPPLE_TER_H +// VFALCO: TODO do not use auto-incrementing. Explicitly assign each +// constant so there is no possibility of someone coming in +// and screwing it up. +// +// VFALCO: TODO, consider renaming TER to TxErr or TxResult for clarity. +// enum TER // aka TransactionEngineResult { // Note: Range is stable. Exact numbers are currently unstable. Use tokens. @@ -13,7 +17,7 @@ enum TER // aka TransactionEngineResult // - Not forwarded // - No fee check telLOCAL_ERROR = -399, - telBAD_DOMAIN, + telBAD_DOMAIN, // VFALCO: TODO, should read "telBAD_DOMAIN = -398," etc... telBAD_PATH_COUNT, telBAD_PUBLIC_KEY, telFAILED_PROCESSING, @@ -139,6 +143,7 @@ enum TER // aka TransactionEngineResult tecUNFUNDED = 129, // Deprecated, old ambiguous unfunded. }; +// VFALCO: TODO, change these to normal functions. #define isTelLocal(x) ((x) >= telLOCAL_ERROR && (x) < temMALFORMED) #define isTemMalformed(x) ((x) >= temMALFORMED && (x) < tefFAILURE) #define isTefFailure(x) ((x) >= tefFAILURE && (x) < terRETRY) @@ -146,9 +151,10 @@ enum TER // aka TransactionEngineResult #define isTesSuccess(x) ((x) == tesSUCCESS) #define isTecClaim(x) ((x) >= tecCLAIM) -bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman); -std::string transToken(TER terCode); -std::string transHuman(TER terCode); +// VFALCO: TODO, group these into a shell class along with the defines above. +extern bool transResultInfo (TER terCode, std::string& strToken, std::string& strHuman); +extern std::string transToken (TER terCode); +extern std::string transHuman (TER terCode); #endif // vim:ts=4 diff --git a/src/cpp/ripple/TransactionFormats.cpp b/modules/ripple_data/format/ripple_TransactionFormat.cpp similarity index 97% rename from src/cpp/ripple/TransactionFormats.cpp rename to modules/ripple_data/format/ripple_TransactionFormat.cpp index d84293698..295ba2738 100644 --- a/src/cpp/ripple/TransactionFormats.cpp +++ b/modules/ripple_data/format/ripple_TransactionFormat.cpp @@ -1,7 +1,9 @@ std::map TransactionFormat::byType; + std::map TransactionFormat::byName; +// VFALCO: TODO, surely we can think of a better way than to use macros?? #define TF_BASE \ << SOElement(sfTransactionType, SOE_REQUIRED) \ << SOElement(sfFlags, SOE_OPTIONAL) \ diff --git a/src/cpp/ripple/TransactionFormats.h b/modules/ripple_data/format/ripple_TransactionFormat.h similarity index 94% rename from src/cpp/ripple/TransactionFormats.h rename to modules/ripple_data/format/ripple_TransactionFormat.h index 6e3d6a6da..2bb2cb357 100644 --- a/src/cpp/ripple/TransactionFormats.h +++ b/modules/ripple_data/format/ripple_TransactionFormat.h @@ -1,8 +1,5 @@ -#ifndef __TRANSACTIONFORMATS__ -#define __TRANSACTIONFORMATS__ - -#include "SerializedObject.h" -#include "LedgerFormats.h" +#ifndef RIPPLE_TRANSACTIONFORMAT_H +#define RIPPLE_TRANSACTIONFORMAT_H enum TransactionType { diff --git a/modules/ripple_data/ripple_data.cpp b/modules/ripple_data/ripple_data.cpp index 0b901b382..29bfa685e 100644 --- a/modules/ripple_data/ripple_data.cpp +++ b/modules/ripple_data/ripple_data.cpp @@ -22,45 +22,30 @@ @ingroup ripple_data */ -// RippleAddress #include #include #include +#include +#include + #include #include #include #include #include - -// FieldNames -#include #include #include #include -// CKeyECIES, CKeyDeterministic #include #include #include #include #include #include -#include -#include - -// CKeyDeterministic #include #include - -#include "ripple_data.h" - - - -#include "crypto/ripple_Base58.h" // for RippleAddress -#include "crypto/ripple_CKey.h" // needs RippleAddress VFALCO: TODO, remove this dependency cycle -#include "crypto/ripple_RFC1751.h" - // VFALCO: TODO, fix these warnings! #ifdef _MSC_VER //#pragma warning (push) // Causes spurious C4503 "decorated name exceeds maximum length" @@ -68,6 +53,12 @@ //#pragma warning (disable: 4244) // conversion, possible loss of data #endif +#include "ripple_data.h" + +#include "crypto/ripple_Base58.h" // for RippleAddress +#include "crypto/ripple_CKey.h" // needs RippleAddress VFALCO: TODO, remove this dependency cycle +#include "crypto/ripple_RFC1751.h" + #include "crypto/ripple_CBigNum.cpp" #include "crypto/ripple_CKey.cpp" #include "crypto/ripple_CKeyDeterministic.cpp" @@ -76,9 +67,14 @@ #include "crypto/ripple_Base58Data.cpp" #include "crypto/ripple_RFC1751.cpp" -#include "types/ripple_FieldNames.cpp" -#include "types/ripple_RippleAddress.cpp" -#include "types/ripple_Serializer.cpp" +#include "format/ripple_FieldNames.cpp" +#include "format/ripple_LedgerFormat.cpp" +#include "format/ripple_RippleAddress.cpp" +#include "format/ripple_SerializedTypes.cpp" +#include "format/ripple_Serializer.cpp" +#include "format/ripple_SerializedObject.cpp" +#include "format/ripple_TER.cpp" +#include "format/ripple_TransactionFormat.cpp" // VFALCO: TODO Fix this for SConstruct #ifdef _MSC_VER diff --git a/modules/ripple_data/ripple_data.h b/modules/ripple_data/ripple_data.h index 83628e92a..879f66c8c 100644 --- a/modules/ripple_data/ripple_data.h +++ b/modules/ripple_data/ripple_data.h @@ -32,30 +32,24 @@ #ifndef RIPPLE_DATA_H #define RIPPLE_DATA_H -// Base58Data -#include -#include -#include - -// CBigNum -#include -#include -#include - -// CKey -#include -#include #include +#include +#include +#include +#include +#include +#include + +#include +#include +#include // VFALCO: NOTE, this looks like junk + +#include #include #include #include -#include -// Serializer -#include -#include -#include -#include +//------------------------------------------------------------------------------ // VFALCO: TODO, try to reduce these dependencies #include "../ripple_basics/ripple_basics.h" @@ -64,11 +58,14 @@ #include "crypto/ripple_Base58.h" // VFALCO: TODO, Can be moved to .cpp if we clean up setAlphabet stuff #include "crypto/ripple_Base58Data.h" -#include "types/ripple_FieldNames.h" -#include "types/ripple_RippleAddress.h" -#include "types/ripple_Serializer.h" // needs CKey - -#include "src/cpp/ripple/SerializedTypes.h" +#include "format/ripple_FieldNames.h" +#include "format/ripple_RippleAddress.h" +#include "format/ripple_Serializer.h" // needs CKey +#include "format/ripple_TER.h" +#include "format/ripple_SerializedTypes.h" // needs Serializer, TER +#include "format/ripple_SerializedObject.h" +#include "format/ripple_LedgerFormat.h" // needs SOTemplate from SerializedObject +#include "format/ripple_TransactionFormat.h" // VFALCO: TODO, resolve the location of this file #include "ripple.pb.h" diff --git a/modules/ripple_ledger/ripple_ledger.h b/modules/ripple_ledger/ripple_ledger.h index 2328f1c4a..947a88c46 100644 --- a/modules/ripple_ledger/ripple_ledger.h +++ b/modules/ripple_ledger/ripple_ledger.h @@ -34,6 +34,4 @@ #include "modules/ripple_basics/ripple_basics.h" -#include "../ripple_data/ripple_data.h" - #endif diff --git a/modules/ripple_main/ripple_main.cpp b/modules/ripple_main/ripple_main.cpp index 600245a80..a793bf3b9 100644 --- a/modules/ripple_main/ripple_main.cpp +++ b/modules/ripple_main/ripple_main.cpp @@ -133,7 +133,6 @@ #include "src/cpp/ripple/LedgerAcquire.h" #include "src/cpp/ripple/LedgerConsensus.h" #include "src/cpp/ripple/LedgerEntrySet.h" -#include "src/cpp/ripple/LedgerFormats.h" #include "src/cpp/ripple/LedgerHistory.h" #include "src/cpp/ripple/LedgerMaster.h" #include "src/cpp/ripple/LedgerProposal.h" @@ -168,14 +167,10 @@ #include "src/cpp/ripple/SHAMapSync.h" #include "src/cpp/ripple/SNTPClient.h" #include "src/cpp/ripple/SerializedLedger.h" -#include "src/cpp/ripple/SerializedObject.h" #include "src/cpp/ripple/SerializedTransaction.h" -#include "src/cpp/ripple/SerializedTypes.h" #include "src/cpp/ripple/SerializedValidation.h" #include "src/cpp/ripple/Transaction.h" #include "src/cpp/ripple/TransactionEngine.h" -#include "src/cpp/ripple/TransactionErr.h" -#include "src/cpp/ripple/TransactionFormats.h" #include "src/cpp/ripple/TransactionMaster.h" #include "src/cpp/ripple/TransactionMeta.h" #include "src/cpp/ripple/TransactionQueue.h" @@ -233,7 +228,6 @@ static DH* handleTmpDh(SSL* ssl, int is_export, int iKeyLength) #include "src/cpp/ripple/LedgerAcquire.cpp" #include "src/cpp/ripple/LedgerConsensus.cpp" #include "src/cpp/ripple/LedgerEntrySet.cpp" -#include "src/cpp/ripple/LedgerFormats.cpp" // no log #include "src/cpp/ripple/LedgerHistory.cpp" // no log #include "src/cpp/ripple/LedgerMaster.cpp" #include "src/cpp/ripple/LedgerProposal.cpp" // no log @@ -268,9 +262,7 @@ static DH* handleTmpDh(SSL* ssl, int is_export, int iKeyLength) #include "src/cpp/ripple/RPCSub.cpp" #include "src/cpp/ripple/ScriptData.cpp" // no log #include "src/cpp/ripple/SerializedLedger.cpp" -#include "src/cpp/ripple/SerializedObject.cpp" #include "src/cpp/ripple/SerializedTransaction.cpp" -#include "src/cpp/ripple/SerializedTypes.cpp" #include "src/cpp/ripple/SerializedValidation.cpp" #include "src/cpp/ripple/SHAMap.cpp" #include "src/cpp/ripple/SHAMapDiff.cpp" // no log @@ -281,8 +273,6 @@ static DH* handleTmpDh(SSL* ssl, int is_export, int iKeyLength) #include "src/cpp/ripple/TransactionAcquire.cpp" #include "src/cpp/ripple/TransactionCheck.cpp" #include "src/cpp/ripple/TransactionEngine.cpp" -#include "src/cpp/ripple/TransactionErr.cpp" // no log -#include "src/cpp/ripple/TransactionFormats.cpp" // no log #include "src/cpp/ripple/TransactionMaster.cpp" // no log #include "src/cpp/ripple/TransactionMeta.cpp" #include "src/cpp/ripple/TransactionQueue.cpp" // no log diff --git a/newcoin.vcxproj b/newcoin.vcxproj index 844e8b1fa..fa8183fda 100644 --- a/newcoin.vcxproj +++ b/newcoin.vcxproj @@ -279,25 +279,55 @@ true true + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - true @@ -1058,24 +1088,12 @@ true true - - true - true - true - true - true true true true - - true - true - true - true - true true @@ -1142,12 +1160,6 @@ true true - - true - true - true - true - true true @@ -1277,11 +1289,16 @@ + + + + + + + + + - - - - @@ -1672,9 +1689,7 @@ - - @@ -1682,7 +1697,6 @@ - diff --git a/newcoin.vcxproj.filters b/newcoin.vcxproj.filters index d9d45cee7..9cd0e5cb2 100644 --- a/newcoin.vcxproj.filters +++ b/newcoin.vcxproj.filters @@ -79,9 +79,6 @@ {095d33d8-dbf7-44d0-a675-6722b02bb3be} - - {2f3572a9-2882-4656-ab93-82b7761c9e3d} - {9f8ed40a-9f16-42fe-82fd-caf72d3d6a2b} @@ -112,9 +109,6 @@ {c7f863ce-204b-4a15-b236-24fe1e3430e5} - - {c441b367-d096-401f-a3f0-5ac24290d7b7} - {3f351c55-360d-40bc-a136-4944ce572efd} @@ -142,6 +136,12 @@ {6a33d317-620f-4cf0-88a9-2d943b4c00a1} + + {2f3572a9-2882-4656-ab93-82b7761c9e3d} + + + {c441b367-d096-401f-a3f0-5ac24290d7b7} + @@ -429,9 +429,6 @@ 1. Modules\ripple_main\_unfactored\transactions - - 1. Modules\ripple_main\_unfactored\transactions - 1. Modules\ripple_main\_unfactored\transactions @@ -474,15 +471,9 @@ 1. Modules\ripple_main\_unfactored\serialization - - 1. Modules\ripple_main\_unfactored\serialization - 1. Modules\ripple_main\_unfactored\serialization - - 1. Modules\ripple_main\_unfactored\serialization - 1. Modules\ripple_main\_unfactored\serialization @@ -639,24 +630,12 @@ 1. Modules\ripple_data\crypto - - 1. Modules\ripple_data\types - - - 1. Modules\ripple_data\types - 1. Modules\ripple_data\crypto - - 1. Modules\ripple_data\types - 1. Modules\ripple_data\crypto - - 1. Modules\ripple_data\types - 1. Modules\ripple_basics\utility @@ -733,64 +712,64 @@ 1. Modules\ripple_main\refactored - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger 1. Modules\ripple_main\_unfactored\containers @@ -807,6 +786,33 @@ 1. Modules\ripple_main\refactored + + 1. Modules\ripple_data\crypto + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + @@ -1085,9 +1091,6 @@ 1. Modules\ripple_main\_unfactored\transactions - - 1. Modules\ripple_main\_unfactored\transactions - 1. Modules\ripple_main\_unfactored\transactions @@ -1130,15 +1133,9 @@ 1. Modules\ripple_main\_unfactored\serialization - - 1. Modules\ripple_main\_unfactored\serialization - 1. Modules\ripple_main\_unfactored\serialization - - 1. Modules\ripple_main\_unfactored\serialization - 1. Modules\ripple_main\_unfactored\serialization @@ -1331,21 +1328,9 @@ 1. Modules\ripple_data\crypto - - 1. Modules\ripple_data\types - - - 1. Modules\ripple_data\types - - - 1. Modules\ripple_data\types - 1. Modules\ripple_data\crypto - - 1. Modules\ripple_data\types - 1. Modules\ripple_basics\utility @@ -1422,64 +1407,64 @@ 1. Modules\ripple_main\refactored - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger - 1. Modules\ripple_main\_unfactored\processing + 1. Modules\ripple_main\_unfactored\ledger 1. Modules\ripple_main\_unfactored\containers @@ -1490,6 +1475,33 @@ 1. Modules\ripple_main\refactored + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + + + 1. Modules\ripple_data\format + diff --git a/src/cpp/ripple/Amount.cpp b/src/cpp/ripple/Amount.cpp index 27029aedc..550b3df45 100644 --- a/src/cpp/ripple/Amount.cpp +++ b/src/cpp/ripple/Amount.cpp @@ -10,7 +10,6 @@ #include #include "Config.h" -#include "SerializedTypes.h" SETUP_LOG (STAmount) diff --git a/src/cpp/ripple/AmountRound.cpp b/src/cpp/ripple/AmountRound.cpp index 4bd97062c..8aa3ff5b3 100644 --- a/src/cpp/ripple/AmountRound.cpp +++ b/src/cpp/ripple/AmountRound.cpp @@ -1,8 +1,6 @@ #include -#include "SerializedTypes.h" - // CAUTION: This is early code and is *NOT* ready for real use yet. static void canonicalizeRound(bool isNative, uint64& value, int& offset, bool roundUp) diff --git a/src/cpp/ripple/Config.h b/src/cpp/ripple/Config.h index 7f9761b12..3c942b767 100644 --- a/src/cpp/ripple/Config.h +++ b/src/cpp/ripple/Config.h @@ -7,7 +7,6 @@ #include #include "ParseSection.h" -#include "SerializedTypes.h" #define ENABLE_INSECURE 0 // 1, to enable unnecessary features. diff --git a/src/cpp/ripple/Ledger.h b/src/cpp/ripple/Ledger.h index 307d4d51f..a97763a52 100644 --- a/src/cpp/ripple/Ledger.h +++ b/src/cpp/ripple/Ledger.h @@ -39,6 +39,11 @@ DEFINE_INSTANCE(Ledger); class SqliteStatement; +// VFALCO: TODO, figure out exactly how this thing works. +// It seems like some ledger database is stored as a global, static in the +// class. But then what is the meaning of a Ledger object? Is this +// really two classes in one? StoreOfAllLedgers + SingleLedgerObject? +// class Ledger : public boost::enable_shared_from_this, public IS_INSTANCE(Ledger) { // The basic Ledger structure, can be opened, closed, or synching // VFALCO: TODO, eliminate the need for friends diff --git a/src/cpp/ripple/LedgerEntrySet.h b/src/cpp/ripple/LedgerEntrySet.h index be99ac15e..2d956eff2 100644 --- a/src/cpp/ripple/LedgerEntrySet.h +++ b/src/cpp/ripple/LedgerEntrySet.h @@ -6,7 +6,6 @@ #include "SerializedLedger.h" #include "TransactionMeta.h" #include "Ledger.h" -#include "TransactionErr.h" DEFINE_INSTANCE(LedgerEntrySetEntry); DEFINE_INSTANCE(LedgerEntrySet); diff --git a/src/cpp/ripple/PFRequest.cpp b/src/cpp/ripple/PFRequest.cpp index 90bde6326..32d50f08b 100644 --- a/src/cpp/ripple/PFRequest.cpp +++ b/src/cpp/ripple/PFRequest.cpp @@ -6,7 +6,6 @@ #include "Application.h" #include "Pathfinder.h" #include "RippleCalc.h" -#include "LedgerFormats.h" SETUP_LOG (PFRequest) diff --git a/src/cpp/ripple/PFRequest.h b/src/cpp/ripple/PFRequest.h index 180e25fc4..c736a4b61 100644 --- a/src/cpp/ripple/PFRequest.h +++ b/src/cpp/ripple/PFRequest.h @@ -9,7 +9,6 @@ #include #include -#include "SerializedTypes.h" #include "Pathfinder.h" // A pathfinding request submitted by a client diff --git a/src/cpp/ripple/Pathfinder.h b/src/cpp/ripple/Pathfinder.h index 1e487908e..100b88a25 100644 --- a/src/cpp/ripple/Pathfinder.h +++ b/src/cpp/ripple/Pathfinder.h @@ -3,7 +3,6 @@ #include -#include "SerializedTypes.h" #include "RippleCalc.h" #include "OrderBookDB.h" #include "AccountItems.h" diff --git a/src/cpp/ripple/RPCHandler.h b/src/cpp/ripple/RPCHandler.h index ceb5ea200..c9ece6b4a 100644 --- a/src/cpp/ripple/RPCHandler.h +++ b/src/cpp/ripple/RPCHandler.h @@ -3,7 +3,6 @@ #include -#include "SerializedTypes.h" #include "Ledger.h" #include "NetworkOPs.h" diff --git a/src/cpp/ripple/SerializedLedger.h b/src/cpp/ripple/SerializedLedger.h index de88bfa2b..34a31bc28 100644 --- a/src/cpp/ripple/SerializedLedger.h +++ b/src/cpp/ripple/SerializedLedger.h @@ -1,9 +1,6 @@ #ifndef __SERIALIZEDLEDGER__ #define __SERIALIZEDLEDGER__ -#include "SerializedObject.h" -#include "LedgerFormats.h" - DEFINE_INSTANCE(SerializedLedgerEntry); // VFALCO: TODO, rename this to SerializedLedger diff --git a/src/cpp/ripple/SerializedTransaction.h b/src/cpp/ripple/SerializedTransaction.h index b49c78383..c845ac3bb 100644 --- a/src/cpp/ripple/SerializedTransaction.h +++ b/src/cpp/ripple/SerializedTransaction.h @@ -1,12 +1,7 @@ #ifndef __SERIALIZEDTRANSACTION__ #define __SERIALIZEDTRANSACTION__ -#include - -#include - -#include "SerializedObject.h" -#include "TransactionFormats.h" +// VFALCO: TODO, eliminate these macros #define TXN_SQL_NEW 'N' #define TXN_SQL_CONFLICT 'C' diff --git a/src/cpp/ripple/SerializedValidation.h b/src/cpp/ripple/SerializedValidation.h index f4cf84af7..108761c93 100644 --- a/src/cpp/ripple/SerializedValidation.h +++ b/src/cpp/ripple/SerializedValidation.h @@ -1,8 +1,6 @@ #ifndef __VALIDATION__ #define __VALIDATION__ -#include "SerializedObject.h" - DEFINE_INSTANCE(SerializedValidation); class SerializedValidation : public STObject, private IS_INSTANCE(SerializedValidation) diff --git a/src/cpp/ripple/Transaction.h b/src/cpp/ripple/Transaction.h index 5478c6f42..1ab69c5b0 100644 --- a/src/cpp/ripple/Transaction.h +++ b/src/cpp/ripple/Transaction.h @@ -13,7 +13,6 @@ #include "SHAMap.h" #include "SerializedTransaction.h" -#include "TransactionErr.h" class Database; diff --git a/src/cpp/ripple/TransactionEngine.h b/src/cpp/ripple/TransactionEngine.h index fada6357f..5e427089d 100644 --- a/src/cpp/ripple/TransactionEngine.h +++ b/src/cpp/ripple/TransactionEngine.h @@ -11,7 +11,6 @@ #include "SerializedTransaction.h" #include "SerializedLedger.h" #include "LedgerEntrySet.h" -#include "TransactionErr.h" DEFINE_INSTANCE(TransactionEngine); diff --git a/src/cpp/ripple/TransactionMeta.h b/src/cpp/ripple/TransactionMeta.h index 260e9ff9d..5c04ebec8 100644 --- a/src/cpp/ripple/TransactionMeta.h +++ b/src/cpp/ripple/TransactionMeta.h @@ -6,10 +6,7 @@ #include #include -#include "SerializedTypes.h" -#include "SerializedObject.h" #include "SerializedLedger.h" -#include "TransactionErr.h" class TransactionMetaSet { diff --git a/src/cpp/ripple/Transactor.h b/src/cpp/ripple/Transactor.h index 09fcd892f..0d8638069 100644 --- a/src/cpp/ripple/Transactor.h +++ b/src/cpp/ripple/Transactor.h @@ -1,10 +1,7 @@ #ifndef __TRANSACTOR__ #define __TRANSACTOR__ -#include - #include "SerializedTransaction.h" -#include "TransactionErr.h" #include "TransactionEngine.h" class Transactor