status-mobile icon indicating copy to clipboard operation
status-mobile copied to clipboard

fix(wallet)_: token supported networks

Open smohamedjavid opened this issue 1 year ago • 2 comments

fixes #20988

Summary

This PR fixes the networks/chains supported by the token based on the token list fetched from status-go instead of relying on the balance-per-chain map as status-go returns balance for chains only if there is a positive balance.

Platforms

  • Android
  • iOS

Areas that may be impacted

Functional

  • wallet/transactions

Steps to test

Prerequisites: A wallet account with a token balance on one network
  • Open Status
  • Navigate to Wallet > Account > Bridge
  • Verify the supported networks by each token is displayed below each token
  • Upon selecting a token, verify the token supported networks are selectable even if there is no balance on that network/chain
  • Navigate to Wallet > Account > Send
  • Verify the tokens are displayed correctly with networks supported by the token
  • Navigate to the routes generation page and verify Not available text is not shown on the receiver side
  • Verify the transaction can be performed

status: ready

smohamedjavid avatar Oct 17 '24 12:10 smohamedjavid

Jenkins Builds

Click to see older builds (36)
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:x: 015a2333 #1 2024-10-17 12:13:53 ~3 min tests :page_facing_up:log
:heavy_check_mark: 015a2333 #1 2024-10-17 12:19:15 ~8 min android-e2e :robot:apk :calling:
:heavy_check_mark: 015a2333 #1 2024-10-17 12:19:48 ~9 min android :robot:apk :calling:
:heavy_check_mark: 015a2333 #1 2024-10-17 12:19:53 ~9 min ios :iphone:ipa :calling:
:heavy_check_mark: f59d0c02 #2 2024-10-17 15:19:18 ~4 min tests :page_facing_up:log
:heavy_check_mark: f59d0c02 #2 2024-10-17 15:23:15 ~8 min android-e2e :robot:apk :calling:
:heavy_check_mark: f59d0c02 #2 2024-10-17 15:23:26 ~8 min ios :iphone:ipa :calling:
:heavy_check_mark: f59d0c02 #2 2024-10-17 15:23:40 ~9 min android :robot:apk :calling:
:x: f7dc5359 #3 2024-10-18 18:50:23 ~3 min tests :page_facing_up:log
:heavy_check_mark: f7dc5359 #3 2024-10-18 18:54:20 ~7 min android :robot:apk :calling:
:heavy_check_mark: f7dc5359 #3 2024-10-18 18:55:15 ~8 min android-e2e :robot:apk :calling:
:heavy_check_mark: f7dc5359 #3 2024-10-18 18:56:27 ~9 min ios :iphone:ipa :calling:
:heavy_check_mark: 86c47052 #4 2024-10-18 19:21:12 ~5 min tests :page_facing_up:log
:heavy_check_mark: 86c47052 #4 2024-10-18 19:24:57 ~8 min ios :iphone:ipa :calling:
:heavy_check_mark: 86c47052 #4 2024-10-18 19:25:00 ~9 min android-e2e :robot:apk :calling:
:heavy_check_mark: 86c47052 #4 2024-10-18 19:26:50 ~10 min android :robot:apk :calling:
:heavy_check_mark: e42042e6 #5 2024-10-22 11:09:28 ~5 min tests :page_facing_up:log
:heavy_check_mark: e42042e6 #5 2024-10-22 11:12:03 ~7 min android-e2e :robot:apk :calling:
:heavy_check_mark: e42042e6 #5 2024-10-22 11:12:56 ~8 min android :robot:apk :calling:
:heavy_check_mark: e42042e6 #5 2024-10-22 11:13:31 ~9 min ios :iphone:ipa :calling:
:heavy_check_mark: a910aefd #6 2024-10-22 16:31:44 ~5 min tests :page_facing_up:log
:heavy_check_mark: a910aefd #6 2024-10-22 16:33:51 ~7 min android :robot:apk :calling:
:heavy_check_mark: a910aefd #6 2024-10-22 16:34:32 ~7 min android-e2e :robot:apk :calling:
:heavy_check_mark: a910aefd #6 2024-10-22 16:35:37 ~9 min ios :iphone:ipa :calling:
:heavy_check_mark: c920da64 #7 2024-10-23 11:05:05 ~4 min tests :page_facing_up:log
:heavy_check_mark: c920da64 #7 2024-10-23 11:08:01 ~7 min android-e2e :robot:apk :calling:
:heavy_check_mark: c920da64 #7 2024-10-23 11:08:27 ~8 min android :robot:apk :calling:
:heavy_check_mark: c920da64 #7 2024-10-23 11:10:51 ~10 min ios :iphone:ipa :calling:
:x: 6e59d725 #8 2024-10-23 12:15:38 ~3 min tests :page_facing_up:log
:heavy_check_mark: 6e59d725 #8 2024-10-23 12:19:41 ~7 min android :robot:apk :calling:
:heavy_check_mark: 6e59d725 #8 2024-10-23 12:21:09 ~8 min android-e2e :robot:apk :calling:
:heavy_check_mark: 6e59d725 #8 2024-10-23 12:22:40 ~10 min ios :iphone:ipa :calling:
:heavy_check_mark: 435fb405 #9 2024-10-23 12:28:43 ~4 min tests :page_facing_up:log
:heavy_check_mark: 435fb405 #9 2024-10-23 12:31:38 ~7 min android :robot:apk :calling:
:heavy_check_mark: 435fb405 #9 2024-10-23 12:31:59 ~7 min android-e2e :robot:apk :calling:
:heavy_check_mark: 435fb405 #9 2024-10-23 12:33:12 ~8 min ios :iphone:ipa :calling:
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:heavy_check_mark: 6090a534 #10 2024-10-23 16:15:42 ~4 min tests :page_facing_up:log
:heavy_check_mark: 6090a534 #10 2024-10-23 16:18:45 ~7 min android-e2e :robot:apk :calling:
:heavy_check_mark: 6090a534 #10 2024-10-23 16:20:59 ~10 min ios :iphone:ipa :calling:
:heavy_check_mark: 6090a534 #10 2024-10-23 16:21:29 ~10 min android :robot:apk :calling:
:heavy_check_mark: 5330c11f #11 2024-10-23 17:26:27 ~4 min tests :page_facing_up:log
:heavy_check_mark: 5330c11f #11 2024-10-23 17:28:28 ~6 min android-e2e :robot:apk :calling:
:heavy_check_mark: 5330c11f #11 2024-10-23 17:30:21 ~8 min android :robot:apk :calling:
:heavy_check_mark: 5330c11f #11 2024-10-23 17:32:20 ~10 min ios :iphone:ipa :calling:

