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

[#20720] feat: add ability to set currency from account Settings #20772

Merged
merged 14 commits into from
Aug 29, 2024

Conversation

mohsen-ghafouri
Copy link
Contributor

@mohsen-ghafouri mohsen-ghafouri commented Jul 16, 2024

fixes #20720
fixes #20694

Summary

Add ability to set currency from account Settings.

Areas that maybe impacted

  • Wallet

Steps to test

  1. Sync the mobile app with the desktop.
  2. Desktop Settings -> Language&Currency -> Set Display Currency
  3. Choose Any currency
  4. Open wallet on desktop and mobile

Result

Mobile

Simulator.Screen.Recording.-.iPhone.13.-.2024-07-17.at.23.35.48.mp4

Mobile and Desktop syncing

Screen.Recording.2024-07-17.at.23.46.41.mov

status: ready

status go PR status-im/status-go#5541

@status-im-auto
Copy link
Member

status-im-auto commented Jul 16, 2024

Jenkins Builds

Click to see older builds (83)
Commit #️⃣ Finished (UTC) Duration Platform Result
2206717 #1 2024-07-16 16:53:52 ~3 min tests 📄log
✔️ 2206717 #1 2024-07-16 16:59:19 ~8 min android-e2e 🤖apk 📲
✔️ 2206717 #1 2024-07-16 16:59:29 ~8 min android 🤖apk 📲
✔️ 2206717 #1 2024-07-16 17:00:57 ~10 min ios 📱ipa 📲
✔️ 767e2c9 #2 2024-07-16 17:20:59 ~4 min tests 📄log
✔️ 767e2c9 #2 2024-07-16 17:22:17 ~6 min android-e2e 🤖apk 📲
✔️ 767e2c9 #2 2024-07-16 17:23:57 ~7 min android 🤖apk 📲
✔️ 767e2c9 #2 2024-07-16 17:24:56 ~8 min ios 📱ipa 📲
✔️ ee5459f #3 2024-07-17 11:10:16 ~4 min tests 📄log
✔️ ee5459f #3 2024-07-17 11:12:25 ~7 min android-e2e 🤖apk 📲
✔️ ee5459f #3 2024-07-17 11:13:15 ~7 min android 🤖apk 📲
✔️ ee5459f #3 2024-07-17 11:14:17 ~8 min ios 📱ipa 📲
d3dad4e #4 2024-07-17 15:19:16 ~2 min tests 📄log
✔️ d3dad4e #4 2024-07-17 15:23:08 ~6 min android-e2e 🤖apk 📲
✔️ d3dad4e #4 2024-07-17 15:24:04 ~7 min android 🤖apk 📲
✔️ d3dad4e #4 2024-07-17 15:26:17 ~9 min ios 📱ipa 📲
✔️ 746d134 #5 2024-07-17 15:32:08 ~5 min tests 📄log
✔️ 746d134 #5 2024-07-17 15:33:56 ~7 min android-e2e 🤖apk 📲
✔️ 746d134 #5 2024-07-17 15:35:38 ~8 min ios 📱ipa 📲
✔️ 746d134 #5 2024-07-17 15:35:42 ~8 min android 🤖apk 📲
✔️ 0a0e7ef #6 2024-07-17 20:04:36 ~4 min tests 📄log
✔️ 0a0e7ef #6 2024-07-17 20:06:09 ~6 min android 🤖apk 📲
✔️ 0a0e7ef #6 2024-07-17 20:06:10 ~6 min android-e2e 🤖apk 📲
✔️ 0a0e7ef #6 2024-07-17 20:08:50 ~8 min ios 📱ipa 📲
a380255 #7 2024-07-18 12:43:53 ~3 min tests 📄log
✔️ a380255 #7 2024-07-18 12:47:35 ~7 min android-e2e 🤖apk 📲
3edde1c #8 2024-07-18 12:51:03 ~2 min tests 📄log
✔️ 3edde1c #8 2024-07-18 12:55:25 ~6 min android-e2e 🤖apk 📲
✔️ 3edde1c #8 2024-07-18 12:56:13 ~7 min android 🤖apk 📲
✔️ 3edde1c #8 2024-07-18 13:01:36 ~13 min ios 📱ipa 📲
46953a5 #10 2024-07-18 13:32:22 ~3 min tests 📄log
✔️ 46953a5 #10 2024-07-18 13:36:45 ~7 min android-e2e 🤖apk 📲
✔️ 46953a5 #10 2024-07-18 13:37:52 ~9 min android 🤖apk 📲
✔️ 46953a5 #10 2024-07-18 13:40:13 ~11 min ios 📱ipa 📲
7a428c2 #11 2024-07-18 13:57:58 ~3 min tests 📄log
✔️ 7a428c2 #11 2024-07-18 14:01:17 ~6 min android 🤖apk 📲
✔️ 7a428c2 #11 2024-07-18 14:01:33 ~6 min android-e2e 🤖apk 📲
✔️ 7a428c2 #11 2024-07-18 14:04:56 ~9 min ios 📱ipa 📲
✔️ 93ed153 #12 2024-07-18 14:10:43 ~4 min tests 📄log
✔️ 93ed153 #12 2024-07-18 14:13:23 ~7 min android-e2e 🤖apk 📲
✔️ 93ed153 #12 2024-07-18 14:13:39 ~7 min android 🤖apk 📲
✔️ 93ed153 #12 2024-07-18 14:15:17 ~9 min ios 📱ipa 📲
081634a #13 2024-07-19 08:56:06 ~4 min tests 📄log
✔️ 081634a #13 2024-07-19 09:01:24 ~9 min android-e2e 🤖apk 📲
✔️ 081634a #13 2024-07-19 09:01:31 ~9 min ios 📱ipa 📲
✔️ 081634a #13 2024-07-19 09:02:03 ~10 min android 🤖apk 📲
✔️ 081634a #14 2024-07-19 09:10:28 ~4 min tests 📄log
29633de #15 2024-07-24 12:42:48 ~5 min tests 📄log
✔️ 29633de #14 2024-07-24 12:45:39 ~8 min android-e2e 🤖apk 📲
✔️ 29633de #14 2024-07-24 12:48:37 ~11 min android 🤖apk 📲
✔️ 29633de #14 2024-07-24 12:49:07 ~11 min ios 📱ipa 📲
3e15d48 #16 2024-07-24 13:04:22 ~3 min tests 📄log
✔️ 677e4b0 #17 2024-07-24 13:11:43 ~4 min tests 📄log
✔️ 677e4b0 #16 2024-07-24 13:14:46 ~7 min android-e2e 🤖apk 📲
✔️ 677e4b0 #16 2024-07-24 13:16:41 ~9 min android 🤖apk 📲
✔️ 677e4b0 #16 2024-07-24 13:19:03 ~12 min ios 📱ipa 📲
✔️ 6baa6a2 #18 2024-07-25 14:53:13 ~5 min tests 📄log
✔️ 6baa6a2 #17 2024-07-25 14:55:30 ~7 min android 🤖apk 📲
✔️ 6baa6a2 #17 2024-07-25 14:55:58 ~7 min android-e2e 🤖apk 📲
6baa6a2 #17 2024-07-25 14:59:19 ~11 min ios 📄log
✔️ 6baa6a2 #18 2024-07-26 08:23:34 ~8 min ios 📱ipa 📲
✔️ 7a49f9e #19 2024-07-26 11:47:32 ~5 min tests 📄log
✔️ 7a49f9e #18 2024-07-26 11:50:19 ~7 min android-e2e 🤖apk 📲
✔️ 7a49f9e #18 2024-07-26 11:50:55 ~8 min android 🤖apk 📲
✔️ 7a49f9e #19 2024-07-26 11:54:56 ~12 min ios 📱ipa 📲
✔️ a7ec066 #20 2024-07-26 14:05:57 ~18 min tests 📄log
✔️ a7ec066 #19 2024-07-26 14:08:28 ~21 min android 🤖apk 📲
✔️ a7ec066 #19 2024-07-26 14:10:52 ~23 min android-e2e 🤖apk 📲
✔️ a7ec066 #20 2024-07-26 14:19:23 ~32 min ios 📱ipa 📲
581aa2e #21 2024-08-28 07:34:51 ~46 sec ios 📄log
581aa2e #20 2024-08-28 07:34:51 ~47 sec android-e2e 📄log
581aa2e #20 2024-08-28 07:34:59 ~51 sec android 📄log
581aa2e #21 2024-08-28 07:37:52 ~3 min tests 📄log
✔️ addaf10 #22 2024-08-28 11:14:55 ~5 min tests 📄log
✔️ addaf10 #21 2024-08-28 11:18:49 ~9 min android-e2e 🤖apk 📲
✔️ addaf10 #21 2024-08-28 11:20:07 ~10 min android 🤖apk 📲
✔️ addaf10 #22 2024-08-28 11:21:22 ~11 min ios 📱ipa 📲
✔️ 9c0a126 #23 2024-08-28 15:11:15 ~5 min tests 📄log
✔️ 9c0a126 #22 2024-08-28 15:13:17 ~7 min android-e2e 🤖apk 📲
✔️ 9c0a126 #22 2024-08-28 15:14:37 ~8 min android 🤖apk 📲
9c0a126 #23 2024-08-28 15:19:10 ~12 min ios 📄log
9c0a126 #24 2024-08-28 15:37:29 ~16 min ios 📄log
✔️ 9c0a126 #25 2024-08-28 18:27:04 ~11 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 82d8ed8 #24 2024-08-28 18:50:06 ~5 min tests 📄log
✔️ 82d8ed8 #23 2024-08-28 18:53:28 ~8 min android-e2e 🤖apk 📲
✔️ 82d8ed8 #23 2024-08-28 18:53:56 ~8 min android 🤖apk 📲
✔️ 82d8ed8 #26 2024-08-28 18:54:50 ~9 min ios 📱ipa 📲
✔️ 7070e01 #25 2024-08-29 10:52:38 ~5 min tests 📄log
✔️ 7070e01 #24 2024-08-29 10:55:18 ~7 min android-e2e 🤖apk 📲
✔️ 7070e01 #24 2024-08-29 10:55:39 ~8 min android 🤖apk 📲
✔️ 7070e01 #27 2024-08-29 10:58:53 ~11 min ios 📱ipa 📲

Copy link
Member

@smohamedjavid smohamedjavid left a comment

Choose a reason for hiding this comment

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

Nice work! @mohsen-ghafouri 🙌

@mohsen-ghafouri mohsen-ghafouri force-pushed the feat/currency-settings-section branch 3 times, most recently from d3dad4e to 746d134 Compare July 17, 2024 15:26
@mohsen-ghafouri mohsen-ghafouri marked this pull request as ready for review July 17, 2024 15:37
@mohsen-ghafouri mohsen-ghafouri force-pushed the feat/currency-settings-section branch 3 times, most recently from 46953a5 to 7a428c2 Compare July 18, 2024 13:54
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.

Hi @mohsen-ghafouri

Thank you for your PR.

I left some comments

src/legacy/status_im/data_store/settings.cljs Show resolved Hide resolved
src/legacy/status_im/multiaccounts/update/core.cljs Outdated Show resolved Hide resolved
src/status_im/common/json_rpc/events.cljs Outdated Show resolved Hide resolved
src/status_im/subs/general.cljs Show resolved Hide resolved
src/status_im/subs/profile.cljs Outdated Show resolved Hide resolved
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.

@mohsen-ghafouri

Thank you so much for your PR and for addressing the comments!

Copy link
Member

@smohamedjavid smohamedjavid left a comment

Choose a reason for hiding this comment

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

🙌

src/status_im/common/json_rpc/events.cljs Outdated Show resolved Hide resolved
@status-im-auto
Copy link
Member

25% of end-end tests have passed

Total executed tests: 4
Failed tests: 3
Expected to fail tests: 0
Passed tests: 1
IDs of failed tests: 727230,702809,703503 

Failed tests (3)

Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Device 1: Find `Button` by `accessibility id`: `communities-home-discover-card`
    Device 1: Tap on found: Button

    critical/chats/test_public_chat_browsing.py:262: in test_community_discovery
        self.home.community_card_item.wait_for_elements(seconds=120)
    ../views/base_element.py:138: in wait_for_elements
        raise TimeoutException(
     Device 1:  BaseElement by accessibility id:`community-card-item` is not found on the screen after wait_for_elements
    



    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809

    Device 1: Tap on found: Button
    Device 1: Find Button by accessibility id: welcome-button

    Test setup failed: critical/chats/test_public_chat_browsing.py:837: in prepare_devices
        self.loop.run_until_complete(run_in_parallel(((self.device_1.create_user, {'enable_notifications': True,
    /usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
        return future.result()
    __init__.py:52: in run_in_parallel
        returns.append(await k)
    /usr/lib/python3.10/concurrent/futures/thread.py:58: in run
        result = self.fn(*self.args, **self.kwargs)
    ../views/sign_in_view.py:275: in create_user
        self.start_button.click()
    ../views/base_element.py:90: in click
        element = self.find_element()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `welcome-button` 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
    



    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    Test setup failed: critical/test_wallet.py:23: in prepare_devices
        self.drivers, self.loop = create_shared_drivers(2)
    base_test_case.py:309: in create_shared_drivers
        drivers = loop.run_until_complete(start_threads(test_suite_data.current_test.name,
    /usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
        return future.result()
    __init__.py:26: in start_threads
        returns[k] = await returns[k]
    /usr/lib/python3.10/concurrent/futures/thread.py:58: in run
        result = self.fn(*self.args, **self.kwargs)
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/appium/webdriver/webdriver.py:257: in __init__
        super().__init__(
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:206: in __init__
        self.start_session(capabilities)
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/appium/webdriver/webdriver.py:346: in start_session
        response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py:229: in check_response
        raise exception_class(message, screen, stacktrace)
     Internal Server Error
    



    Passed tests (1)

    Click to expand

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    @mariia-skrypnyk
    Copy link

    mariia-skrypnyk commented Aug 28, 2024

    Yes @mohsen-ghafouri , builds appeared but branch has conflicts.

    Also wanted to ask regarding logic:

    should I be able to change currency by tap on check box here?
    on my video I can not:

    IMG_2025.MP4

    I have an issue with not working sync with desktop app so I am not able to check currency change right now.
    Still trying.

    @churik
    Copy link
    Member

    churik commented Aug 28, 2024

    @mariia-skrypnyk please, also retest #20694 just in case and close if it doesn't make sense anymore, thank you!

    @mohsen-ghafouri
    Copy link
    Contributor Author

    mohsen-ghafouri commented Aug 28, 2024

    Sorry @mariia-skrypnyk, it was due to this changes #20916 that we hardcoded profile currency to usd, now it should be fine.
    please note that when you set currency in mobile, it can have some delay to be synced in desktop app

    @mariia-skrypnyk
    Copy link

    Thanks @mohsen-ghafouri !

    Want to take a look but see iOS build is not ok.
    Can you take a look?

    @mariia-skrypnyk
    Copy link

    mariia-skrypnyk commented Aug 28, 2024

    Thanks @mohsen-ghafouri for fix of currency setting from Profile.
    Now user can choose any option and it works for mobile app and also these changes are visible on the desktop.

    What makes we curious about are:

    1. the auto redirect to Language and currency screen after any currency option was set
    IMG_2025.MP4

    I suppose we need to stay on Currency screen and have an ability to change any option we want without going back every time.

    Figma
    Screenshot 2024-08-28 at 20 06 53
    https://www.figma.com/design/JlpPhJp0SMnEyBQy4nOZHo/Settings-for-Mobile?node-id=2837-482804&t=gNygKhG0IRc4bLqh-0

    1. I've asked designs for wallet with another currencies and in case they appear it will be followup.
    Screenshot 2024-08-28 at 20 24 58

    @status-im-auto
    Copy link
    Member

    33% of end-end tests have passed

    Total executed tests: 3
    Failed tests: 2
    Expected to fail tests: 0
    Passed tests: 1
    
    IDs of failed tests: 727230,702809 
    

    Failed tests (2)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809

    Device 2: Tap on found: Button
    Device 2: Attempt 0 is successful clicking close-activity-center

    Test setup failed: critical/chats/test_public_chat_browsing.py:847: in prepare_devices
        self.home_2.handle_contact_request(self.username_1)
    ../views/home_view.py:409: in handle_contact_request
        chat_element.accept_contact_request()
    ../views/home_view.py:162: in accept_contact_request
        self.handle_cr("accept-contact-request")
    ../views/home_view.py:159: in handle_cr
        ).wait_for_rendering_ended_and_click()
    ../views/base_element.py:163: in wait_for_rendering_ended_and_click
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by xpath:`//*[contains(@text, 'user_1')]/ancestor::*[@content-desc='activity']/*[@content-desc="accept-contact-request"]` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    Device 2: Find Text by xpath: //android.view.ViewGroup[@content-desc='container']/android.widget.TextView[@text='Ether']/../android.widget.TextView[3]
    Device 2: Text is 0.04109 ETH

    critical/test_wallet.py:190: in test_wallet_send_asset_from_drawer
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Eth amount in the receivers wallet is 0.0411 but should be 0.0617
    



    Passed tests (1)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503
    Device sessions

    @mohsen-ghafouri
    Copy link
    Contributor Author

    Thanks @mariia-skrypnyk for spotting this, you are right, i will fix the auto redirect.

    @mohsen-ghafouri
    Copy link
    Contributor Author

    @mariia-skrypnyk Done.

    @mariia-skrypnyk
    Copy link

    Thanks @mohsen-ghafouri !

    PR can be merged!

    @mohsen-ghafouri
    Copy link
    Contributor Author

    Thank you @mariia-skrypnyk for your time, @smohamedjavid if all good, can we merge your status-go changes?

    @smohamedjavid
    Copy link
    Member

    @mohsen-ghafouri - merged the status-go changes and tagged the commit (v0.184.48) 🙏

    @mohsen-ghafouri mohsen-ghafouri merged commit 96b88a4 into develop Aug 29, 2024
    5 checks passed
    @mohsen-ghafouri mohsen-ghafouri deleted the feat/currency-settings-section branch August 29, 2024 11:32
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Status: DONE
    9 participants