chore: remove discover mode from hub adapter #966
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Remove DISCOVER_MODE from hub's adapter.
Originally, I didn't want to change the usage of
wallets-core
inembedded
but there is a difference between legacy and hub and that is hub needs to passnamespace
for connecting. legacy didn't have the namespace concept at all and you could connect usingnetwork
. To make these compatible with each other, I created a hardcodednetwork
->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
torango-preset
so we have bothnamespace
andnetwork
from now on.Then, I directly used whatever
rango-preset
is returning.In second commit, you see
blockchain
has been renamed tonamespace
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 byrango-preset
.How did you test this change?
This code affected the
connect
only. There are two types ofconnect
: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: