Conversation
# Conflicts: # src/main/kotlin/com/lykke/matching/engine/balance/WalletOperationsProcessor.kt # src/main/kotlin/com/lykke/matching/engine/holders/BalancesHolder.kt # src/main/kotlin/com/lykke/matching/engine/order/cancel/AbstractLimitOrdersCanceller.kt # src/main/kotlin/com/lykke/matching/engine/order/cancel/GenericLimitOrdersCanceller.kt # src/main/kotlin/com/lykke/matching/engine/order/cancel/GenericLimitOrdersCancellerFactory.kt # src/main/kotlin/com/lykke/matching/engine/order/cancel/LimitOrdersCanceller.kt # src/main/kotlin/com/lykke/matching/engine/order/cancel/StopLimitOrdersCanceller.kt # src/main/kotlin/com/lykke/matching/engine/order/transaction/ExecutionContextFactory.kt # src/main/kotlin/com/lykke/matching/engine/services/CashTransferOperationService.kt # src/main/kotlin/com/lykke/matching/engine/services/ReservedCashInOutOperationService.kt # src/test/kotlin/com/lykke/matching/engine/balance/WalletOperationsProcessorTest.kt # src/test/kotlin/com/lykke/matching/engine/config/TestApplicationContext.kt # src/test/kotlin/com/lykke/matching/engine/performance/AbstractPerformanceTest.kt
# Conflicts: # src/dist/cfg/log4j.properties # src/main/kotlin/com/lykke/matching/engine/balance/WalletOperationsProcessor.kt # src/main/kotlin/com/lykke/matching/engine/holders/BalancesHolder.kt # src/main/kotlin/com/lykke/matching/engine/services/ReservedCashInOutOperationService.kt # src/main/kotlin/com/lykke/matching/engine/utils/balance/ReservedVolumesRecalculator.kt # src/test/kotlin/com/lykke/matching/engine/config/TestApplicationContext.kt
# Conflicts: # src/main/kotlin/com/lykke/matching/engine/services/CashInOutOperationService.kt # src/main/kotlin/com/lykke/matching/engine/services/CashTransferOperationService.kt # src/test/kotlin/com/lykke/matching/engine/config/TestApplicationContext.kt # src/test/kotlin/com/lykke/matching/engine/config/TestExecutionContext.kt # src/test/kotlin/com/lykke/matching/engine/performance/AbstractPerformanceTest.kt
| messageSequenceNumber)) | ||
| } | ||
|
|
||
| fun sendNotification(id: String, type: String, messageId: String) { |
There was a problem hiding this comment.
I propose to move sending notification outside from WalletOperationsProcessor additionally in the frame of this task
| private val applicationSettingsHolder: ApplicationSettingsHolder, | ||
| private val assetsHolder: AssetsHolder, | ||
| private val balancesService: BalancesService) { | ||
| fun create(logger: Logger?, validate: Boolean = true): WalletOperationsProcessor { |
| class BalancesHolder(private val balancesDbAccessorsHolder: BalancesDatabaseAccessorsHolder): BalancesGetter { | ||
|
|
||
| companion object { | ||
| private val LOGGER = LoggerFactory.getLogger(BalancesHolder::class.java.name) |
There was a problem hiding this comment.
Now this logger is unused
|
|
||
| interface BalancesService { | ||
| fun insertOrUpdateWallets(wallets: Collection<Wallet>, messageSequenceNumber: Long?): Boolean | ||
| fun sendBalanceUpdate(balanceUpdate: BalanceUpdate) |
There was a problem hiding this comment.
I propose to split this interface: insertOrUpdateWallets is used only for services used while starting ME, sendBalanceUpdate is used for sending old format messages. There is no reason to keep them in one service.
There was a problem hiding this comment.
sendBalanceUpdate - moved to separate interface implemented by CashInOutOldEventSender
| open fun testBackOfficeDatabaseAccessor(): TestBackOfficeDatabaseAccessor { | ||
| val testBackOfficeDatabaseAccessor = TestBackOfficeDatabaseAccessor() | ||
| testBackOfficeDatabaseAccessor.addAsset(Asset("USD", 2)) | ||
| testBackOfficeDatabaseAccessor.addAsset(Asset("EUR", 4)) |
There was a problem hiding this comment.
Is it actually needed ?
There was a problem hiding this comment.
deduplicated code
| testOrderBookWrapper.addLimitOrder(buildLimitOrder(assetId = "EURJPY", price = 116.356, volume = 1000.0, clientId = "Client3")) | ||
| testBalanceHolderWrapper.updateBalance("Client3", "JPY", 1000.0) | ||
| testBalanceHolderWrapper.updateBalance("Client4", "EUR", 0.00999999999999999) | ||
| testBalanceHolderWrapper.updateBalance("Client4", "EUR", 0.0) |
There was a problem hiding this comment.
Why has the value been changed to 0.0 ?
# Conflicts: # src/test/kotlin/com/lykke/matching/engine/performance/AbstractPerformanceTest.kt
# Conflicts: # src/main/kotlin/com/lykke/matching/engine/outgoing/senders/impl/specialized/CashInOutEventSender.kt # src/main/kotlin/com/lykke/matching/engine/outgoing/senders/impl/specialized/CashInOutOldEventSender.kt # src/main/kotlin/com/lykke/matching/engine/outgoing/senders/impl/specialized/CashTransferEventSender.kt # src/main/kotlin/com/lykke/matching/engine/outgoing/senders/impl/specialized/CashTransferOldEventSender.kt # src/main/kotlin/com/lykke/matching/engine/services/ReservedCashInOutOperationService.kt # src/main/kotlin/com/lykke/matching/engine/utils/balance/ReservedVolumesRecalculator.kt # src/test/kotlin/com/lykke/matching/engine/balance/WalletOperationsProcessorTest.kt # src/test/kotlin/com/lykke/matching/engine/config/TestApplicationContext.kt # src/test/kotlin/com/lykke/matching/engine/config/TestExecutionContext.kt # src/test/kotlin/com/lykke/matching/engine/services/CashInOutOperationServiceTest.kt
No description provided.