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

[Feature] Wallet - Network based assets and fiat balance calculation #19150

Merged
merged 5 commits into from
Apr 5, 2024

Conversation

smohamedjavid
Copy link
Member

@smohamedjavid smohamedjavid commented Mar 8, 2024

fixes #18418
fixes #18419
fixes #18972

Additionally fixes #18067

Summary

This PR
(UI changes)

  • adds the feature to filter assets (tokens and collectibles) and balances based on networks
  • fixes network color for eth not shown on the multichain address (e.g. Account Options bottom sheet)
  • fixes blur type in the confirm button in the network preferences sheet
  • fixes the User able to unselect all networks in the network preferences sheet
  • fixes account address and color not shown in network-preferences sheet on Shell > Share Multichain address
  • added STT token image

(Non-UI changes)

  • Refactors the functions used for balance calculations and network details
Network.Filter.mp4
Shell.-.Share.Address.mp4

Testing notes

This PR does a refactor of Wallet in various places (more importantly on the balance calculation). Please do a regression test and if any bug is discovered, please verify it against the latest develop.

Platforms

  • Android
  • iOS

Steps to test

Prerequisites: Make sure you have tokens/collectibles in all three networks

  • Open Status
  • Log in to your profile
  • Navigate to the Wallet tab/home
  • Tap on the Network Selector (on the right, next to aggregated balance)
  • Verify the balances displayed next to the network name are correct
  • Update the networks to your preferred choice
  • Verify the assets displayed in the home reflect the network you have selected
  • Navigate to the account screen by tapping on any account card
  • Verify the selected network are same as in the home screen
  • Verify the assets displayed reflect the networks you have selected
  • Tap on the Network Selector (in the navigation bar)
  • Verify the balances displayed next to the network name are correct
  • Navigate back and switch tab to Communities or Chat Home
  • Navigate to the Wallet Tab and Verify the networks reset to default all networks
  • Switch to Testnet mode and verify STT token image is shown
  • Navigate to Shell > Share and Tap on the Wallet tab
  • Switch to Multichain tab on any account
  • Try to edit the networks
  • Verify the account color and address match the account you have selected in the slider

status: Ready

@smohamedjavid smohamedjavid self-assigned this Mar 8, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Mar 8, 2024

Jenkins Builds

Click to see older builds (42)
Commit #️⃣ Finished (UTC) Duration Platform Result
df9b3f8 #1 2024-03-08 15:03:47 ~2 min tests 📄log
✔️ df9b3f8 #1 2024-03-08 15:09:25 ~7 min android-e2e 🤖apk 📲
✔️ df9b3f8 #1 2024-03-08 15:09:42 ~8 min android 🤖apk 📲
✔️ df9b3f8 #1 2024-03-08 15:12:48 ~11 min ios 📱ipa 📲
✔️ 06e697e #2 2024-03-13 15:05:38 ~7 min android-e2e 🤖apk 📲
06e697e #2 2024-03-13 15:05:40 ~7 min tests 📄log
✔️ 06e697e #2 2024-03-13 15:05:59 ~7 min android 🤖apk 📲
✔️ 06e697e #2 2024-03-13 15:10:26 ~12 min ios 📱ipa 📲
✔️ 204ad8c #3 2024-03-13 15:37:09 ~7 min ios 📱ipa 📲
✔️ 204ad8c #3 2024-03-13 15:38:46 ~9 min android-e2e 🤖apk 📲
✔️ 204ad8c #3 2024-03-13 15:41:31 ~12 min android 🤖apk 📲
✔️ 4a2a85c #4 2024-03-13 19:29:29 ~5 min tests 📄log
✔️ 4a2a85c #4 2024-03-13 19:30:53 ~7 min android-e2e 🤖apk 📲
✔️ 4a2a85c #4 2024-03-13 19:30:59 ~7 min android 🤖apk 📲
✔️ 4a2a85c #4 2024-03-13 19:31:59 ~8 min ios 📱ipa 📲
✔️ d85ed44 #5 2024-03-14 16:01:06 ~5 min tests 📄log
✔️ d85ed44 #5 2024-03-14 16:03:35 ~8 min android 🤖apk 📲
✔️ d85ed44 #5 2024-03-14 16:03:42 ~8 min android-e2e 🤖apk 📲
✔️ d85ed44 #5 2024-03-14 16:03:52 ~8 min ios 📱ipa 📲
✔️ a194746 #6 2024-03-14 16:39:31 ~6 min tests 📄log
✔️ a194746 #6 2024-03-14 16:41:10 ~8 min ios 📱ipa 📲
✔️ a194746 #6 2024-03-14 16:41:43 ~8 min android-e2e 🤖apk 📲
✔️ a194746 #6 2024-03-14 16:41:47 ~9 min android 🤖apk 📲
✔️ 4b21453 #7 2024-03-18 11:20:25 ~5 min tests 📄log
✔️ 4b21453 #7 2024-03-18 11:22:07 ~7 min android-e2e 🤖apk 📲
✔️ 4b21453 #7 2024-03-18 11:22:14 ~7 min android 🤖apk 📲
✔️ 4b21453 #7 2024-03-18 11:22:50 ~8 min ios 📱ipa 📲
✔️ c0fcd8c #8 2024-03-20 11:32:10 ~6 min tests 📄log
✔️ c0fcd8c #8 2024-03-20 11:32:35 ~6 min android 🤖apk 📲
✔️ c0fcd8c #8 2024-03-20 11:33:03 ~7 min android-e2e 🤖apk 📲
✔️ c0fcd8c #8 2024-03-20 11:40:14 ~14 min ios 📱ipa 📲
✔️ dc95166 #9 2024-03-21 10:00:37 ~6 min tests 📄log
✔️ dc95166 #9 2024-03-21 10:02:18 ~8 min android-e2e 🤖apk 📲
✔️ dc95166 #9 2024-03-21 10:02:25 ~8 min android 🤖apk 📲
✔️ dc95166 #9 2024-03-21 10:03:18 ~9 min ios 📱ipa 📲
✔️ 49b59a3 #10 2024-03-26 15:37:36 ~7 min android 🤖apk 📲
✔️ 49b59a3 #10 2024-03-26 15:37:46 ~7 min android-e2e 🤖apk 📲
✔️ 49b59a3 #10 2024-03-26 15:39:25 ~8 min ios 📱ipa 📲
✔️ dd4a4bb #11 2024-04-02 12:40:21 ~4 min tests 📄log
✔️ dd4a4bb #11 2024-04-02 12:44:18 ~8 min android-e2e 🤖apk 📲
✔️ dd4a4bb #11 2024-04-02 12:44:24 ~8 min android 🤖apk 📲
✔️ dd4a4bb #11 2024-04-02 12:46:35 ~10 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 216bac7 #12 2024-04-03 14:17:06 ~4 min tests 📄log
✔️ 216bac7 #12 2024-04-03 14:20:48 ~8 min android-e2e 🤖apk 📲
✔️ 216bac7 #12 2024-04-03 14:20:56 ~8 min android 🤖apk 📲
✔️ 216bac7 #12 2024-04-03 14:21:52 ~9 min ios 📱ipa 📲
✔️ 7fe4cfa #13 2024-04-05 11:42:32 ~4 min tests 📄log
✔️ 7fe4cfa #13 2024-04-05 11:46:20 ~8 min android-e2e 🤖apk 📲
✔️ 7fe4cfa #13 2024-04-05 11:46:21 ~8 min android 🤖apk 📲
✔️ 7fe4cfa #13 2024-04-05 11:47:03 ~9 min ios 📱ipa 📲

@smohamedjavid smohamedjavid force-pushed the feature/wallet-network-filter branch 4 times, most recently from 4a2a85c to d85ed44 Compare March 14, 2024 15:55
currency-symbol (rf/sub [:profile/currency-symbol])
all-balances (:balances-per-chain token)
balance-for-chain (utils/get-balance-for-chain all-balances chain-id)
crypto-formatted (or (:balance balance-for-chain) "0.00")
Copy link
Member Author

Choose a reason for hiding this comment

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

For some reason, this screen was using the balance key which we shouldn't. Instead, we should rely on raw-balance. So, updated it.

(get chain-id-map short-name)))
mainnet-chain-id))

