From 59ec66f5d9c563b94de7709f00cc0451fd18275d Mon Sep 17 00:00:00 2001 From: jaredvu Date: Tue, 30 Apr 2024 14:26:05 -0700 Subject: [PATCH] detekt rule --- detekt.yml | 3 +++ .../exchange.dydx.abacus/state/model/TradingStateMachine.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/detekt.yml b/detekt.yml index 47438651d..33960f594 100644 --- a/detekt.yml +++ b/detekt.yml @@ -4,6 +4,9 @@ naming: # /exchange -> /dydx -> /abacus # didn't seem worth the potential thrash in PRs to fix (feel free to fix if you feel differently) active: false + MatchingDeclarationName: + # Affects a lot of the TradingStateMachine+_.kt files + active: false complexity: CognitiveComplexMethod: diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine.kt index ccf2456c2..30acd9d4d 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine.kt @@ -1206,7 +1206,7 @@ open class TradingStateMachine( val subaccountHistoricalPnlData = (subaccountHistoricalPnl(subaccountNumber) as? IList>)?.mutable() ?: mutableListOf() - val equity = parser.asDouble(parser.value(subaccount, "equity.current")) + if (subaccountHistoricalPnl?.size == 1) { // Check if the PNL was generated from equity val first = subaccountHistoricalPnl.firstOrNull()