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

Namespaces

 catapult
 
 catapult::observers
 

Functions

 catapult::observers::DEFINE_OBSERVER (SourceChange, model::SourceChangeNotification, [](const auto &notification, auto &context) { if(NotifyMode::Commit !=context.Mode) return;auto &statementBuilder=context.StatementBuilder();model::ReceiptSource newSource(notification.PrimaryId, notification.SecondaryId);const auto &currentSource=statementBuilder.source();if(model::SourceChangeNotification::SourceChangeType::Relative==notification.PrimaryChangeType) newSource.PrimaryId+=currentSource.PrimaryId;if(model::SourceChangeNotification::SourceChangeType::Relative==notification.SecondaryChangeType) newSource.SecondaryId+=currentSource.SecondaryId;statementBuilder.setSource(newSource);})