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