(defn network->chain-id
Copy link
Member Author

Choose a reason for hiding this comment

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

Now this method accepts both network short (opt) and full name (optimism).

@@ -0,0 +1,9 @@
(ns status-im.contexts.wallet.db
Copy link
Member Author

Choose a reason for hiding this comment

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

Created a ns for wallet-related app-db defaults.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @smohamedjavid

I'm a bit against this abstraction, I think it's too soon to add it and probably we don't need it.

I don't see a benefit here from marking this as :const, probably we are over :const-ing stuff? I've had problems while reloading some namespaces in the REPL because consts aren't allowed to re-evaluate 🤔 but probably it's just me.

The main reason I'm against is that it hides the keys used, we must navigate to this namespace to know the actual values, this might lead to bugs or unexpected cases since it's easier to forget what are the involved keys, for example, while writing a new event that involves updating an existing map. I believe keys used in event/sub handlers shouldn't be decoupled since they give the whole context and our db is not small.

Additionally, the values written here are totally derived from status-im.constants, I think we could just add a def (or even let) in the namespace/function we want to use it.

cc-ing @J-Son89 to get another perspective.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm a bit against this abstraction, I think it's too soon to add it and probably we don't need it.

The intention is to make a separate def for default values which can be used all over the codebase like when initializing the app-db (with defaults for specific keys), events that reset value and testing those events.

I don't see a benefit here from marking this as :const, probably we are over :const-ing stuff?

I didn't know this caused an issue in REPL 🙏 . We can remove the :const and make it a simple def. 👍

The main reason I'm against is that it hides the keys used, we must navigate to this namespace to know the actual values, this might lead to bugs or unexpected cases since it's easier to forget what are the involved keys, for example, while writing a new event that involves updating an existing map. I believe keys used in event/sub handlers shouldn't be decoupled since they give the whole context and our db is not small.

I felt not to crowd the status-im.db ns. Most of the time, we use REPL (to print app-db) or Re-frisk to see the structure of app-db. Additionally, the default values don't mean those are the only keys in the app-db. For instance, we have defaults for the activity centre and that is not the only key that will be there after login.

I'm fine to remove this ns and use the key value directly. It's just that it will be repetitive across the codebase. and any changes require updates on all places (if not done properly, may introduce bugs as well).

Let me know your thoughts.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's just that it will be repetitive across the codebase. and any changes require updates on all places (if not done properly, may introduce bugs as well).

I know, I've had this same problem in different apps I've built using re-frame. I use an IntelliJ feature that returns all the usages of a keyword, but I know, it may still create bugs 🤔

It's just that it will be repetitive across the codebase.

Sometimes I think we over abstract, I've seen components with a constants ns only containing some vars being used in its style ns and they could be defined in the same style ns.

I've also seen a component being spread across many files, each file containing a piece for the main component, I know that's a pattern in JS, but in CLJS we don't always do that.

I prefer to abstract when I clearly see theres a use that will be repeated too constatly, and when the abstraction really makes things easier.

In this case, if you believe abstracting makes things easier, go ahead please.

@@ -27,11 +17,17 @@
:description (i18n/label :t/here-is-a-cat-in-a-box-instead)
:image (resources/get-themed-image :cat-in-box theme)
:container-style style/empty-container-style}]
[gesture/flat-list
Copy link
Member Author

@smohamedjavid smohamedjavid Mar 14, 2024

Choose a reason for hiding this comment

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

Since the parent already uses a scroll view and we had to remove the flat list as it was throwing the error:

VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead.

Now, it uses the plain old for loop to render the account items.

Copy link
Contributor

Choose a reason for hiding this comment

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

Two things:

  1. If the parent is always a scroll-view, we can replace the rn/view wrapping this (doall ...) by [:<>] and provide its styles to the scroll-view (inside :content-container-style I think)

  2. If we aren't dyncamically deref-ing an ratom inside this lazy seq (created by for), we can omit the doall and keep it lazy, otherwhise, if we need to realize this seq, then we could use into so that we no longer need the meta :key given, something like:

(into [:<>] ;; or rn/view
      (map (fn [{:keys [color address] :as account}]
             [quo/account-item {,,,}]))
      other-accounts)

Copy link
Member Author

Choose a reason for hiding this comment

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

If the parent is always a scroll-view, we can replace the rn/view wrapping this (doall ...) by [:<>] and provide its styles to the scroll-view (inside :content-container-style I think)

We can't apply that style to the scroll view as it will affect the whole page.

I guess the second point is the way to go given that we don't deref any ratom.

:<- [:wallet/current-viewing-account]
:<- [:wallet/network-details]
(fn [[account networks] [_ query]]
(let [tokens (map (fn [token]
(assoc token
:networks (utils/network-list token networks)
:total-balance (utils/total-token-units-in-all-chains token)
:total-balance-fiat (utils/calculate-balance-for-token token)))
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed the total-balance-fiat key as it's not used.

@smohamedjavid smohamedjavid force-pushed the feature/wallet-network-filter branch from d85ed44 to a194746 Compare March 14, 2024 16:32
@smohamedjavid smohamedjavid changed the title [WIP] [Feature] Wallet - Network based assets and fiat balance calculation [Feature] Wallet - Network based assets and fiat balance calculation Mar 14, 2024
@smohamedjavid smohamedjavid marked this pull request as ready for review March 14, 2024 16:33
Copy link
Contributor

@ulisesmac ulisesmac left a comment

Choose a reason for hiding this comment

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

Hey @smohamedjavid

Thanks for fixing various issues, I left some comments

Comment on lines 6 to 9
(defn- filter-collectible?
[collectible chain-ids]
(let [chain-id (get-in collectible [:id :contract-id :chain-id])]
(contains? chain-ids chain-id)))

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could improve this function name.

are there some collectibles not containing :chain-id? if not, then this predicate could just be called :collectible? since it is not filtering, the filtering is performed below

Copy link
Member Author

Choose a reason for hiding this comment

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

To my knowledge, A Collectible can NOT live without a chain-id (It needs a blockchain). So, It's safe to say the chain-id will present at any given time.

Yes, the actual filter is done below. I will move the filter to a separate function along with this function.

Comment on lines 56 to 57
(fn [[collectibles chain-ids]]
(filter #(filter-collectible? % chain-ids) collectibles)))

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this functions is the same as below we could extract it to a defn and just use it in these two different subscriptions. wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we will move this to a separate method 👍

Comment on lines +205 to +228
(condp contains? (keyword network)
#{constants/mainnet-network-name (keyword constants/mainnet-short-name)}
(get-chain-id
{:mainnet-chain-id constants/ethereum-mainnet-chain-id
:sepolia-chain-id constants/ethereum-sepolia-chain-id
:goerli-chain-id constants/ethereum-goerli-chain-id
:testnet-enabled? testnet-enabled?
:goerli-enabled? goerli-enabled?})

#{constants/optimism-network-name (keyword constants/optimism-short-name)}
(get-chain-id
{:mainnet-chain-id constants/optimism-mainnet-chain-id
:sepolia-chain-id constants/optimism-sepolia-chain-id
:goerli-chain-id constants/optimism-goerli-chain-id
:testnet-enabled? testnet-enabled?
:goerli-enabled? goerli-enabled?})

#{constants/arbitrum-network-name (keyword constants/arbitrum-short-name)}
(get-chain-id
{:mainnet-chain-id constants/arbitrum-mainnet-chain-id
:sepolia-chain-id constants/arbitrum-sepolia-chain-id
:goerli-chain-id constants/arbitrum-goerli-chain-id
:testnet-enabled? testnet-enabled?
:goerli-enabled? goerli-enabled?})))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the implementation is a bit complex to understand, is there a way to reduce the parameters passed to get-chain-id?

It's also probably due to condp, I was thinking about using case or a regular cond instead 🤔 but we might need to use some extra helper functions or definitions.

Not needed to change, but if you find a way to improve the readability, it'd be nice. Please consider the previous implementation where the constants were inside the get-chain-id` function.

Copy link
Member Author

Choose a reason for hiding this comment

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

I intend to make this method as flexible as can to accept both the network's short name and full name. I agree the implementation is layered. It's needed for this moment to check the network name and then the rest of the conditions to return the correct chain-id.

It's also probably due to condp, I was thinking about using case or a regular cond instead 🤔 but we might need to use some extra helper functions or definitions.

case was my initial thought as well but the docs that The test-constants are not evaluated. They must be compile-time literals, and need not be quoted. So, I had to move to condp.

Please consider the previous implementation where the constants were inside the get-chain-id` function.

We can check for other possibilities. One reason to have the get-chain-id method separately is for the conditional checks (Testnet, Testnest+Goerli, and Mainnet). If not, we will end up repeating the condition in each case.

Comment on lines +308 to +322
(defn filter-tokens-in-chains
[tokens chain-ids]
(map #(update % :balances-per-chain select-keys chain-ids) tokens))
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -0,0 +1,9 @@
(ns status-im.contexts.wallet.db
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @smohamedjavid

I'm a bit against this abstraction, I think it's too soon to add it and probably we don't need it.

I don't see a benefit here from marking this as :const, probably we are over :const-ing stuff? I've had problems while reloading some namespaces in the REPL because consts aren't allowed to re-evaluate 🤔 but probably it's just me.

The main reason I'm against is that it hides the keys used, we must navigate to this namespace to know the actual values, this might lead to bugs or unexpected cases since it's easier to forget what are the involved keys, for example, while writing a new event that involves updating an existing map. I believe keys used in event/sub handlers shouldn't be decoupled since they give the whole context and our db is not small.

Additionally, the values written here are totally derived from status-im.constants, I think we could just add a def (or even let) in the namespace/function we want to use it.

cc-ing @J-Son89 to get another perspective.

@@ -27,11 +17,17 @@
:description (i18n/label :t/here-is-a-cat-in-a-box-instead)
:image (resources/get-themed-image :cat-in-box theme)
:container-style style/empty-container-style}]
[gesture/flat-list
Copy link
Contributor

Choose a reason for hiding this comment

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

Two things:

  1. If the parent is always a scroll-view, we can replace the rn/view wrapping this (doall ...) by [:<>] and provide its styles to the scroll-view (inside :content-container-style I think)

  2. If we aren't dyncamically deref-ing an ratom inside this lazy seq (created by for), we can omit the doall and keep it lazy, otherwhise, if we need to realize this seq, then we could use into so that we no longer need the meta :key given, something like:

(into [:<>] ;; or rn/view
      (map (fn [{:keys [color address] :as account}]
             [quo/account-item {,,,}]))
      other-accounts)

Comment on lines -58 to +63
(keep
(fn [{:keys [chain-id related-chain-id layer test?]}]
(let [network-details (get-network-details (if test? related-chain-id chain-id))]
(assoc network-details
:chain-id chain-id
:related-chain-id related-chain-id
:layer layer))))
(map
(fn [{:keys [chain-id related-chain-id layer]}]
(assoc (get-network-details chain-id)
:chain-id chain-id
:related-chain-id related-chain-id
:layer layer)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to keep nils? or it no longer returns nil?

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't return any nil values as far as I checked (Mainnet, testnet - Sepolia and Goerli).

@smohamedjavid smohamedjavid force-pushed the feature/wallet-network-filter branch from c0fcd8c to dc95166 Compare March 21, 2024 09:53
@smohamedjavid smohamedjavid force-pushed the feature/wallet-network-filter branch 2 times, most recently from 49b59a3 to dd4a4bb Compare April 2, 2024 12:35
@VolodLytvynenko VolodLytvynenko self-assigned this Apr 3, 2024
@VolodLytvynenko
Copy link
Contributor

hi @smohamedjavid could you please resolve existing conflicts?

@smohamedjavid smohamedjavid force-pushed the feature/wallet-network-filter branch from dd4a4bb to 216bac7 Compare April 3, 2024 14:12
@VolodLytvynenko
Copy link
Contributor

VolodLytvynenko commented Apr 4, 2024

Hi @smohamedjavid, great job. When I saw the scope of this PR, I thought a lot of issues might be introduced :) But its not. Thank you for your work. Just a few low-priority issues that might be considered as follow-ups. Let me know if they will be addressed in this PR, otherwise, the PR can be merged, and I will create them separately.

ISSUE 1: The balances are not shown when the account with some assets is removed

Steps to reproduce:

  1. Recover a user with assets in "Account 1" and "Account 2" (Account 2 can be a watch-only account).
  2. Remove "Account 2".
  3. Check balances within preferences.

Actual result:

Balances are not shown in the network preferences.

remove.mp4

Expected result:

Balances should be shown in the network preferences even after removing an account.

@VolodLytvynenko
Copy link
Contributor

ISSUE 2 Selected networks during editing flow are not preselected in shared Wallet QR

Steps:

  1. Open the account Edit flow
  2. Open the network preferences.
  3. Select just one or two networks (Only Opt for example )
  4. Go to receive or go to share button
  5. Tap multichain on the configured account
  6. Check networks

Actual result:

All networks are predefined in the address, regardless of the selected networks.

selectednetworks.mp4

Expected result:

Only the selected networks should be predefined in the address
image

@VolodLytvynenko
Copy link
Contributor

VolodLytvynenko commented Apr 4, 2024

I am not sure this is an issue, for me this is just an inconvenience, and didn't see such behavior in other apps, that's why reporting it. Let's see the design team reply https://discord.com/channels/624634427930312714/852533718790570015/1225502769193160894

ISSUE 3: Other checkboxes are unselected when one checkbox is selected

Preconditions:

The user has an account with one or more networks selected.

Steps to Reproduce:

  1. Open the account Edit flow
  2. Open the network preferences.
  3. Check any checkbox.

Actual Result:

When a checkbox is selected, other checkboxes are automatically unchecked.

checkbox3.mp4

Expected Result:

After a checkbox is checked, it should not influence the unchecking of other checkboxes.

@VolodLytvynenko
Copy link
Contributor

Question 1:

Is it correct behavior for a user to still see an asset with a 0 balance if the network is deselected where that asset is held? For example, if a user has "wrapped ether" only on the Optimism network and then deselects the Optimism network, should "wrapped ether" still be present with a 0 balance, or should this token not be shown at all?

@VolodLytvynenko
Copy link
Contributor

One more issue, which is probably not related to the PR and might be considered as a follow-up

ISSUE 4: The network marks are not shown on the 'send to' page for accounts

Steps:

  1. Recover a user with "Account 1" and "Account 2"
  2. Open "Account 2" -> edit -> Open network preferences
  3. Set up only 1 or 2 networks
  4. Open "Account 1" -> send -> open 'my accounts' tab

Actual result:

'Account 2' is shown with predefined network marks.image

Expected result:

  1. 'Account 2' is shown with predefined networks marks
    image

  2. The network marks should not be predefined only if all three networks were left as default for a certain account

@smohamedjavid
Copy link
Member Author

@VolodLytvynenko - Thank you 🙏 for testing the mammoth PR in a short time.

I would be happy to take these issues as a follow-up, as this PR is already going out of hand in terms of scope. 👍

Adding more information about the issues:

Issues related to this PR:

ISSUE 1: The balances are not shown when the account with some assets is removed

It's probably due to the recovery account. I will check and fix that.


Issues NOT related to this PR:

ISSUE 2 Selected networks during editing flow are not preselected in shared Wallet QR

This PR doesn't make any changes to displaying selected networks only in the wallet address of the shell share screen. I believe it's the existing bug. We will fix that.

ISSUE 3: Other checkboxes are unselected when one checkbox is selected

Yes, this must be frustrating sometimes. We can discuss this with Design and we will apply the behaviour. It will be a quick one.

ISSUE 4: The network marks are not shown on the 'send to' page for accounts

I believe this is an existing bug. We will fix that.


Question 1:
Is it correct behavior for a user to still see an asset with a 0 balance if the network is deselected where that asset is held? For example, if a user has "wrapped ether" only on the Optimism network and then deselects the Optimism network, should "wrapped ether" still be present with a 0 balance, or should this token not be shown at all?

Yes. That's logically correct. 👍 It's the user's choice to deselect a network which has assets and would expect the balance to reflect that.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
@smohamedjavid smohamedjavid force-pushed the feature/wallet-network-filter branch from 216bac7 to 7fe4cfa Compare April 5, 2024 11:37
@smohamedjavid smohamedjavid merged commit 9ba6c62 into develop Apr 5, 2024
6 checks passed
@smohamedjavid smohamedjavid deleted the feature/wallet-network-filter branch April 5, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
5 participants