CatapultServer  v0.5.0.1 (Elephant)
Transaction.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "EmbeddedTransaction.h"
23 #include "VerifiableEntity.h"
24 
25 namespace catapult { namespace model { class TransactionRegistry; } }
26 
27 namespace catapult { namespace model {
28 
29 #pragma pack(push, 1)
30 
32  struct Transaction : public VerifiableEntity {
36 
39  };
40 
41 #pragma pack(pop)
42 
45  bool IsSizeValid(const Transaction& transaction, const TransactionRegistry& registry);
46 
47  // region macros
48 
50 #define DEFINE_TRANSACTION_CONSTANTS(TYPE, VERSION) \
51  /* Transaction format version. */ \
52  static constexpr uint8_t Current_Version = VERSION; \
53  /* Transaction type. */ \
54  static constexpr EntityType Entity_Type = TYPE;
55 
57 #define DEFINE_TRANSACTION_VARIABLE_DATA_ACCESSORS(NAME, TYPE) \
58  /* Returns a const pointer to the typed data contained in this transaction. */ \
59  const TYPE* NAME##Ptr() const { \
60  return reinterpret_cast<const TYPE*>(NAME##PtrT(*this)); \
61  } \
62  \
63  /* Returns a pointer to the typed data contained in this transaction. */ \
64  TYPE* NAME##Ptr() { \
65  return reinterpret_cast<TYPE*>(NAME##PtrT(*this)); \
66  }
67 
69 #define DEFINE_EMBEDDABLE_TRANSACTION(NAME) \
70  struct Embedded##NAME##Transaction : public NAME##TransactionBody<model::EmbeddedTransaction> {}; \
71  struct NAME##Transaction : public NAME##TransactionBody<model::Transaction> {};
72 
73  // endregion
74 }}
EmbeddedTransaction.h
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
Transaction.h
colorPrint.warning
def warning(*args)
Definition: colorPrint.py:10
catapult::utils::BaseValue< uint64_t, Amount_tag >
VerifiableEntity.h
catapult::model::Transaction::MaxFee
Amount MaxFee
Definition: Transaction.h:35
TransactionPlugin.h
catapult::model::VerifiableEntity
Binary layout for a verifiable (with signature) entity.
Definition: VerifiableEntity.h:45
catapult::model::IsSizeValid
bool IsSizeValid(const AggregateTransaction &aggregate, const TransactionRegistry &registry)
Definition: AggregateTransaction.cpp:38
catapult::model::Transaction::Deadline
Timestamp Deadline
Transaction deadline.
Definition: Transaction.h:38
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::model::TransactionRegistry
A registry of transaction plugins.
Definition: TransactionPlugin.h:98
Logging.h
catapult::model::SizePrefixedEntity::Size
uint32_t Size
Entity size.
Definition: SizePrefixedEntity.h:33
catapult::model::Transaction
Binary layout for a transaction.
Definition: Transaction.h:32
catapult::model::EntityBody::Type
EntityType Type
Entity type.
Definition: EntityBody.h:42