Skip to content

Commit

Permalink
Merge pull request bitcoin#16
Browse files Browse the repository at this point in the history
dc7c594 Move project files into src/omnicore/ and src/omnicore/test/ (dexX7)
06369cb Update header include guards and test suite names (dexX7)
3cfb5dc Include Omni Core via seperate Makefiles (dexX7)
  • Loading branch information
dexX7 committed May 20, 2015
2 parents abac370 + dc7c594 commit 80596c4
Show file tree
Hide file tree
Showing 59 changed files with 282 additions and 270 deletions.
51 changes: 3 additions & 48 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -152,56 +152,11 @@ JSON_H = \
json/json_spirit_writer.h \
json/json_spirit_writer_template.h

# Omni Core extensions
OMNICORE_H = \
mastercore.h \
mastercore_convert.h \
mastercore_dex.h \
mastercore_errors.h \
mastercore_log.h \
mastercore_mdex.h \
mastercore_parse_string.h \
mastercore_persistence.h \
mastercore_rpc.h \
mastercore_script.h \
mastercore_sp.h \
mastercore_tx.h \
mastercore_version.h \
omnicore_encoding.h \
omnicore_createpayload.h \
omnicore_rpctx.h \
omnicore_utils.h \
omnicore_pending.h

OMNICORE_CPP = \
mastercore.cpp \
mastercore_convert.cpp \
mastercore_dex.cpp \
mastercore_log.cpp \
mastercore_mdex.cpp \
mastercore_parse_string.cpp \
mastercore_persistence.cpp \
mastercore_rpc.cpp \
mastercore_script.cpp \
mastercore_sp.cpp \
mastercore_tx.cpp \
mastercore_version.cpp \
omnicore_encoding.cpp \
omnicore_createpayload.cpp \
omnicore_rpctx.cpp \
omnicore_utils.cpp \
omnicore_pending.cpp

BITCOIN_CORE_H += \
$(OMNICORE_H)
#

obj/build.h: FORCE
@$(MKDIR_P) $(builddir)/obj
@$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
$(abs_top_srcdir)
libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
libbitcoin_common_a-mastercore_version.$(OBJEXT): obj/build.h # Omni Core

# server: shared between bitcoind and bitcoin-qt
libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
Expand Down Expand Up @@ -301,9 +256,9 @@ libbitcoin_common_a_SOURCES = \
script/script_error.cpp \
$(BITCOIN_CORE_H)

# Omni Core extensions
libbitcoin_common_a_SOURCES += \
$(OMNICORE_CPP)
# Omni Core
include Makefile.omnicore.include
#

# util: shared between all executables.
# This library *must* be included to make sure that the glibc
Expand Down
44 changes: 44 additions & 0 deletions src/Makefile.omnicore.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
OMNICORE_H = \
omnicore/convert.h \
omnicore/createpayload.h \
omnicore/dex.h \
omnicore/encoding.h \
omnicore/errors.h \
omnicore/log.h \
omnicore/mdex.h \
omnicore/omnicore.h \
omnicore/parse_string.h \
omnicore/pending.h \
omnicore/persistence.h \
omnicore/rpc.h \
omnicore/rpctx.h \
omnicore/script.h \
omnicore/sp.h \
omnicore/tx.h \
omnicore/utils.h \
omnicore/version.h

OMNICORE_CPP = \
omnicore/convert.cpp \
omnicore/createpayload.cpp \
omnicore/dex.cpp \
omnicore/encoding.cpp \
omnicore/log.cpp \
omnicore/mdex.cpp \
omnicore/omnicore.cpp \
omnicore/parse_string.cpp \
omnicore/pending.cpp \
omnicore/persistence.cpp \
omnicore/rpc.cpp \
omnicore/rpctx.cpp \
omnicore/script.cpp \
omnicore/sp.cpp \
omnicore/tx.cpp \
omnicore/utils.cpp \
omnicore/version.cpp

libbitcoin_server_a_SOURCES += \
$(OMNICORE_CPP) \
$(OMNICORE_H)

libbitcoin_server_a-omnicore/version.$(OBJEXT): obj/build.h # build info
16 changes: 16 additions & 0 deletions src/Makefile.omnitest.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
OMNICORE_TEST_H =

OMNICORE_TEST_CPP = \
omnicore/test/create_payload_tests.cpp \
omnicore/test/encoding_c_tests.cpp \
omnicore/test/obfuscation_tests.cpp \
omnicore/test/rounduint64_tests.cpp \
omnicore/test/script_dust_tests.cpp \
omnicore/test/script_extraction_tests.cpp \
omnicore/test/script_solver_tests.cpp \
omnicore/test/strtoint64_tests.cpp \
omnicore/test/swapbyteorder_tests.cpp

BITCOIN_TESTS += \
$(OMNICORE_TEST_CPP) \
$(OMNICORE_TEST_H)
16 changes: 2 additions & 14 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,8 @@ BITCOIN_TESTS += \
test/rpc_wallet_tests.cpp
endif

