| catapult::observers::DEFINE_OBSERVER (MosaicSupplyChange, Notification, [](const auto ¬ification, const ObserverContext &context) { auto mosaicId=context.Resolvers.resolve(notification.MosaicId);auto &accountStateCache=context.Cache.sub< cache::AccountStateCache >();auto &cache=context.Cache.sub< cache::MosaicCache >();auto accountStateIter=accountStateCache.find(notification.Signer);auto &accountState=accountStateIter.get();auto mosaicIter=cache.find(mosaicId);auto &entry=mosaicIter.get();if(ShouldIncrease(context.Mode, notification.Direction)) { accountState.Balances.credit(mosaicId, notification.Delta);entry.increaseSupply(notification.Delta);} else { accountState.Balances.debit(mosaicId, notification.Delta);entry.decreaseSupply(notification.Delta);} }) |