Skip to content

Conversation

@olpapchenko
Copy link
Contributor

No description provided.

# 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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to move sending notification outside from WalletOperationsProcessor additionally in the frame of this task

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

private val applicationSettingsHolder: ApplicationSettingsHolder,
private val assetsHolder: AssetsHolder,
private val balancesService: BalancesService) {
fun create(logger: Logger?, validate: Boolean = true): WalletOperationsProcessor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused validate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

class BalancesHolder(private val balancesDbAccessorsHolder: BalancesDatabaseAccessorsHolder): BalancesGetter {

companion object {
private val LOGGER = LoggerFactory.getLogger(BalancesHolder::class.java.name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now this logger is unused

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


interface BalancesService {
fun insertOrUpdateWallets(wallets: Collection<Wallet>, messageSequenceNumber: Long?): Boolean
fun sendBalanceUpdate(balanceUpdate: BalanceUpdate)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it actually needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has the value been changed to 0.0 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants