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

feat(wallet)_: Saved addresses limit #22069

Merged
merged 1 commit into from
Feb 14, 2025
Merged

Conversation

smohamedjavid
Copy link
Member

fixes #22045

Summary

This PR adds limit for adding saved addresses upto 20 to prevent any unwanted behaviour.

22045.mp4

Platforms

  • Android
  • iOS

Steps to test

  • Open Status
  • Navigate to Profile > Wallet > Saved addresses
  • Verify you can add upto 20 Saved addresses
  • Verify a toast message is shown that the limit is reached if the user tries add more

status: ready

@smohamedjavid smohamedjavid added request-manual-qa wallet-core Issues for mobile wallet team labels Feb 12, 2025
@smohamedjavid smohamedjavid self-assigned this Feb 12, 2025
@status-im-auto
Copy link
Member

status-im-auto commented Feb 12, 2025

Jenkins Builds

Click to see older builds (4)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 86fb84e #1 2025-02-12 12:29:18 ~5 min tests 📄log
✔️ 86fb84e #1 2025-02-12 12:30:47 ~6 min android-e2e 🤖apk 📲
✔️ 86fb84e #1 2025-02-12 12:31:56 ~7 min android 🤖apk 📲
✔️ 86fb84e #1 2025-02-12 12:34:40 ~10 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 041857e #2 2025-02-13 11:48:15 ~5 min tests 📄log
✔️ 041857e #2 2025-02-13 11:52:26 ~9 min android-e2e 🤖apk 📲
✔️ 041857e #2 2025-02-13 11:52:53 ~9 min android 🤖apk 📲
✔️ 041857e #2 2025-02-13 11:54:43 ~11 min ios 📱ipa 📲
✔️ f80991b #3 2025-02-14 17:35:20 ~4 min tests 📄log
✔️ f80991b #3 2025-02-14 17:38:40 ~7 min android-e2e 🤖apk 📲
✔️ f80991b #3 2025-02-14 17:39:08 ~8 min android 🤖apk 📲
✔️ f80991b #3 2025-02-14 17:40:59 ~10 min ios 📱ipa 📲

(set-address-or-ens trimmed-value)
(set-ens-address "")
(set-error (validate (string/lower-case trimmed-value)))
Copy link
Member Author

Choose a reason for hiding this comment

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

A minor change in order of set-state.

This fixes an non-fatal crash if you type/paste an existing address, the error state is updated which triggers the re-render (for error view) before the actual address text is set in the state. The error state should be validated after the values are set.

(assoc :network-preferences-names
(network-utils/network-preference-prefix->network-names (:chain-short-names saved-address)))
(assoc :ens? (not (string/blank? (:ens saved-address))))))
(assoc saved-address :ens? (not (string/blank? (:ens saved-address)))))
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 network-preferences-names key which was added by client to existing saved address data for easy display in UI. Since, we removed multi chain support. It's not needed.

Copy link
Contributor

@mohsen-ghafouri mohsen-ghafouri left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@smohamedjavid smohamedjavid force-pushed the feat/saved-addresses-limit branch from 86fb84e to 041857e Compare February 13, 2025 11:42
@status-im-auto
Copy link
Member

55% of end-end tests have passed

Total executed tests: 11
Failed tests: 5
Expected to fail tests: 0
Passed tests: 6
IDs of failed tests: 727231,741555,741612,702843,741554 

Failed tests (5)

