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

chore: remove discover mode from hub adapter #966

Open
wants to merge 2 commits into
base: feat/rf-1934-extend-hub-storage
Choose a base branch
from

Conversation

yeager-eren
Copy link
Collaborator

@yeager-eren yeager-eren commented Dec 10, 2024

Summary

Remove DISCOVER_MODE from hub's adapter.

Originally, I didn't want to change the usage of wallets-core in embedded but there is a difference between legacy and hub and that is hub needs to pass namespace for connecting. legacy didn't have the namespace concept at all and you could connect using network. To make these compatible with each other, I created a hardcoded network -> namespace map in adapter.
This works but it's not and ideal way to use and keep. In this PR I removed this mode from hub and did the necessary changes to embedded code (specifically, rango-preset) to have namespace and pass it to hub.

Fixes RF-1967

More notes for reviewer

There are two commits, first commit removed the DISCOVER_MODE from our wallet management. The second commit introduced the concept of namespace to rango-preset so we have both namespace and network from now on.
Then, I directly used whatever rango-preset is returning.

In second commit, you see blockchain has been renamed to namespace and the function signature has been updated accordingly. Also the rest of changes are updating the usage of those functions. embedded also updated to use the namespace returned by rango-preset.

How did you test this change?

This code affected the connect only. There are two types of connect:

  1. Connect the whole wallet (in Wallets page).
  2. Switch network

You can test these changes by try to connect you wallets and also try to test switch network in swap flow. Don't forget to switch network has two scenarios, one, you trying to do a swap and your active network is something else, you will be asked to switch network. The other one is when you are refreshing page on the middle of you swap and swap will reach an state that wants to do you swap and your active network is something else.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Implemented a user interface (UI) change, referencing our Figma design to ensure pixel-perfect precision.

Copy link
Member

@nikaaru nikaaru left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants