Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rosepuppy committed Apr 25, 2024
1 parent 58e083f commit d584087
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2470,7 +2470,7 @@ open class StateManagerAdaptor(

if (isUrlAndKeysPresent && isStatusValid) {
val body: IMap<String, String> = iMapOf(
"address" to address,
"address" to address.rawAddress,
"message" to message,
"currentStatus" to status.toString(),
"action" to action.toString(),
Expand Down Expand Up @@ -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)
}
},
)
}
Expand Down

0 comments on commit d584087

Please sign in to comment.