CatapultServer  v0.5.0.1 (Elephant)
HashLockNotifications.h
Go to the documentation of this file.
1 
21 #pragma once
23 
24 namespace catapult { namespace model {
25 
26  // region hash lock notification types
27 
29 #define DEFINE_HASH_LOCK_NOTIFICATION(DESCRIPTION, CODE, CHANNEL) DEFINE_NOTIFICATION_TYPE(CHANNEL, LockHash, DESCRIPTION, CODE)
30 
32  DEFINE_HASH_LOCK_NOTIFICATION(Hash_Duration, 0x0001, Validator);
33 
35  DEFINE_HASH_LOCK_NOTIFICATION(Mosaic, 0x0002, Validator);
36 
38  DEFINE_HASH_LOCK_NOTIFICATION(Hash, 0x0003, All);
39 
40 #undef DEFINE_HASH_LOCK_NOTIFICATION
41 
42  // endregion
43 
44  // region HashLockMosaicNotification
45 
48  public:
50  static constexpr auto Notification_Type = LockHash_Mosaic_Notification;
51 
52  public:
56  , Mosaic(mosaic)
57  {}
58 
59  public:
62  };
63 
64  // endregion
65 
66  // region HashLockDurationNotification
67 
69  struct HashLockDurationNotification : public BaseLockDurationNotification<HashLockDurationNotification> {
70  public:
72  static constexpr auto Notification_Type = LockHash_Hash_Duration_Notification;
73 
74  public:
76  };
77 
78  // endregion
79 
80  // region HashLockNotification
81 
83  struct HashLockNotification : public BaseLockNotification<HashLockNotification> {
84  public:
86  static constexpr auto Notification_Type = LockHash_Hash_Notification;
87 
88  public:
90  HashLockNotification(const Key& signer, const UnresolvedMosaic& mosaic, BlockDuration duration, const Hash256& hash)
91  : BaseLockNotification(signer, mosaic, duration)
92  , Hash(hash)
93  {}
94 
95  public:
97  const Hash256& Hash;
98  };
99 
100  // endregion
101 }}
catapult::model::MosaicT< UnresolvedMosaicId >
catapult::model::HashLockMosaicNotification::Mosaic
UnresolvedMosaic Mosaic
Locked mosaic.
Definition: HashLockNotifications.h:61
catapult::model::HashLockDurationNotification
Notification of a hash lock duration.
Definition: HashLockNotifications.h:69
catapult::model::HashLockMosaicNotification
Notification of a hash lock mosaic.
Definition: HashLockNotifications.h:47
ValidatorContext.h
catapult::validators::Notification
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
catapult::model::HashLockMosaicNotification::Notification_Type
static constexpr auto Notification_Type
Matching notification type.
Definition: HashLockNotifications.h:50
MAKE_STATEFUL_VALIDATOR
#define MAKE_STATEFUL_VALIDATOR(NAME, HANDLER)
Definition: ValidatorTypes.h:123
catapult::validators::DECLARE_STATEFUL_VALIDATOR
DECLARE_STATEFUL_VALIDATOR(Address, Notification)(model
Definition: AddressValidator.cpp:29
catapult::model::HashLockDurationNotification::Notification_Type
static constexpr auto Notification_Type
Matching notification type.
Definition: HashLockNotifications.h:72
catapult::utils::BaseValue
Immutable wrapper for basic types, to provide some type-safety.
Definition: BaseValue.h:100
catapult::model::HashLockNotification::HashLockNotification
HashLockNotification(const Key &signer, const UnresolvedMosaic &mosaic, BlockDuration duration, const Hash256 &hash)
Creates hash lock notification around signer, mosaic, duration and hash.
Definition: HashLockNotifications.h:90
LockNotifications.h
catapult::validators::lockedFundsPerAggregate
Amount lockedFundsPerAggregate
Definition: HashLockMosaicValidator.cpp:28
catapult::model::HashLockMosaicNotification::HashLockMosaicNotification
HashLockMosaicNotification(UnresolvedMosaic mosaic)
Creates a notification around mosaic.
Definition: HashLockNotifications.h:54
Validators.h
catapult::model::HashLockNotification
Notification of a hash lock.
Definition: HashLockNotifications.h:83
catapult::model::DEFINE_HASH_LOCK_NOTIFICATION
DEFINE_HASH_LOCK_NOTIFICATION(Hash_Duration, 0x0001, Validator)
Hash lock duration.
catapult::model::HashLockNotification::Hash
const Hash256 & Hash
Hash.
Definition: HashLockNotifications.h:97
catapult::model::BaseLockDurationNotification
Base for lock duration notification.
Definition: LockNotifications.h:31
catapult::model::Mosaic
MosaicT< MosaicId > Mosaic
Definition: Mosaic.h:38
catapult::model::HashLockNotification::Notification_Type
static constexpr auto Notification_Type
Matching notification type.
Definition: HashLockNotifications.h:86
catapult::model::Notification
A basic notification.
Definition: Notifications.h:36
catapult::validators::ValidationResult::Success
Validation succeeded.
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::model::AccountAddressNotification
Notification of use of an account address.
Definition: Notifications.h:57
catapult::utils::ByteArray< Key_Size, Key_tag >
catapult::model::BaseLockNotification
Base for lock transaction notification.
Definition: LockNotifications.h:50