# Omni Core extensions
OMNICORE_TESTS = \
test/mastercore_create_payload_tests.cpp \
test/mastercore_encoding_c_tests.cpp \
test/mastercore_obfuscation_tests.cpp \
test/mastercore_rounduint64_tests.cpp \
test/mastercore_script_dust_tests.cpp \
test/mastercore_script_extraction_tests.cpp \
test/mastercore_script_solver_tests.cpp \
test/mastercore_strtoint64_tests.cpp \
test/mastercore_swapbyteorder_tests.cpp

BITCOIN_TESTS += \
$(OMNICORE_TESTS)
# Omni Core tests
include Makefile.omnitest.include
#

test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
Expand Down
2 changes: 1 addition & 1 deletion src/mastercore_convert.cpp → src/omnicore/convert.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "mastercore_convert.h"
#include "omnicore/convert.h"

#include <cmath>
#include <stdint.h>
Expand Down
7 changes: 4 additions & 3 deletions src/mastercore_convert.h → src/omnicore/convert.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef _MASTERCORE_CONVERT
#define _MASTERCORE_CONVERT
#ifndef OMNICORE_CONVERT_H
#define OMNICORE_CONVERT_H

#include <stdint.h>

Expand Down Expand Up @@ -37,4 +37,5 @@ void swapByteOrder64(uint64_t&);
reinterpret_cast<unsigned char *>((ptr)) + (size));
}

#endif // _MASTERCORE_CONVERT

#endif // OMNICORE_CONVERT_H
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// This file serves to provide payload creation functions.

#include "omnicore_createpayload.h"
#include "mastercore_convert.h"
#include "omnicore/createpayload.h"

#include "omnicore/convert.h"

#include <stdint.h>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,5 @@ std::vector<unsigned char> CreatePayload_Revoke(uint32_t propertyId, uint64_t am
std::vector<unsigned char> CreatePayload_ChangeIssuer(uint32_t propertyId);
std::vector<unsigned char> CreatePayload_MetaDExTrade(uint32_t propertyIdForSale, uint64_t amountForSale, uint32_t propertyIdDesired, uint64_t amountDesired, uint8_t action);

#endif // OMNICORE_CREATEPAYLOAD_H






#endif // OMNICORE_CREATEPAYLOAD_H
10 changes: 5 additions & 5 deletions src/mastercore_dex.cpp → src/omnicore/dex.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// DEx & MetaDEx

#include "mastercore_dex.h"
#include "omnicore/dex.h"

#include "mastercore.h"
#include "mastercore_convert.h"
#include "mastercore_errors.h"
#include "mastercore_log.h"
#include "omnicore/convert.h"
#include "omnicore/errors.h"
#include "omnicore/log.h"
#include "omnicore/omnicore.h"

#include "main.h"
#include "tinyformat.h"
Expand Down
10 changes: 5 additions & 5 deletions src/mastercore_dex.h → src/omnicore/dex.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef _MASTERCOIN_DEX
#define _MASTERCOIN_DEX 1
#ifndef OMNICORE_DEX_H
#define OMNICORE_DEX_H

#include "mastercore.h"
#include "mastercore_log.h"
#include "omnicore/log.h"
#include "omnicore/omnicore.h"

#include "amount.h"
#include "tinyformat.h"
Expand Down Expand Up @@ -207,5 +207,5 @@ int DEx_acceptDestroy(const string &buyer, const string &seller, int, bool bForc
int DEx_payment(uint256 txid, unsigned int vout, string seller, string buyer, uint64_t BTC_paid, int blockNow, uint64_t *nAmended = NULL);
}

#endif // #ifndef _MASTERCOIN_DEX

#endif // OMNICORE_DEX_H
8 changes: 4 additions & 4 deletions src/omnicore_encoding.cpp → src/omnicore/encoding.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "omnicore_encoding.h"
#include "omnicore/encoding.h"

#include "mastercore.h"
#include "mastercore_script.h"
#include "omnicore_utils.h"
#include "omnicore/omnicore.h"
#include "omnicore/script.h"
#include "omnicore/utils.h"

