CatapultServer  v0.5.0.1 (Elephant)
SecretProofTransaction.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "LockHashAlgorithm.h"
23 #include "SecretLockEntityType.h"
25 
26 namespace catapult { namespace model {
27 
28 #pragma pack(push, 1)
29 
31  template<typename THeader>
32  struct SecretProofTransactionBody : public THeader {
33  private:
35 
36  public:
37  DEFINE_TRANSACTION_CONSTANTS(Entity_Type_Secret_Proof, 1)
38 
39  public:
42 
45 
48 
50  uint16_t ProofSize;
51 
52  // followed by proof data if ProofSize != 0
54 
55  private:
56  template<typename T>
57  static auto* ProofPtrT(T& transaction) {
58  return transaction.ProofSize ? THeader::PayloadStart(transaction) : nullptr;
59  }
60 
61  public:
62  // Calculates the real size of secret proof \a transaction.
63  static constexpr uint64_t CalculateRealSize(const TransactionType& transaction) noexcept {
64  return sizeof(TransactionType) + transaction.ProofSize;
65  }
66  };
67 
69 
70 #pragma pack(pop)
71 }}
Transaction.h
catapult::model::SecretProofTransactionBody::ProofSize
uint16_t ProofSize
Proof size in bytes.
Definition: SecretProofTransaction.h:50
catapult::model::SecretProofTransactionBody::CalculateRealSize
static constexpr uint64_t CalculateRealSize(const TransactionType &transaction) noexcept
Definition: SecretProofTransaction.h:63
DEFINE_EMBEDDABLE_TRANSACTION
#define DEFINE_EMBEDDABLE_TRANSACTION(NAME)
Defines a transaction with NAME that supports embedding.
Definition: Transaction.h:69
catapult::model::SecretProofTransactionBody
Binary layout for a secret proof transaction body.
Definition: SecretProofTransaction.h:32
catapult::model::SecretProofTransactionBody::Secret
Hash256 Secret
Secret.
Definition: SecretProofTransaction.h:44
catapult::model::SecretProofTransactionBody::HashAlgorithm
LockHashAlgorithm HashAlgorithm
Hash algorithm.
Definition: SecretProofTransaction.h:41
SecretLockEntityType.h
catapult::model::SecretProofTransactionBody::ProofPtrT
static auto * ProofPtrT(T &transaction)
Definition: SecretProofTransaction.h:57
DEFINE_TRANSACTION_CONSTANTS
#define DEFINE_TRANSACTION_CONSTANTS(TYPE, VERSION)
Defines constants for a transaction with TYPE and VERSION.
Definition: Transaction.h:50
catapult::model::SecretProofTransactionBody::Recipient
UnresolvedAddress Recipient
Recipient of the locked mosaic.
Definition: SecretProofTransaction.h:47
catapult
Definition: AddressExtractionExtension.cpp:28
DEFINE_TRANSACTION_VARIABLE_DATA_ACCESSORS
#define DEFINE_TRANSACTION_VARIABLE_DATA_ACCESSORS(NAME, TYPE)
Defines NAME (TYPE typed) variable data accessors around a similarly named templated untyped data acc...
Definition: Transaction.h:57
catapult::model::SecretProofTransactionBody::TransactionType
SecretProofTransactionBody< THeader > TransactionType
Definition: SecretProofTransaction.h:34
catapult::utils::ByteArray< Hash256_Size, Hash256_tag >
catapult::model::LockHashAlgorithm
LockHashAlgorithm
Lock secret hash algorithm.
Definition: LockHashAlgorithm.h:27
LockHashAlgorithm.h