CatapultServer  v0.5.0.1 (Elephant)
TransferNotifications.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "catapult/model/Mosaic.h"
24 
25 namespace catapult { namespace model {
26 
27  // region transfer notification types
28 
30 #define DEFINE_TRANSFER_NOTIFICATION(DESCRIPTION, CODE, CHANNEL) DEFINE_NOTIFICATION_TYPE(CHANNEL, Transfer, DESCRIPTION, CODE)
31 
33  DEFINE_TRANSFER_NOTIFICATION(Message, 0x001, Validator);
34 
36  DEFINE_TRANSFER_NOTIFICATION(Mosaics, 0x002, Validator);
37 
38 #undef DEFINE_TRANSFER_NOTIFICATION
39 
40  // endregion
41 
42  // region TransferMessageNotification
43 
46  public:
48  static constexpr auto Notification_Type = Transfer_Message_Notification;
49 
50  public:
52  explicit TransferMessageNotification(uint16_t messageSize)
54  , MessageSize(messageSize)
55  {}
56 
57  public:
59  uint16_t MessageSize;
60  };
61 
62  // endregion
63 
64  // region TransferMosaicsNotification
65 
68  public:
70  static constexpr auto Notification_Type = Transfer_Mosaics_Notification;
71 
72  public:
74  TransferMosaicsNotification(uint8_t mosaicsCount, const UnresolvedMosaic* pMosaics)
76  , MosaicsCount(mosaicsCount)
77  , MosaicsPtr(pMosaics)
78  {}
79 
80  public:
82  uint8_t MosaicsCount;
83 
86  };
87 
88  // endregion
89 }}
catapult::model::TransferMessageNotification
Notification of a transfer transaction with a message.
Definition: TransferNotifications.h:45
Mosaic.h
Validators.h
catapult::model::MosaicT< UnresolvedMosaicId >
catapult::model::TransferMosaicsNotification::TransferMosaicsNotification
TransferMosaicsNotification(uint8_t mosaicsCount, const UnresolvedMosaic *pMosaics)
Creates a notification around mosaicsCount and pMosaics.
Definition: TransferNotifications.h:74
catapult::model::DEFINE_TRANSFER_NOTIFICATION
DEFINE_TRANSFER_NOTIFICATION(Message, 0x001, Validator)
Transfer was received with a message.
catapult::validators::Notification
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
catapult::validators::MAKE_STATELESS_VALIDATOR
for(const auto &name :reservedRootNamespaceNames) reservedRootIds.emplace(model return MAKE_STATELESS_VALIDATOR(NamespaceName,([maxNameSize, reservedRootIds](const auto &notification) { if(maxNameSize< notification.NameSize||!model::IsValidName(notification.NamePtr, notification.NameSize)) return Failure_Namespace_Invalid_Name;auto name=utils::RawString(reinterpret_cast< const char * >(notification.NamePtr), notification.NameSize);if(notification.NamespaceId !=model::GenerateNamespaceId(notification.ParentId, name)) return Failure_Namespace_Name_Id_Mismatch;auto namespaceId=Namespace_Base_Id==notification.ParentId ? notification.NamespaceId :notification.ParentId;if(reservedRootIds.cend() !=reservedRootIds.find(namespaceId)) return Failure_Namespace_Root_Name_Reserved;return ValidationResult::Success;}))
Definition: NamespaceNameValidator.cpp:36
catapult::model::TransferMessageNotification::TransferMessageNotification
TransferMessageNotification(uint16_t messageSize)
Creates a notification around messageSize.
Definition: TransferNotifications.h:52
Message
std::string Message
Definition: RawFile.cpp:72
catapult::model::TransferMosaicsNotification::Notification_Type
static constexpr auto Notification_Type
Matching notification type.
Definition: TransferNotifications.h:70
catapult::model::TransferMosaicsNotification
Notification of a transfer transaction with mosaics.
Definition: TransferNotifications.h:67
Notifications.h
catapult::model::TransferMosaicsNotification::MosaicsCount
uint8_t MosaicsCount
Number of mosaics.
Definition: TransferNotifications.h:82
catapult::model::TransferMessageNotification::MessageSize
uint16_t MessageSize
Message size in bytes.
Definition: TransferNotifications.h:59
catapult::model::TransferMessageNotification::Notification_Type
static constexpr auto Notification_Type
Matching notification type.
Definition: TransferNotifications.h:48
catapult::model::Notification
A basic notification.
Definition: Notifications.h:36
catapult::validators::ValidationResult::Success
Validation succeeded.
catapult::validators::DECLARE_STATELESS_VALIDATOR
DECLARE_STATELESS_VALIDATOR(MaxTransactions, Notification)(uint32_t maxTransactions)
Definition: MaxTransactionsValidator.cpp:27
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::model::AccountAddressNotification
Notification of use of an account address.
Definition: Notifications.h:57
catapult::validators::DEFINE_STATELESS_VALIDATOR
DEFINE_STATELESS_VALIDATOR(TransactionFee, [](const auto &notification) { if(notification.Fee > notification.MaxFee) return Failure_Core_Invalid_Transaction_Fee;constexpr auto Max_Raw_Block_Fee_Multiplier=static_cast< uint64_t >(std::numeric_limits< BlockFeeMultiplier::ValueType >::max());return notification.MaxFee.unwrap() > Max_Raw_Block_Fee_Multiplier *notification.TransactionSize ? Failure_Core_Invalid_Transaction_Fee :ValidationResult::Success;})
catapult::model::TransferMosaicsNotification::MosaicsPtr
const UnresolvedMosaic * MosaicsPtr
Const pointer to the first mosaic.
Definition: TransferNotifications.h:85