CatapultServer  v0.5.0.1 (Elephant)
SecretLockNotifications.h
Go to the documentation of this file.
1 
21 #pragma once
24 
25 namespace catapult { namespace model {
26 
27  // region secret lock notification types
28 
30 #define DEFINE_SECRET_LOCK_NOTIFICATION(DESCRIPTION, CODE, CHANNEL) DEFINE_NOTIFICATION_TYPE(CHANNEL, LockSecret, DESCRIPTION, CODE)
31 
33  DEFINE_SECRET_LOCK_NOTIFICATION(Secret_Duration, 0x0001, Validator);
34 
36  DEFINE_SECRET_LOCK_NOTIFICATION(Hash_Algorithm, 0x0002, Validator);
37 
39  DEFINE_SECRET_LOCK_NOTIFICATION(Secret, 0x0003, All);
40 
42  DEFINE_SECRET_LOCK_NOTIFICATION(Proof_Secret, 0x0004, Validator);
43 
45  DEFINE_SECRET_LOCK_NOTIFICATION(Proof_Publication, 0x0005, All);
46 
47 #undef DEFINE_SECRET_LOCK_NOTIFICATION
48 
49  // endregion
50 
51  // region SecretLockDurationNotification
52 
54  struct SecretLockDurationNotification : public BaseLockDurationNotification<SecretLockDurationNotification> {
55  public:
57  static constexpr auto Notification_Type = LockSecret_Secret_Duration_Notification;
58 
59  public:
61  };
62 
63  // endregion
64 
65  // region SecretLockHashAlgorithmNotification
66 
69  public:
71  static constexpr auto Notification_Type = LockSecret_Hash_Algorithm_Notification;
72 
73  public:
77  , HashAlgorithm(hashAlgorithm)
78  {}
79 
80  public:
83  };
84 
85  // endregion
86 
87  // region SecretLockNotification
88 
90  struct SecretLockNotification : public BaseLockNotification<SecretLockNotification> {
91  public:
93  static constexpr auto Notification_Type = LockSecret_Secret_Notification;
94 
95  public:
98  const Key& signer,
99  const UnresolvedMosaic& mosaic,
100  BlockDuration duration,
101  LockHashAlgorithm hashAlgorithm,
102  const Hash256& secret,
103  const UnresolvedAddress& recipient)
104  : BaseLockNotification(signer, mosaic, duration)
105  , HashAlgorithm(hashAlgorithm)
106  , Secret(secret)
107  , Recipient(recipient)
108  {}
109 
110  public:
113 
115  const Hash256& Secret;
116 
119  };
120 
121  // endregion
122 
123  // region ProofSecretNotification
124 
127  public:
129  static constexpr auto Notification_Type = LockSecret_Proof_Secret_Notification;
130 
131  public:
133  ProofSecretNotification(LockHashAlgorithm hashAlgorithm, const Hash256& secret, const RawBuffer& proof)
135  , HashAlgorithm(hashAlgorithm)
136  , Secret(secret)
137  , Proof(proof)
138  {}
139 
140  public:
143 
145  const Hash256& Secret;
146 
149  };
150 
151  // endregion
152 
153  // region ProofPublicationNotification
154 
157  public:
159  static constexpr auto Notification_Type = LockSecret_Proof_Publication_Notification;
160 
161  public:
164  const Key& signer,
165  LockHashAlgorithm hashAlgorithm,
166  const Hash256& secret,
167  const UnresolvedAddress& recipient)
169  , Signer(signer)
170  , HashAlgorithm(hashAlgorithm)
171  , Secret(secret)
172  , Recipient(recipient)
173  {}
174 
175  public:
177  const Key& Signer;
178 
181 
183  const Hash256& Secret;
184 
187  };
188 
189  // endregion
190 }}
catapult::model::MosaicT< UnresolvedMosaicId >
catapult::model::ProofSecretNotification::Proof
RawBuffer Proof
Proof.
Definition: SecretLockNotifications.h:148
catapult::model::SecretLockHashAlgorithmNotification::SecretLockHashAlgorithmNotification
SecretLockHashAlgorithmNotification(LockHashAlgorithm hashAlgorithm)
Creates secret lock hash algorithm notification around hashAlgorithm.
Definition: SecretLockNotifications.h:75
catapult::model::ProofPublicationNotification::ProofPublicationNotification
ProofPublicationNotification(const Key &signer, LockHashAlgorithm hashAlgorithm, const Hash256 &secret, const UnresolvedAddress &recipient)
Creates proof publication notification around signer, hashAlgorithm, secret and recipient.
Definition: SecretLockNotifications.h:163
catapult::model::ProofPublicationNotification::Secret
const Hash256 & Secret
Secret.
Definition: SecretLockNotifications.h:183
catapult::model::ProofSecretNotification::Secret
const Hash256 & Secret
Secret.
Definition: SecretLockNotifications.h:145
catapult::model::ProofSecretNotification::ProofSecretNotification
ProofSecretNotification(LockHashAlgorithm hashAlgorithm, const Hash256 &secret, const RawBuffer &proof)
Creates proof secret notification around hashAlgorithm, secret and proof.
Definition: SecretLockNotifications.h:133
catapult::model::SecretLockNotification::Recipient
UnresolvedAddress Recipient
Recipient of the locked mosaic.
Definition: SecretLockNotifications.h:118
catapult::model::ProofSecretNotification::Notification_Type
static constexpr auto Notification_Type
Matching notification type.
Definition: SecretLockNotifications.h:129
catapult::model::ProofSecretNotification
Notification of a secret and its proof.
Definition: SecretLockNotifications.h:126
catapult::model::ProofPublicationNotification::Signer
const Key & Signer
Signer.
Definition: SecretLockNotifications.h:177
catapult::model::ProofPublicationNotification
Notification of a proof publication.
Definition: SecretLockNotifications.h:156
catapult::model::SecretLockDurationNotification::Notification_Type
static constexpr auto Notification_Type
Matching notification type.
Definition: SecretLockNotifications.h:57
catapult::utils::BaseValue< uint64_t, BlockDuration_tag >
LockNotifications.h
catapult::model::SecretLockNotification::Notification_Type
static constexpr auto Notification_Type
Matching notification type.
Definition: SecretLockNotifications.h:93
catapult::model::ProofPublicationNotification::Recipient
UnresolvedAddress Recipient
Recipient of the locked mosaic.
Definition: SecretLockNotifications.h:186
catapult::model::SecretLockHashAlgorithmNotification
Notification of a secret lock hash algorithm.
Definition: SecretLockNotifications.h:68
catapult::model::BaseLockDurationNotification
Base for lock duration notification.
Definition: LockNotifications.h:31
catapult::model::SecretLockDurationNotification
Notification of a secret lock duration.
Definition: SecretLockNotifications.h:54
catapult::model::SecretLockNotification::HashAlgorithm
LockHashAlgorithm HashAlgorithm
Hash algorithm.
Definition: SecretLockNotifications.h:112
catapult::model::ProofPublicationNotification::Notification_Type
static constexpr auto Notification_Type
Matching notification type.
Definition: SecretLockNotifications.h:159
catapult::model::DEFINE_SECRET_LOCK_NOTIFICATION
DEFINE_SECRET_LOCK_NOTIFICATION(Secret_Duration, 0x0001, Validator)
Secret lock duration.
catapult::model::Notification
A basic notification.
Definition: Notifications.h:36
catapult::model::ProofSecretNotification::HashAlgorithm
LockHashAlgorithm HashAlgorithm
Hash algorithm.
Definition: SecretLockNotifications.h:142
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::model::SecretLockNotification
Notification of a secret lock.
Definition: SecretLockNotifications.h:90
catapult::utils::ByteArray< Key_Size, Key_tag >
catapult::model::SecretLockHashAlgorithmNotification::HashAlgorithm
LockHashAlgorithm HashAlgorithm
Hash algorithm.
Definition: SecretLockNotifications.h:82
catapult::model::SecretLockNotification::SecretLockNotification
SecretLockNotification(const Key &signer, const UnresolvedMosaic &mosaic, BlockDuration duration, LockHashAlgorithm hashAlgorithm, const Hash256 &secret, const UnresolvedAddress &recipient)
Creates secret lock notification around signer, mosaic, duration, hashAlgorithm, secret and recipient...
Definition: SecretLockNotifications.h:97
catapult::model::SecretLockNotification::Secret
const Hash256 & Secret
Secret.
Definition: SecretLockNotifications.h:115
catapult::model::BaseLockNotification
Base for lock transaction notification.
Definition: LockNotifications.h:50
catapult::model::LockHashAlgorithm
LockHashAlgorithm
Lock secret hash algorithm.
Definition: LockHashAlgorithm.h:27
catapult::model::ProofPublicationNotification::HashAlgorithm
LockHashAlgorithm HashAlgorithm
Hash algorithm.
Definition: SecretLockNotifications.h:180
LockHashAlgorithm.h
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62
catapult::model::SecretLockHashAlgorithmNotification::Notification_Type
static constexpr auto Notification_Type
Matching notification type.
Definition: SecretLockNotifications.h:71