CatapultServer  v0.5.0.1 (Elephant)
LockDurationValidator.h File Reference
Include dependency graph for LockDurationValidator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 catapult
 
 catapult::validators
 

Macros

#define DEFINE_LOCK_DURATION_VALIDATOR(VALIDATOR_NAME, NOTIFICATION_TYPE, FAILURE_RESULT)
 

Macro Definition Documentation

◆ DEFINE_LOCK_DURATION_VALIDATOR

#define DEFINE_LOCK_DURATION_VALIDATOR (   VALIDATOR_NAME,
  NOTIFICATION_TYPE,
  FAILURE_RESULT 
)
Value:
DECLARE_STATELESS_VALIDATOR(VALIDATOR_NAME, NOTIFICATION_TYPE)(BlockDuration maxDuration) { \
using ValidatorType = stateless::FunctionalNotificationValidatorT<NOTIFICATION_TYPE>; \
return std::make_unique<ValidatorType>(#VALIDATOR_NAME "Validator", [maxDuration](const auto& notification) { \
return BlockDuration(0) != notification.Duration && notification.Duration <= maxDuration \
? ValidationResult::Success \
: FAILURE_RESULT; \
}); \
}

Defines a lock duration validator with name VALIDATOR_NAME for notification NOTIFICATION_TYPE that returns FAILURE_RESULT on failure.

catapult::BlockDuration
utils::BaseValue< uint64_t, BlockDuration_tag > BlockDuration
Definition: src/catapult/types.h:88
DECLARE_STATELESS_VALIDATOR
#define DECLARE_STATELESS_VALIDATOR(NAME, NOTIFICATION_TYPE)
Declares a stateless validator with NAME for notifications of type NOTIFICATION_TYPE.
Definition: ValidatorTypes.h:96