From bc93ce5fd22edf684607f45c437310b4a89bfc73 Mon Sep 17 00:00:00 2001 From: Rui <102453770+ruixhuang@users.noreply.github.com> Date: Thu, 24 Oct 2024 06:40:38 -0700 Subject: [PATCH] Fix Skip transfer status (#729) --- build.gradle.kts | 2 +- integration/iOS/Pods/Pods.xcodeproj/project.pbxproj | 1 + .../processor/router/skip/SkipTrackProcessor.kt | 7 +++++-- .../state/v2/supervisor/OnboardingSupervisor.kt | 5 +++++ v4_abacus.podspec | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 803e063c6..3dcdeae58 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,7 +52,7 @@ allprojects { } group = "exchange.dydx.abacus" -version = "1.13.11" +version = "1.13.12" repositories { google() diff --git a/integration/iOS/Pods/Pods.xcodeproj/project.pbxproj b/integration/iOS/Pods/Pods.xcodeproj/project.pbxproj index 9da55c9ba..75609940b 100644 --- a/integration/iOS/Pods/Pods.xcodeproj/project.pbxproj +++ b/integration/iOS/Pods/Pods.xcodeproj/project.pbxproj @@ -714,6 +714,7 @@ en, ); mainGroup = CF1408CF629C7361332E53B88F7BD30C; + minimizedProjectReferenceProxies = 0; productRefGroup = 7D94CDF401128D689D2B11EDCC7ECD3A /* Products */; projectDirPath = ""; projectRoot = ""; diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTrackProcessor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTrackProcessor.kt index b09ef2a68..8a9603fab 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTrackProcessor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/processor/router/skip/SkipTrackProcessor.kt @@ -12,8 +12,11 @@ internal class SkipTrackProcessor( payload: Map ): Map? { val modified = existing?.mutable() ?: mutableMapOf() - val txHash = parser.asString(payload.get("tx_hash")) ?: return modified - modified[txHash] = true + var txHash = parser.asString(payload.get("tx_hash")) ?: return modified + if (!txHash.startsWith("0x")) { + txHash = "0x$txHash" + } + modified[txHash.lowercase()] = true return modified } } 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 a1e18753b..fa4d43183 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 @@ -821,6 +821,7 @@ internal class OnboardingSupervisor( hash: String, fromChainId: String?, ) { + val hash = hash.lowercase() val oldState = stateMachine.state // If transfer is not yet tracked, must track first before querying status val isTracked = oldState?.trackStatuses?.get(hash) == true @@ -855,6 +856,10 @@ internal class OnboardingSupervisor( helper.post(url, null, body.toJsonPrettyPrint()) { _, response, httpCode, _ -> if (response != null) { update(stateMachine.routerTrack(response), oldState) + val isTracked = oldState?.trackStatuses?.get(hash) == true + if (isTracked) { + fetchTransferStatusSkip(hash, fromChainId) + } } } } diff --git a/v4_abacus.podspec b/v4_abacus.podspec index 7150b8710..60af2e47b 100644 --- a/v4_abacus.podspec +++ b/v4_abacus.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'v4_abacus' - spec.version = '1.13.11' + spec.version = '1.13.12' spec.homepage = 'https://github.com/dydxprotocol/v4-abacus' spec.source = { :http=> ''} spec.authors = ''