status-im-auto avatar Oct 17 '24 12:10 status-im-auto

hey @smohamedjavid, I noticed this PR adds changes in similar places as this one, just as an FYI.

@clauxx - thanks for the heads up 👍 I guess I missed the context. I was under the impression that we need to display the supported networks below each token as we used to display (depending on the balance-per-chain key). I guess I will change it. Please merge your PR and I will make changes on top of it.

Also, wondering if it's possible to isolate the changes in one place only, for instance: when we get the token data from status-go, can we update balances-per-chain to include the missing chains? I may be missing context here though, just wondering if the other changes are necessary.

That was my first thought too. I was under the impression that the status-go returns the balance even if it's zero in supported chains for all tokens, but it's different for non-default tokens (ETH SNT STT DAI are default tokens). I was inclined to status-go, but I don't want to introduce any bugs close to release.

I will quickly add the missing chain while we save it to the app-db. I need to ensure the token list (as we depend on it for supported chains for each token) is fetched before we fetch the tokens for each account so that we can add any missing chains in balance-per-chain. I will make a quick update.

smohamedjavid avatar Oct 18 '24 15:10 smohamedjavid

hi @smohamedjavid could you please resolve existing conflicts? thanx!

VolodLytvynenko avatar Oct 22 '24 13:10 VolodLytvynenko

hi @smohamedjavid could you please resolve existing conflicts? thanx!

@VolodLytvynenko - Done 👍

smohamedjavid avatar Oct 22 '24 16:10 smohamedjavid

88% of end-end tests have passed

