From c72c521c7662793959bbb3460f844936f052ea14 Mon Sep 17 00:00:00 2001 From: jeremy lee Date: Thu, 6 Jun 2024 00:10:40 +0300 Subject: [PATCH] cleanup unused requestId param. add TODO for renaming squidRoute method --- .../state/model/TradingStateMachine+Squid.kt | 1 + .../state/v2/supervisor/OnboardingSupervisor.kt | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+Squid.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+Squid.kt index ec0831841..cee1a2089 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+Squid.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/model/TradingStateMachine+Squid.kt @@ -39,6 +39,7 @@ internal fun TradingStateMachine.squidV2SdkInfo(payload: String): StateChanges? } } +// TODO: rename this to routerRoute/routerMsg/routerTxPayload internal fun TradingStateMachine.squidRoute( payload: String, subaccountNumber: Int, diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt index a01bc710c..d96713db1 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/OnboardingSupervisor.kt @@ -932,8 +932,7 @@ internal class OnboardingSupervisor( ) helper.post(url, header, body.toJsonPrettyPrint()) { _, response, code, headers -> if (response != null) { - val requestId = helper.parser.asString(headers?.get("x-request-id")) - update(stateMachine.squidRoute(response, subaccountNumber ?: 0, requestId), oldState) + update(stateMachine.squidRoute(response, subaccountNumber ?: 0, null), oldState) } else { Logger.e { "retrieveSkipWithdrawalRouteExchange error, code: $code" } } @@ -987,8 +986,7 @@ internal class OnboardingSupervisor( val oldState = stateMachine.state helper.post(url, header, body.toJsonPrettyPrint()) { _, response, code, headers -> if (response != null) { - val requestId = helper.parser.asString(headers?.get("x-request-id")) - update(stateMachine.squidRoute(response, subaccountNumber ?: 0, requestId), oldState) + update(stateMachine.squidRoute(response, subaccountNumber ?: 0, null), oldState) } else { Logger.e { "retrieveSkipWithdrawalRouteNonCCTP error, code: $code" } } @@ -1046,9 +1044,8 @@ internal class OnboardingSupervisor( if (response != null) { val currentFromAmount = stateMachine.state?.input?.transfer?.size?.size val oldFromAmount = oldState?.input?.transfer?.size?.size - val requestId = helper.parser.asString(headers?.get("x-request-id")) if (currentFromAmount == oldFromAmount) { - update(stateMachine.squidRouteV2(response, subaccountNumber ?: 0, requestId), oldState) + update(stateMachine.squidRoute(response, subaccountNumber ?: 0, null), oldState) } } else { Logger.e { "retrieveSkipWithdrawalRouteCCTP error, code: $code" }