Skip to content

Commit

Permalink
Merge pull request #13
Browse files Browse the repository at this point in the history
bea3705 RPC: fix sendtrade_OMNI on @dexX7's recommendations (zathras-crypto)
544ee18 mastercore_sp.h: fix missing include for incomplete type CBitcoinAddress (zathras-crypto)
bea8670 senddexsell : allow zero for minimum accept fee (zathras-crypto)
3d7459d Change unsafe trade detection and add override (zathras-crypto)
c191053 RPC encoding : apply min accept fee for target sell in senddexaccept_OMNI (zathras-crypto)
fd6cd48 Encoding: provide access to the Exodus address (dexX7)
7a62a01 Encoding: add encoding documentation and refine code consistency (dexX7)
a9d6f67 Encoding: fix overflow in class C size check, refine includes (dexX7)
4d52ad1 Encoding: test class C embedding of empty payload via unit tests (dexX7)
38dbbaa Encoding: test existence of class C marker via unit tests (dexX7)
7e7bd5d Encoding: test payload creation of known references via unit tests (dexX7)
8409388 Script: test solver with several OP_RETURN sizes via unit tests (dexX7)
913522d Script: use independent solver for script identification (dexX7)
8aa1c10 Script: test getting dust threshold via unit tests (dexX7)
a67ca3c Script: rename and move GetDustLimit to GetDustThreshold (dexX7)
ecc50ec Script: test script extraction via unit tests (dexX7)
3d8ad43 Script: rename and move getOutputType to GetOutputType (dexX7)
cd75837 Script: improve readability and documentation of GetScriptPushes (dexX7)
e911488 Utils: test generation of obfuscated hashes via unit tests (dexX7)
c80abd0 Utils: refine includes and dependencies, improve documentation (dexX7)
56fde5c mastercore.cpp : fix output total for mining fee calc (thanks @dexX7) (zathras-crypto)
9301eb9 Fix class selection size check (dexX7)
a4d8540 Fix class selection on creation - credit @dexX7 (zathras-crypto)
9f3aa31 Fix backwards version/type (zathras-crypto)
aeb2915 [CONSOLIDATE] Makefile changes (zathras-crypto)
0298fd1 [CONSOLIDATE] rpcclient.cpp/h changes (zathras-crypto)
dedc077 [CONSOLIDATE] omnicore_encoding.cpp/h changes (zathras-crypto)
50c5098 [CONSOLIDATE] omnicore_rpctx.cpp/h (zathras-crypto)
369d495 [CONSOLIDATE] omnicore_createpayload.cpp/h (zathras-crypto)
5bb365f [CONSOLIDATE] rpcserver.cpp/h changes (zathras-crypto)
daf5715 [CONSOLIDATE] mastercore.cpp/h changes (zathras-crypto)
a0dfa0b [CONSOLIDATE] mastercore_rpc.cpp/h changes (zathras-crypto)
58a21f2 Fix: strip 2 instead of 4 bytes from OP_RETURN output for marker (zathras-crypto)
fd881a3 Switch to a 2 byte marker (zathras-crypto)
28f8d66 [FIX] - Ensure reference output is added last Reference outputs are added early on in the process, however if there is ever trouble identifying the reference address the highest vout will always be used as per spec, so we should make our reference vouts the highest (by adding them last). (zathras-crypto)
0cbd9f1 [TX CREATION SIMPLIFICATION] - Makefile update (zathras-crypto)
c4612f2 [TX CREATION SIMPLIFICATION] - Mastercore modifications (zathras-crypto)
070a9f2 [TX CREATION SIMPLIFICATION] - OmniCore utils (zathras-crypto)
90a2d55 [TX CREATION SIMPLIFICATION] - OmniCore Encoding (zathras-crypto)
cbe5920 Make classAgnostic_Send return an error if the payload is too big (zathras-crypto)
6407370 Fix maximum OP_RETURN packet size (zathras-crypto)
3e2e6d4 Rename to MIN_PAYLOAD_SIZE and correct value (zathras-crypto)
e56def0 cleanup - disable extra parser debugging (zathras-crypto)
4ae489b Cleanup - remove debugging include (zathras-crypto)
f148cd7 ClassC-0.0.10  fix IsDust for unspendable outputs (zathras-crypto)
c2d23ff ClassC-0.0.10  mastercore_tx (zathras-crypto)
7f49f5c ClassC-0.0.10  mastercore_rpc (zathras-crypto)
a036633 ClassC-0.0.10  mastercore (zathras-crypto)
  • Loading branch information
dexX7 committed May 5, 2015
2 parents b4ba45c + bea3705 commit e7a9a3c
Show file tree
Hide file tree
Showing 29 changed files with 3,112 additions and 1,097 deletions.
12 changes: 10 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ OMNICORE_H = \
mastercore_script.h \
mastercore_sp.h \
mastercore_tx.h \
mastercore_version.h
mastercore_version.h \
omnicore_encoding.h \
omnicore_createpayload.h \
omnicore_rpctx.h \
omnicore_utils.h

