From d58408733dc1bf8619b7aa170f6439b86ed3b5b0 Mon Sep 17 00:00:00 2001 From: Bill He Date: Thu, 25 Apr 2024 11:46:41 -0700 Subject: [PATCH] address comments --- .../state/manager/StateManagerAdaptor.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt index aef229033..8046e8d73 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt @@ -2437,7 +2437,7 @@ open class StateManagerAdaptor( return compliance.status } - private fun updateCompliance(address: String, status: ComplianceStatus) { + private fun updateCompliance(address: DydxAddress, status: ComplianceStatus) { val message = "Compliance verification message" val action = if ((stateMachine.state?.account?.subaccounts?.size ?: 0) > 0) { ComplianceAction.CONNECT @@ -2470,7 +2470,7 @@ open class StateManagerAdaptor( if (isUrlAndKeysPresent && isStatusValid) { val body: IMap = iMapOf( - "address" to address, + "address" to address.rawAddress, "message" to message, "currentStatus" to status.toString(), "action" to action.toString(), @@ -2507,7 +2507,9 @@ open class StateManagerAdaptor( null, callback = { _, response, httpCode, _ -> val complianceStatus = handleComplianceResponse(response, httpCode) - updateCompliance(address.rawAddress, complianceStatus) + if (address is DydxAddress) { + updateCompliance(address, complianceStatus) + } }, ) }