| catapult::validators::DEFINE_STATEFUL_VALIDATOR (MosaicAvailability, [](const auto ¬ification, 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;}) |