Work in progress on offers and ripple.

This commit is contained in:
Arthur Britto
2012-07-07 14:34:42 -07:00
parent 5cf06d45a0
commit 4b20162e7f
11 changed files with 447 additions and 77 deletions

View File

@@ -19,7 +19,10 @@ enum TransactionEngineResult
tenBAD_ADD_AUTH,
tenBAD_AMOUNT,
tenBAD_CLAIM_ID,
tenBAD_EXPIRATION,
tenBAD_GEN_AUTH,
tenBAD_ISSUER,
tenBAD_OFFER,
tenBAD_SET_ID,
tenCREATEXNS,
tenDST_IS_SRC,
@@ -33,6 +36,7 @@ enum TransactionEngineResult
tenBAD_AUTH_MASTER,
tenBAD_RIPPLE,
tenCREATED,
tenEXPIRED,
tenMSG_SET,
terALREADY,
@@ -62,6 +66,7 @@ enum TransactionEngineResult
terNO_DST,
terNO_LINE_NO_ZERO,
terNO_PATH,
terOFFER_NOT_FOUND,
terOVER_LIMIT,
terPAST_LEDGER,
terPAST_SEQ,
@@ -106,6 +111,29 @@ private:
const uint256& uBase, // Key of item.
const uint256& uLedgerIndex); // Item being deleted
#ifdef WORK_IN_PROGRESS
typedef struct {
STAmount saWanted; // What this node wants from upstream.
STAmount saIOURedeem; // What this node will redeem downstream.
STAmount saIOUIssue; // What this node will issue downstream.
STAmount saSend; // Amount of stamps this node will send.
STAmount saIOUForgive; // Amount of IOUs to forgive.
STAmount saIOUAccept; // Amount of IOUs to accept.
STAmount saRecieve; // Amount stamps to receive.
STAccount saAccount;
} paymentNode;
typedef struct {
boost::unordered_set<....> offersDeletedAlways;
boost::unordered_set<....> offersDeletedOnSuccess;
std::vector<paymentNode> vpnNodes;
bool bAllowPartial;
} paymentGroup;
#endif
TransactionEngineResult setAuthorized(const SerializedTransaction& txn, std::vector<AffectedAccount>& accounts, bool bMustSetGenerator);
protected:
@@ -118,7 +146,10 @@ protected:
const uint160& uSrcAccountID);
TransactionEngineResult doDelete(const SerializedTransaction& txn, std::vector<AffectedAccount>& accounts);
TransactionEngineResult doInvoice(const SerializedTransaction& txn, std::vector<AffectedAccount>& accounts);
TransactionEngineResult doOffer(const SerializedTransaction& txn, std::vector<AffectedAccount>& accounts);
TransactionEngineResult doOffer(const SerializedTransaction& txn, std::vector<AffectedAccount>& accounts,
const uint160& uSrcAccountID);
TransactionEngineResult doOfferCancel(const SerializedTransaction& txn, std::vector<AffectedAccount>& accounts,
const uint160& uSrcAccountID);
TransactionEngineResult doNicknameSet(const SerializedTransaction& txn, std::vector<AffectedAccount>& accounts,
const uint160& uSrcAccountID);
TransactionEngineResult doPasswordFund(const SerializedTransaction& txn, std::vector<AffectedAccount>& accounts,