#include "base58.h"
#include "pubkey.h"
Expand Down
1 change: 1 addition & 0 deletions src/omnicore_encoding.h → src/omnicore/encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ bool OmniCore_Encode_ClassB(const std::string& senderAddress, const CPubKey& red
/** Embedds a payload in an OP_RETURN output, prefixed with a transaction marker. */
bool OmniCore_Encode_ClassC(const std::vector<unsigned char>& vecPayload, std::vector<std::pair<CScript, int64_t> >& vecOutputs);


#endif // OMNICORE_ENCODING_H
7 changes: 4 additions & 3 deletions src/mastercore_errors.h → src/omnicore/errors.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef _MASTERCOIN_ERRORS
#define _MASTERCOIN_ERRORS 1
#ifndef OMNICORE_ERRORS_H
#define OMNICORE_ERRORS_H

#include <string>

Expand Down Expand Up @@ -83,4 +83,5 @@ inline std::string error_str(int ec) {
return ec_str;
}

#endif // _MASTERCOIN_ERRORS

#endif // OMNICORE_ERRORS_H
2 changes: 1 addition & 1 deletion src/mastercore_log.cpp → src/omnicore/log.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "mastercore_log.h"
#include "omnicore/log.h"

#include "chainparamsbase.h"
#include "util.h"
Expand Down
7 changes: 4 additions & 3 deletions src/mastercore_log.h → src/omnicore/log.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef MASTERCORE_LOG_H
#define MASTERCORE_LOG_H
#ifndef OMNICORE_LOG_H
#define OMNICORE_LOG_H

#include "util.h"
#include "tinyformat.h"
Expand Down Expand Up @@ -81,4 +81,5 @@ TINYFORMAT_FOREACH_ARGNUM(MAKE_OMNI_CORE_ERROR_AND_LOG_FUNC)

#undef MAKE_OMNI_CORE_ERROR_AND_LOG_FUNC

#endif // MASTERCORE_LOG_H

#endif // OMNICORE_LOG_H
10 changes: 5 additions & 5 deletions src/mastercore_mdex.cpp → src/omnicore/mdex.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "mastercore_mdex.h"
#include "omnicore/mdex.h"

#include "mastercore.h"
#include "mastercore_errors.h"
#include "mastercore_log.h"
#include "mastercore_tx.h"
#include "omnicore/errors.h"
#include "omnicore/log.h"
#include "omnicore/omnicore.h"
#include "omnicore/tx.h"

#include "chain.h"
#include "main.h"
Expand Down
7 changes: 4 additions & 3 deletions src/mastercore_mdex.h → src/omnicore/mdex.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef MASTERCORE_MDEX_H
#define MASTERCORE_MDEX_H
#ifndef OMNICORE_MDEX_H
#define OMNICORE_MDEX_H

#include "tinyformat.h"
#include "uint256.h"
Expand Down Expand Up @@ -179,4 +179,5 @@ void MetaDEx_debug_print(bool bShowPriceLevel = false, bool bDisplay = false);
bool MetaDEx_isOpen(const uint256& txid, uint32_t propertyIdForSale = 0);
}

#endif // MASTERCORE_MDEX_H

#endif // OMNICORE_MDEX_H
30 changes: 15 additions & 15 deletions src/mastercore.cpp → src/omnicore/omnicore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
// global TODO: need locks on the maps in this file & balances (moneys[],reserved[] & raccept[]) !!!
//

#include "mastercore.h"

#include "mastercore_convert.h"
#include "mastercore_dex.h"
#include "mastercore_errors.h"
#include "mastercore_log.h"
#include "mastercore_mdex.h"
#include "mastercore_persistence.h"
#include "mastercore_script.h"
#include "mastercore_sp.h"
#include "mastercore_tx.h"
#include "mastercore_version.h"
#include "omnicore_encoding.h"
#include "omnicore_utils.h"
#include "omnicore_pending.h"
#include "omnicore/omnicore.h"

#include "omnicore/convert.h"
#include "omnicore/dex.h"
#include "omnicore/encoding.h"
#include "omnicore/errors.h"
#include "omnicore/log.h"
#include "omnicore/mdex.h"
#include "omnicore/pending.h"
#include "omnicore/persistence.h"
#include "omnicore/script.h"
#include "omnicore/sp.h"
#include "omnicore/tx.h"
#include "omnicore/utils.h"
#include "omnicore/version.h"

#include "base58.h"
#include "chainparams.h"
Expand Down
10 changes: 5 additions & 5 deletions src/mastercore.h → src/omnicore/omnicore.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
//
// for now (?) class declarations go here -- work in progress; probably will get pulled out into a separate file, note: some declarations are still in the .cpp file

#ifndef _MASTERCOIN
#define _MASTERCOIN 1
#ifndef OMNICORE_OMNICORE_H
#define OMNICORE_OMNICORE_H

class CBitcoinAddress;
class CBlockIndex;
class CTransaction;

#include "mastercore_log.h"
#include "mastercore_persistence.h"
#include "omnicore/log.h"
#include "omnicore/persistence.h"

#include "sync.h"
#include "uint256.h"
Expand Down Expand Up @@ -476,5 +476,5 @@ bool parseAlertMessage(std::string rawAlertStr, int32_t *alertType, uint64_t *ex
std::string getTokenLabel(unsigned int propertyId);
}

#endif

#endif // OMNICORE_OMNICORE_H
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "mastercore_parse_string.h"
#include "omnicore/parse_string.h"

#include <boost/lexical_cast.hpp>

Expand Down
Loading

0 comments on commit 80596c4

Please sign in to comment.