Total executed tests: 8
Failed tests: 1
Expected to fail tests: 0
Passed tests: 7
IDs of failed tests: 702843 

Failed tests (1)

Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Device 2: Find `Text` by `xpath`: `//android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'https://status.app/c/')]`
    Device 2: Wait for element `Button` for max 120s and click when it is available
    Test setup failed: critical/chats/test_public_chat_browsing.py:350: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:420: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:100: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Passed tests (7)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    2. test_wallet_balance_mainnet, id: 740490

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    2. test_wallet_send_eth, id: 727229

    status-im-auto avatar Oct 23 '24 08:10 status-im-auto

    Hi @smohamedjavid thank you for PR. take a look at found issue:

    ISSUE 1: Network drawer shows networks with 0 balances

    Steps:

    1. Restore user with assets on a specific network (excluding DAI, ETH, SNT).
    2. Go to the wallet page.
    3. Long tap the asset and tap "swap."

    Actual result:

    The network drawer displays networks where the asset isn't present.

    Example: I have Chainlink on Optimism only, but I see Mainnet and Arbitrum in the network selection drawer as well

    https://github.com/user-attachments/assets/451e83eb-e0a0-4855-8e29-5330b046c1c4

    Expected result:

    The drawer should only show networks where the selected asset exists. In case if user has assets only on one network, then current user should be navigated directly to the swap page. See on nightly

    https://github.com/user-attachments/assets/c3c33577-c8a8-4522-8d58-4f58cfa42c6a

    Devices:

    Pixel 7a, Android 13 iPhone 11 Pro Max, iOS 17

    VolodLytvynenko avatar Oct 23 '24 08:10 VolodLytvynenko

    @VolodLytvynenko - Thanks for testing the PR 🙏 . The issue 1 should be fixed now. Please retest.

    smohamedjavid avatar Oct 23 '24 11:10 smohamedjavid

    ISSUE 2: 'Not available' shown in TO section if token isn't available on selected network

    Steps:

    1. Restore user with a token available on one or two networks. (However this token should be supported on the all networks. Example: ETH, DAI etc)
    2. Go to the send flow.
    3. Try to build a route.

    Actual result:

    User can't build a bridge route on the send page for a network where the asset isn't available.

    Example: In my case the user has DAI on the L1 network, but in the "send to" page, Optimism and Arbitrum are shown as 'Not available' in the TO section.

    image

    Expected result:

    The networks should be shown as available on send to page in case if user even does not have assets on current networks

    OS:

    IOS, Android

    Devices:

    • Pixel 7a, Android 13
    • iPhone 11 Pro Max, IOS 17

    VolodLytvynenko avatar Oct 23 '24 11:10 VolodLytvynenko

    @VolodLytvynenko - The issue 2 should be fixed now. Please retest. 🙏

    smohamedjavid avatar Oct 23 '24 12:10 smohamedjavid

    62% of end-end tests have passed

    Total executed tests: 8
    Failed tests: 3
    Expected to fail tests: 0
    Passed tests: 5
    
    IDs of failed tests: 727231,740490,702843 
    

    Failed tests (3)

    Click to expand
  • Rerun failed tests

  • Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Test setup failed: critical/test_wallet.py:200: in prepare_devices
        self.drivers, self.loop = create_shared_drivers(1)
    base_test_case.py:330: in create_shared_drivers
        raise e
    base_test_case.py:320: in create_shared_drivers
        test_suite_data.current_test.testruns[-1].jobs[drivers[i].session_id] = i + 1
     '_asyncio.Future' object has no attribute 'session_id'
    



    2. test_wallet_balance_mainnet, id: 740490
    Test setup failed: critical/test_wallet.py:200: in prepare_devices
        self.drivers, self.loop = create_shared_drivers(1)
    base_test_case.py:330: in create_shared_drivers
        raise e
    base_test_case.py:320: in create_shared_drivers
        test_suite_data.current_test.testruns[-1].jobs[drivers[i].session_id] = i + 1
     '_asyncio.Future' object has no attribute 'session_id'
    



    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Device 2: Find Text by xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'https://status.app/c/')]
    Device 2: Wait for element Button for max 120s and click when it is available
    Test setup failed: critical/chats/test_public_chat_browsing.py:350: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:420: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:100: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Passed tests (5)

    Click to expand

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    2. test_wallet_send_eth, id: 727229

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    status-im-auto avatar Oct 23 '24 14:10 status-im-auto

    @smohamedjavid Thank you for fixes. Unfortunatly one more place related to this issue is introduced after last commit, however can be considered as follow up

    PR_ISSUE 3: Token shown as 'Not available' in "edit preferences" drawer despite being supported

    Steps::

    1. Restore user with a token available on one or two networks. (However this token should be supported on the all networks. Example: ETH, DAI etc)
    2. Go to the send flow.
    3. Try to build a route.
    4. Tap "edit" button to enable "edit preferences" drawer

    https://github.com/user-attachments/assets/56fb5350-1735-4269-ae4f-67179fb26c14

    Actual result:

    The token is shown as 'Not available' in the "edit preferences" drawer, even though the token is supported on the selected networks.

    image

    Expected result:

    The token should be shown as supported in the "edit preferences" drawer if it is supported on those networks

    Devices:

    • Pixel 7a, Android 13
    • iPhone 11 Pro Max, IOS 17

    VolodLytvynenko avatar Oct 23 '24 15:10 VolodLytvynenko

    @VolodLytvynenko - Issue 3 should be fixed now. Please retest. 🙏

    smohamedjavid avatar Oct 23 '24 16:10 smohamedjavid

    Unfortunately can't understand the root cause of this issue. I will send you the user and the assets where this happens

    PR_ISSUE 4: 'Not available' still shown in TO section

    Actual result:

    image

    Devices:

    • Pixel 7a, Android 13
    • iPhone 11 Pro Max, IOS 17

    VolodLytvynenko avatar Oct 23 '24 16:10 VolodLytvynenko

    @VolodLytvynenko - Issue 4 should be fixed now. Please retest 🙏

    smohamedjavid avatar Oct 23 '24 17:10 smohamedjavid

    75% of end-end tests have passed

    Total executed tests: 8
    Failed tests: 2
    Expected to fail tests: 0
    Passed tests: 6
    
    IDs of failed tests: 703133,702843 
    

    Failed tests (2)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133

    # STEP: Check that removed user is not shown in the list anymore
    Device 1: Wait for element `Button` for max 30s and click when it is available
    critical/chats/test_public_chat_browsing.py:240: in test_restore_multiaccount_with_waku_backup_remove_switch
        self.sign_in.show_profiles_button.wait_and_click()
    ../views/base_element.py:100: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: Button by accessibility id:`show-profiles` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Device 2: Find Text by xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'https://status.app/c/')]
    Device 2: Wait for element Button for max 120s and click when it is available
    Test setup failed: critical/chats/test_public_chat_browsing.py:350: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:420: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:100: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Passed tests (6)

    Click to expand

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    2. test_wallet_balance_mainnet, id: 740490

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    2. test_wallet_send_eth, id: 727229

    status-im-auto avatar Oct 24 '24 08:10 status-im-auto

    0% of end-end tests have passed

    Total executed tests: 2
    Failed tests: 2
    Expected to fail tests: 0
    Passed tests: 0
    
    IDs of failed tests: 703133,702843 
    

    Failed tests (2)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Device 2: Find `Text` by `xpath`: `//android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'https://status.app/c/')]`
    Device 2: Wait for element `Button` for max 120s and click when it is available
    Test setup failed: critical/chats/test_public_chat_browsing.py:350: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:420: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:100: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133

    # STEP: Check that removed user is not shown in the list anymore
    Device 1: Wait for element Button for max 30s and click when it is available
    critical/chats/test_public_chat_browsing.py:240: in test_restore_multiaccount_with_waku_backup_remove_switch
        self.sign_in.show_profiles_button.wait_and_click()
    ../views/base_element.py:100: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: Button by accessibility id:`show-profiles` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    status-im-auto avatar Oct 24 '24 10:10 status-im-auto

    hi @smohamedjavid thank you for PR. No issues from my side. PR can be merged

    VolodLytvynenko avatar Oct 24 '24 10:10 VolodLytvynenko