Click to expand
  • Rerun failed tests

  • Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231

    # STEP: Adding new regular account
    Device 1: Find `Button` by `accessibility id`: `add-account`

    critical/test_wallet.py:551: in test_wallet_add_remove_regular_account
        self.wallet_view.add_regular_account(account_name=new_account_name)
    ../views/wallet_view.py:215: in add_regular_account
        self.add_account_button.click()
    ../views/base_element.py:89: in click
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `add-account` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    2. test_wallet_swap_flow_mainnet, id: 741555

    Device 1: Could not reach Button by pressing system back button
    Device 1: Find Button by xpath: //android.view.ViewGroup[contains(@content-desc,'Account 1')]

    critical/test_wallet.py:349: in test_wallet_swap_flow_mainnet
        self.wallet_view.get_account_element().click()
    ../views/base_element.py:89: in click
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by xpath: `//android.view.ViewGroup[contains(@content-desc,'Account 1')]` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    3. test_wallet_bridge_flow_mainnet, id: 741612

    Device 1: Could not reach Button by pressing system back button
    Device 1: Find Button by xpath: //android.view.ViewGroup[contains(@content-desc,'Account 1')]

    critical/test_wallet.py:434: in test_wallet_bridge_flow_mainnet
        self.wallet_view.get_account_element().click()
    ../views/base_element.py:89: in click
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by xpath: `//android.view.ViewGroup[contains(@content-desc,'Account 1')]` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    4. test_wallet_send_flow_mainnet, id: 741554

    Device 1: Swiping right on element SlideButton
    Device 1: Find SlideButton by xpath: //*[@resource-id='slide-button-track']

    critical/test_wallet.py:337: in test_wallet_send_flow_mainnet
        self.wallet_view.slide_button_track.slide()
    ../views/base_view.py:107: in slide
        self.swipe_right_on_element(width_percentage=1.3, start_x=100)
    ../views/base_element.py:288: in swipe_right_on_element
        location, size = self.get_element_coordinates()
    ../views/base_element.py:274: in get_element_coordinates
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: SlideButton by xpath: `//*[@resource-id='slide-button-track']` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Device 2: Looking for a message by text: Message AFTER edit 2 (Edited)
    Device 2: Find ChatElementByText by xpath: //*[starts-with(@text,'Message AFTER edit 2 (Edited)')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']

    critical/chats/test_public_chat_browsing.py:383: in test_community_message_edit
        self.channel_2.set_reaction(message_text_after_edit)
    ../views/chat_view.py:690: in set_reaction
        self.chat_element_by_text(message).long_press_without_release()
    ../views/base_element.py:315: in long_press_without_release
        action.click_and_hold(self.find_element()).perform()
    ../views/chat_view.py:69: in find_element
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:138: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: ChatElementByText by xpath:`//*[starts-with(@text,'Message AFTER edit 2 (Edited)')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']` 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_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

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_profile_switch, id: 703133
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    @Horupa-Olena Horupa-Olena self-assigned this Feb 13, 2025
    @status-im-auto
    Copy link
    Member

    80% of end-end tests have passed

    Total executed tests: 5
    Failed tests: 1
    Expected to fail tests: 0
    Passed tests: 4
    
    IDs of failed tests: 741612 
    

    Failed tests (1)

    Click to expand
  • Rerun failed tests

  • Class TestWalletOneDevice:

    1. test_wallet_bridge_flow_mainnet, id: 741612

    Device 1: Find `SlideButton` by `xpath`: `//*[@resource-id='slide-button-track']`
    Device 1: Click system back button

    critical/test_wallet.py:544: in test_wallet_bridge_flow_mainnet
        self.errors.verify_no_errors()
    base_test_case.py:179: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Device 1: Optimism to Arbitrum: Max fees is not shown before pressing Review Bridge button
    



    Passed tests (4)

    Click to expand

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_send_flow_mainnet, id: 741554
    2. test_wallet_swap_flow_mainnet, id: 741555
    3. test_wallet_add_remove_regular_account, id: 727231

    @Horupa-Olena
    Copy link

    @smohamedjavid Thanks for your PR!
    Everything looks good, so it can be merged.
    I checked that the user can't add more than 20 accounts and that the toast is shown.

    @smohamedjavid smohamedjavid force-pushed the feat/saved-addresses-limit branch from 041857e to f80991b Compare February 14, 2025 17:30
    @smohamedjavid smohamedjavid merged commit 8c82a84 into develop Feb 14, 2025
    5 checks passed
    @smohamedjavid smohamedjavid deleted the feat/saved-addresses-limit branch February 14, 2025 19:04
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    Status: DONE
    Development

    Successfully merging this pull request may close these issues.

    "Limit of 20 addresses reached" is not implemented on mobile
    5 participants