mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Moved cpp code to src/cpp and js code to src/js.
This commit is contained in:
83
src/cpp/ripple/SerializedTransaction.h
Normal file
83
src/cpp/ripple/SerializedTransaction.h
Normal file
@@ -0,0 +1,83 @@
|
||||
#ifndef __SERIALIZEDTRANSACTION__
|
||||
#define __SERIALIZEDTRANSACTION__
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "uint256.h"
|
||||
#include "SerializedObject.h"
|
||||
#include "TransactionFormats.h"
|
||||
#include "RippleAddress.h"
|
||||
#include "InstanceCounter.h"
|
||||
|
||||
#define TXN_SQL_NEW 'N'
|
||||
#define TXN_SQL_CONFLICT 'C'
|
||||
#define TXN_SQL_HELD 'H'
|
||||
#define TXN_SQL_VALIDATED 'V'
|
||||
#define TXN_SQL_INCLUDED 'I'
|
||||
#define TXN_SQL_UNKNOWN 'U'
|
||||
|
||||
DEFINE_INSTANCE(SerializedTransaction);
|
||||
|
||||
class SerializedTransaction : public STObject, private IS_INSTANCE(SerializedTransaction)
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<SerializedTransaction> pointer;
|
||||
typedef const boost::shared_ptr<SerializedTransaction>& ref;
|
||||
|
||||
protected:
|
||||
TransactionType mType;
|
||||
const TransactionFormat* mFormat;
|
||||
|
||||
SerializedTransaction* duplicate() const { return new SerializedTransaction(*this); }
|
||||
|
||||
public:
|
||||
SerializedTransaction(SerializerIterator& sit);
|
||||
SerializedTransaction(TransactionType type);
|
||||
SerializedTransaction(const STObject &object);
|
||||
|
||||
// STObject functions
|
||||
SerializedTypeID getSType() const { return STI_TRANSACTION; }
|
||||
std::string getFullText() const;
|
||||
std::string getText() const;
|
||||
|
||||
// outer transaction functions / signature functions
|
||||
std::vector<unsigned char> getSignature() const;
|
||||
void setSignature(const std::vector<unsigned char>& s) { setFieldVL(sfTxnSignature, s); }
|
||||
uint256 getSigningHash() const;
|
||||
|
||||
TransactionType getTxnType() const { return mType; }
|
||||
STAmount getTransactionFee() const { return getFieldAmount(sfFee); }
|
||||
void setTransactionFee(const STAmount& fee) { setFieldAmount(sfFee, fee); }
|
||||
|
||||
RippleAddress getSourceAccount() const { return getFieldAccount(sfAccount); }
|
||||
std::vector<unsigned char> getSigningPubKey() const { return getFieldVL(sfSigningPubKey); }
|
||||
void setSigningPubKey(const RippleAddress& naSignPubKey);
|
||||
void setSourceAccount(const RippleAddress& naSource);
|
||||
std::string getTransactionType() const { return mFormat->t_name; }
|
||||
|
||||
uint32 getSequence() const { return getFieldU32(sfSequence); }
|
||||
void setSequence(uint32 seq) { return setFieldU32(sfSequence, seq); }
|
||||
|
||||
std::vector<RippleAddress> getAffectedAccounts() const;
|
||||
|
||||
uint256 getTransactionID() const;
|
||||
|
||||
virtual Json::Value getJson(int options) const;
|
||||
|
||||
void sign(const RippleAddress& naAccountPrivate);
|
||||
bool checkSign(const RippleAddress& naAccountPublic) const;
|
||||
bool checkSign() const;
|
||||
|
||||
// SQL Functions
|
||||
static std::string getSQLValueHeader();
|
||||
static std::string getSQLInsertHeader();
|
||||
std::string getSQL(std::string& sql, uint32 inLedger, char status) const;
|
||||
std::string getSQL(uint32 inLedger, char status) const;
|
||||
std::string getSQL(Serializer rawTxn, uint32 inLedger, char status) const;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
// vim:ts=4
|
||||
Reference in New Issue
Block a user