Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Skip transfer status #729

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ allprojects {
}

group = "exchange.dydx.abacus"
version = "1.13.11"
version = "1.13.12"

repositories {
google()
Expand Down
1 change: 1 addition & 0 deletions integration/iOS/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ internal class SkipTrackProcessor(
payload: Map<String, Any>
): Map<String, Any>? {
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure we always want this though, what if the user submits a non EVM transaction? the tx hash may not necessarily start with 0x, right?
@ruixhuang

}
modified[txHash.lowercase()] = true
return modified
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request status right away instead of waiting for the next timer trigger.

}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion v4_abacus.podspec
Original file line number Diff line number Diff line change
@@ -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 = ''
Expand Down