CatapultServer  v0.5.0.1 (Elephant)
MosaicAvailabilityValidator.cpp File Reference
Include dependency graph for MosaicAvailabilityValidator.cpp:

Namespaces

 catapult
 
 catapult::validators
 

Functions

 catapult::validators::DEFINE_STATEFUL_VALIDATOR (MosaicAvailability, [](const auto &notification, const ValidatorContext &context) { const auto &cache=context.Cache.sub< cache::MosaicCache >();auto mosaicIter=cache.find(notification.MosaicId);if(!mosaicIter.tryGet()) return ValidationResult::Success;if(!cache.isActive(notification.MosaicId, context.Height)) return Failure_Mosaic_Expired;const auto &entry=mosaicIter.get();auto requiredPropertyChanged=ContainsRequiredPropertyChange(notification.Properties);if(!requiredPropertyChanged &&entry.definition().isEternal()) return Failure_Mosaic_Modification_No_Changes;return Amount() !=entry.supply() ? Failure_Mosaic_Modification_Disallowed :ValidationResult::Success;})