CatapultServer  v0.5.0.1 (Elephant)
LockDurationValidator.h
Go to the documentation of this file.
1 
21 #pragma once
23 
24 namespace catapult { namespace validators {
25 
28 #define DEFINE_LOCK_DURATION_VALIDATOR(VALIDATOR_NAME, NOTIFICATION_TYPE, FAILURE_RESULT) \
29  DECLARE_STATELESS_VALIDATOR(VALIDATOR_NAME, NOTIFICATION_TYPE)(BlockDuration maxDuration) { \
30  using ValidatorType = stateless::FunctionalNotificationValidatorT<NOTIFICATION_TYPE>; \
31  return std::make_unique<ValidatorType>(#VALIDATOR_NAME "Validator", [maxDuration](const auto& notification) { \
32  return BlockDuration(0) != notification.Duration && notification.Duration <= maxDuration \
33  ? ValidationResult::Success \
34  : FAILURE_RESULT; \
35  }); \
36  }
37 }}
ValidationResult.h
catapult
Definition: AddressExtractionExtension.cpp:28