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(wallet)_: fix single chain operation check #5784

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

dlipicar
Copy link
Contributor

@dlipicar dlipicar commented Aug 29, 2024

Fixed a couple of bugs, made some parts of the code tidier:

  • Swap was broken, since this check was skipping all processors other than Transfer for all single chain operations. We're now skipping all bridge processors for single chain operations instead.
  • Parameter isEqual wasn't getting used here, so we were doing pointer comparison here. It was simplified to a== since we check the slices have a single element before anyway.
  • Added functions to group all Bridge and Swap processors, avoiding duplication and easing maintainability when we add providers.

@dlipicar dlipicar requested review from saledjenic and alaibe August 29, 2024 15:39
@status-im-auto
Copy link
Member

status-im-auto commented Aug 29, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 913e2ca #1 2024-08-29 15:42:16 ~2 min tests-rpc 📄log
✔️ 913e2ca #1 2024-08-29 15:44:04 ~4 min linux 📦zip
✔️ 913e2ca #1 2024-08-29 15:44:27 ~4 min ios 📦zip
✔️ 913e2ca #1 2024-08-29 15:45:38 ~6 min android 📦aar
✔️ 913e2ca #1 2024-08-29 16:12:38 ~32 min tests 📄log

Copy link
Contributor

@saledjenic saledjenic left a comment

Choose a reason for hiding this comment

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

This will conflict with this one I guess:
status-im/status-desktop#16204

@@ -317,24 +317,10 @@ func arrayContainsElement[T comparable](el T, arr []T) bool {
return false
}

func arraysWithSameElements[T comparable](ar1 []T, ar2 []T, isEqual func(T, T) bool) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

@dlipicar what I had in mind with this function was to compare DisabledFromChainIDs and DisabledToChainIDs arrays, cause when client sends mainnet chain enabled only it sends for both arrays `[10, 42161], but now since they are converted to "enabled chains" we don't need it I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm not sure if you were planning to use that function in the future (you can re-introduce it then), it didn't make sense where it was used before since we had this check right before calling this
image

@dlipicar dlipicar merged commit dc7ca3d into develop Aug 29, 2024
11 checks passed
@dlipicar dlipicar deleted the fix/fix-single-chain-operation-check branch August 29, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants