CatapultServer  v0.5.0.1 (Elephant)
txes/restriction_account/src/validators/Validators.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "Results.h"
25 
26 namespace catapult { namespace validators {
27 
28 #define DECLARE_SHARED_VALIDATORS(VALUE_NAME) \
29  /* Validator that applies to modify account restriction notifications and validates that: */ \
30  /* - all account restriction modification types are valid */ \
31  DECLARE_STATELESS_VALIDATOR( \
32  Account##VALUE_NAME##RestrictionModificationTypes, \
33  model::ModifyAccount##VALUE_NAME##RestrictionNotification)(); \
34  \
35  /* Validator that applies to modify account restriction notifications and validates that: */ \
36  /* - there is no redundant restriction modification */ \
37  DECLARE_STATEFUL_VALIDATOR( \
38  Account##VALUE_NAME##RestrictionRedundantModification, \
39  model::ModifyAccount##VALUE_NAME##RestrictionNotification)(); \
40  \
41  /* Validator that applies to modify account restriction value notifications and validates that: */ \
42  /* - add modification does not add a known value */ \
43  /* - delete modification does not delete an unknown value */ \
44  DECLARE_STATEFUL_VALIDATOR( \
45  Account##VALUE_NAME##RestrictionValueModification, \
46  model::ModifyAccount##VALUE_NAME##RestrictionValueNotification)(); \
47  \
48  /* Validator that applies to modify account restriction notifications and validates that: */ \
49  /* - the maximum number of modifications (\a maxAccountRestrictionValues) is not exceeded */ \
50  /* - the maximum number of account restriction values (\a maxAccountRestrictionValues) is not exeeded */ \
51  DECLARE_STATEFUL_VALIDATOR(MaxAccount##VALUE_NAME##RestrictionValues, model::ModifyAccount##VALUE_NAME##RestrictionNotification)( \
52  uint16_t maxAccountRestrictionValues);
53 
56  DECLARE_SHARED_VALIDATORS(Operation)
57 
58 
59  DECLARE_STATELESS_VALIDATOR(AccountRestrictionType, model::AccountRestrictionTypeNotification)();
61 
65  model::NetworkIdentifier networkIdentifier);
66 
69  DECLARE_STATEFUL_VALIDATOR(AddressInteraction, model::AddressInteractionNotification)();
70 
74 
77  DECLARE_STATELESS_VALIDATOR(AccountOperationRestrictionModificationValues, model::ModifyAccountOperationRestrictionNotification)();
78 
81  DECLARE_STATEFUL_VALIDATOR(Transaction, model::TransactionNotification)();
82 
86 }}
catapult::model::AccountRestrictionType
AccountRestrictionType
Account restriction types.
Definition: AccountRestrictionTypes.h:31
catapult::model::ModifyAccountOperationRestrictionNotification
ModifyAccountRestrictionNotification< EntityType, RestrictionAccount_Operation_Modifications_Notification > ModifyAccountOperationRestrictionNotification
Definition: AccountRestrictionNotifications.h:168
catapult::model::ModifyAccountAddressRestrictionValueNotification
ModifyAccountRestrictionValueNotification< UnresolvedAddress, RestrictionAccount_Address_Modification_Notification > ModifyAccountAddressRestrictionValueNotification
Definition: AccountRestrictionNotifications.h:115
catapult::model::ModifyAccountOperationRestrictionValueNotification
ModifyAccountRestrictionValueNotification< EntityType, RestrictionAccount_Operation_Modification_Notification > ModifyAccountOperationRestrictionValueNotification
Definition: AccountRestrictionNotifications.h:119
catapult::validators::DECLARE_STATEFUL_VALIDATOR
DECLARE_STATEFUL_VALIDATOR(Address, Notification)(model
Definition: AddressValidator.cpp:29
AccountRestrictionNotifications.h
catapult::validators::BalanceTransferNotification
model::BalanceTransferNotification BalanceTransferNotification
Definition: BalanceValidator.cpp:28
DECLARE_SHARED_VALIDATORS
#define DECLARE_SHARED_VALIDATORS(VALUE_NAME)
Definition: txes/restriction_account/src/validators/Validators.h:28
catapult::model::NetworkIdentifier
NetworkIdentifier
Possible network identifiers.
Definition: NetworkInfo.h:45
ValidatorTypes.h
catapult::validators::DECLARE_STATELESS_VALIDATOR
DECLARE_STATELESS_VALIDATOR(MaxTransactions, Notification)(uint32_t maxTransactions)
Definition: MaxTransactionsValidator.cpp:27
catapult
Definition: AddressExtractionExtension.cpp:28
Results.h