| catapult::observers::DEFINE_OBSERVER (BalanceDebit, model::BalanceDebitNotification, [](const auto ¬ification, const ObserverContext &context) { auto &cache=context.Cache.sub< cache::AccountStateCache >();auto senderIter=cache.find(notification.Sender);auto &senderState=senderIter.get();auto mosaicId=context.Resolvers.resolve(notification.MosaicId);if(NotifyMode::Commit==context.Mode) senderState.Balances.debit(mosaicId, notification.Amount);else senderState.Balances.credit(mosaicId, notification.Amount);}) |