OMNICORE_CPP = \
mastercore.cpp \
Expand All @@ -180,7 +184,11 @@ OMNICORE_CPP = \
mastercore_script.cpp \
mastercore_sp.cpp \
mastercore_tx.cpp \
mastercore_version.cpp
mastercore_version.cpp \
omnicore_encoding.cpp \
omnicore_createpayload.cpp \
omnicore_rpctx.cpp \
omnicore_utils.cpp

BITCOIN_CORE_H += \
$(OMNICORE_H)
Expand Down
6 changes: 6 additions & 0 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ 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

Expand Down
1,315 changes: 447 additions & 868 deletions src/mastercore.cpp

Large diffs are not rendered by default.

25 changes: 20 additions & 5 deletions src/mastercore.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#ifndef _MASTERCOIN
#define _MASTERCOIN 1

class CBitcoinAddress;
class CBlockIndex;
class CTransaction;

Expand Down Expand Up @@ -52,6 +53,14 @@ int const MAX_STATE_HISTORY = 50;
#define FORMAT_BOOST_TXINDEXKEY "index-tx-%s"
#define FORMAT_BOOST_SPKEY "sp-%d"

// Omni Layer Transaction Class
#define OMNI_CLASS_A 1
#define OMNI_CLASS_B 2
#define OMNI_CLASS_C 3

// Maximum number of keys supported in Class B
#define CLASS_B_MAX_SENDABLE_PACKETS 2

// Master Protocol Transaction (Packet) Version
#define MP_TX_PKT_V0 0
#define MP_TX_PKT_V1 1
Expand All @@ -61,6 +70,7 @@ int const MAX_STATE_HISTORY = 50;

#define MAX_SHA256_OBFUSCATION_TIMES 255

#define MIN_PAYLOAD_SIZE 8
#define PACKET_SIZE_CLASS_A 19
#define PACKET_SIZE 31
#define MAX_PACKETS 64
Expand Down Expand Up @@ -114,6 +124,7 @@ enum BLOCKHEIGHTRESTRICTIONS {
MSC_BET_BLOCK = 999999,
MSC_MANUALSP_BLOCK= 323230,
P2SH_BLOCK = 322000,
OP_RETURN_BLOCK = 999999
};

enum FILETYPES {
Expand Down Expand Up @@ -153,7 +164,11 @@ std::string FormatMP(unsigned int, int64_t n, bool fSign = false);
uint256 send_MP(const string &FromAddress, const string &ToAddress, const string &RedeemAddress, unsigned int PropertyID, uint64_t Amount);
int64_t feeCheck(const string &address);

const std::string ExodusAddress();
/** Returns the Exodus address. */
const CBitcoinAddress ExodusAddress();

/** Used to indicate, whether to automatically commit created transactions. */
extern bool autoCommit;

extern CCriticalSection cs_tally;

Expand Down Expand Up @@ -392,6 +407,8 @@ extern uint64_t global_balance_reserved_testeco[100000];
int64_t getMPbalance(const string &Address, unsigned int property, TallyType ttype);
int64_t getUserAvailableMPbalance(const string &Address, unsigned int property);
bool IsMyAddress(const std::string &address);
bool isRangeOK(const uint64_t input);
int pendingAdd(const uint256 &txid, const string &FromAddress, unsigned int propId, int64_t Amount, int64_t type, const string &txDesc);

string getLabel(const string &address);

Expand Down Expand Up @@ -429,10 +446,8 @@ bool isCrowdsalePurchase(uint256 txid, string address, int64_t *propertyId = NUL
bool isMPinBlockRange(int starting_block, int ending_block, bool bDeleteFound);
std::string FormatIndivisibleMP(int64_t n);

int ClassB_send(const string &senderAddress, const string &receiverAddress, const string &redemptionAddress, const std::vector<unsigned char> &data, uint256 & txid, int64_t additional = 0);

uint256 send_INTERNAL_1packet(const string &FromAddress, const string &ToAddress, const string &RedeemAddress, unsigned int PropertyID, uint64_t Amount,
unsigned int PropertyID_2, uint64_t Amount_2, unsigned int TransactionType, int64_t additional, int *error_code = NULL);
int ClassAgnosticWalletTXBuilder(const string &senderAddress, const string &receiverAddress, const string &redemptionAddress,
int64_t referenceAmount, const std::vector<unsigned char> &data, uint256 & txid, string &rawHex, bool commit);

bool isTestEcosystemProperty(unsigned int property);
bool isMainEcosystemProperty(unsigned int property);
Expand Down
3 changes: 2 additions & 1 deletion src/mastercore_errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ enum MPRPCErrorCode
MP_INSUF_FUNDS_APENDI = -2, // balance after pending
MP_INPUT_NOT_IN_RANGE = -11, // input value larger than supported

//ClassB_send
//ClassAgnostic_send
MP_INPUTS_INVALID = -212,
MP_ENCODING_ERROR = -250,
MP_REDEMP_ILLEGAL = -233,
MP_REDEMP_BAD_KEYID = -220,
MP_REDEMP_FETCH_ERR_PUBKEY = -221,
Expand Down
Loading

0 comments on commit e7a9a3c

Please sign in to comment.