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

fix(wallet): fix mercuryo on-ramp #20962

Merged
merged 1 commit into from
Oct 8, 2024
Merged

Conversation

briansztamfater
Copy link
Member

@briansztamfater briansztamfater commented Aug 5, 2024

fixes #20927
fixes #21339
fixes #21341

Summary

This PR implements the flow for adding custom parameters on on-ramp providers, which fixes Mercuryo on-ramp links. Also fixes a bug that makes some popular assets not being displayed in the asset selection list.

mercuryofix.mp4

Platforms

  • Android
  • iOS

Areas that maybe impacted

Functional
  • wallet / transactions

Steps to test

Issue 1

  • Open Status
  • Log in
  • Go to Buy crypto flow
  • Select Mercuryo
  • Select a network
  • Select an asset
  • Buy on Mercuryo
  • Verify flow is working as expected and that referral is working as expected

Issue 2

  • Open Status
  • Log in
  • Go to Swaps
  • Select Optimism token
  • Select asset to receive
  • Verify all the tokens are displayed in the list

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Aug 5, 2024

Jenkins Builds

Click to see older builds (50)
Commit #️⃣ Finished (UTC) Duration Platform Result
36465c2 #2 2024-08-05 20:32:52 ~2 min tests 📄log
dc4c519 #3 2024-08-05 20:36:11 ~2 min tests 📄log
✔️ dc4c519 #3 2024-08-05 20:41:17 ~7 min android-e2e 🤖apk 📲
✔️ dc4c519 #3 2024-08-05 20:41:39 ~7 min android 🤖apk 📲
✔️ dc4c519 #3 2024-08-05 20:43:00 ~8 min ios 📱ipa 📲
✔️ 95362c3 #5 2024-08-08 00:01:29 ~4 min tests 📄log
✔️ 95362c3 #5 2024-08-08 00:03:33 ~6 min android-e2e 🤖apk 📲
✔️ 95362c3 #5 2024-08-08 00:04:18 ~7 min android 🤖apk 📲
✔️ 95362c3 #5 2024-08-08 00:06:20 ~9 min ios 📱ipa 📲
5c92bd0 #6 2024-09-19 15:01:35 ~45 sec android-e2e 📄log
5c92bd0 #6 2024-09-19 15:01:44 ~55 sec android 📄log
5c92bd0 #6 2024-09-19 15:04:20 ~3 min tests 📄log
5c92bd0 #6 2024-09-19 15:06:40 ~5 min ios 📄log
68b7cbf #7 2024-09-27 17:01:28 ~3 min tests 📄log
✔️ 68b7cbf #7 2024-09-27 17:05:47 ~7 min android-e2e 🤖apk 📲
✔️ 68b7cbf #7 2024-09-27 17:07:22 ~9 min android 🤖apk 📲
✔️ 68b7cbf #7 2024-09-27 17:16:48 ~18 min ios 📱ipa 📲
d383e8f #8 2024-10-02 15:58:37 ~2 min tests 📄log
✔️ d383e8f #8 2024-10-02 16:03:46 ~7 min android-e2e 🤖apk 📲
✔️ d383e8f #8 2024-10-02 16:04:11 ~7 min android 🤖apk 📲
✔️ d383e8f #8 2024-10-02 16:05:18 ~8 min ios 📱ipa 📲
6874451 #9 2024-10-02 17:00:23 ~2 min tests 📄log
✔️ 061dce5 #10 2024-10-02 17:05:56 ~4 min tests 📄log
✔️ 2aeec46 #11 2024-10-02 17:12:39 ~4 min tests 📄log
✔️ 2aeec46 #11 2024-10-02 17:15:13 ~6 min android 🤖apk 📲
✔️ 2aeec46 #11 2024-10-02 17:15:27 ~7 min android-e2e 🤖apk 📲
✔️ 2aeec46 #11 2024-10-02 17:16:56 ~8 min ios 📱ipa 📲
✔️ bea46b7 #12 2024-10-02 23:34:55 ~3 min tests 📄log
✔️ bea46b7 #12 2024-10-02 23:38:10 ~7 min android-e2e 🤖apk 📲
✔️ bea46b7 #12 2024-10-02 23:38:37 ~7 min android 🤖apk 📲
✔️ bea46b7 #12 2024-10-02 23:39:48 ~8 min ios 📱ipa 📲
c6f6765 #13 2024-10-03 05:02:49 ~2 min tests 📄log
✔️ c6f6765 #13 2024-10-03 05:07:27 ~7 min android-e2e 🤖apk 📲
✔️ c6f6765 #13 2024-10-03 05:07:54 ~7 min android 🤖apk 📲
c6f6765 #13 2024-10-03 05:08:37 ~8 min ios 📄log
b8b4b82 #15 2024-10-03 05:20:49 ~2 min tests 📄log
✔️ 09d6e4f #16 2024-10-03 05:27:44 ~4 min tests 📄log
✔️ 09d6e4f #16 2024-10-03 05:30:56 ~7 min android-e2e 🤖apk 📲
✔️ 09d6e4f #16 2024-10-03 05:31:27 ~7 min android 🤖apk 📲
✔️ 09d6e4f #16 2024-10-03 05:32:56 ~9 min ios 📱ipa 📲
✔️ 7de05e0 #17 2024-10-03 16:02:43 ~4 min tests 📄log
✔️ 7de05e0 #17 2024-10-03 16:05:28 ~7 min android-e2e 🤖apk 📲
✔️ 7de05e0 #17 2024-10-03 16:05:54 ~7 min android 🤖apk 📲
✔️ 7de05e0 #17 2024-10-03 16:07:26 ~9 min ios 📱ipa 📲
03d0e5c #18 2024-10-07 15:02:37 ~2 min tests 📄log
✔️ 4ad9ab0 #19 2024-10-07 15:08:26 ~4 min tests 📄log
✔️ 4ad9ab0 #19 2024-10-07 15:10:32 ~6 min android-e2e 🤖apk 📲
✔️ 4ad9ab0 #19 2024-10-07 15:11:29 ~7 min android 🤖apk 📲
✔️ 4ad9ab0 #19 2024-10-07 15:15:09 ~10 min ios 📱ipa 📲
✔️ dc971da #20 2024-10-07 15:20:20 ~4 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f757c2c #21 2024-10-07 15:26:54 ~5 min tests 📄log
✔️ f757c2c #21 2024-10-07 15:27:49 ~6 min android-e2e 🤖apk 📲
✔️ f757c2c #21 2024-10-07 15:29:56 ~8 min android 🤖apk 📲
✔️ f757c2c #21 2024-10-07 15:32:12 ~11 min ios 📱ipa 📲
✔️ c032253 #22 2024-10-08 12:36:36 ~4 min tests 📄log
✔️ c032253 #22 2024-10-08 12:38:25 ~6 min android-e2e 🤖apk 📲
✔️ c032253 #22 2024-10-08 12:39:11 ~7 min android 🤖apk 📲
✔️ c032253 #22 2024-10-08 12:41:05 ~8 min ios 📱ipa 📲

@status-im-auto
Copy link
Member

✔️ status-mobile/prs/tests/PR-20962#10 🔹 ~4 min 35 sec 🔹 061dce5 🔹 📦 tests package

@briansztamfater briansztamfater force-pushed the fix/mercuryo-onramp branch 3 times, most recently from bea46b7 to c6f6765 Compare October 3, 2024 04:59
@briansztamfater briansztamfater changed the title [WIP] fix(wallet): fix mercuryo on-ramp fix(wallet): fix mercuryo on-ramp Oct 3, 2024
@briansztamfater briansztamfater marked this pull request as ready for review October 3, 2024 05:14
@briansztamfater briansztamfater force-pushed the fix/mercuryo-onramp branch 2 times, most recently from 4a5c38b to b8b4b82 Compare October 3, 2024 05:17
@VolodLytvynenko VolodLytvynenko self-assigned this Oct 3, 2024
@status-im-auto
Copy link
Member

86% of end-end tests have passed

Total executed tests: 7
Failed tests: 1
Expected to fail tests: 0
Passed tests: 6
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: Tap on found: Button
    Device 2: Attempt 0 is successful clicking close-activity-center

    Test setup failed: critical/chats/test_public_chat_browsing.py:323: in prepare_devices
        self.home_2.handle_contact_request(self.username_1)
    ../views/home_view.py:410: 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

    Passed tests (6)

    Click to expand

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    Class TestWalletMultipleDevice:

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

    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 TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    @VolodLytvynenko
    Copy link
    Contributor

    @briansztamfater apologies, I was too quick to confirm the merging of the current PR. I need to clarify a few questions with the design team regarding the current feature

    @shivekkhurana shivekkhurana added the wallet-core Issues for mobile wallet team label Oct 3, 2024
    @shivekkhurana shivekkhurana added this to the 2.31.0 Beta milestone Oct 3, 2024
    @shivekkhurana
    Copy link
    Contributor

    QA happened before Review 😅

    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented Oct 3, 2024

    @briansztamfater Take a look at the found issue

    PR_ISSUE 1: Network drawer is shown when "Mercuryo" is selected on Swap/Send/Bridge pages

    Actual Result:

    The drawer with network options is shown.

    buy_page.mp4

    Expected result:

    The drawer with networks is not shown. User is directly redirected to \select asset to buy' drawer
    https://www.figma.com/design/xLs1KYmF4e6WwRTZVJKeUK/Wallet?node-id=16449-14285&node-type=frame&t=V07pw3fkyKsDCJJJ-0

    OS:

    IOS, Android

    Devices:

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

    @briansztamfater
    Copy link
    Member Author

    briansztamfater commented Oct 3, 2024

    @VolodLytvynenko thanks for testing, issue 1 should be fixed now!

    @VolodLytvynenko
    Copy link
    Contributor

    hi @briansztamfater, thank you for the fix. One very low-priority issue is found that can be considered as follow up.

    ISSUE 2: ETH and DAI are displayed in the "Your assets" section of the swap page, even when the user has a balance of 0 for these assets.

    Steps:

    1. Go to the swap page.
    2. Open the 'Assets to Pay' or 'Assets to Receive' modals.

    Actual Result:

    ETH and DAI are shown in the "Your assets" section, despite the user having a 0 balance for these tokens.

    yourassets.mp4

    Expected Result:

    "Your assets" section should no contains the asset if the user has no balance for these assets. If user has no assets at all, then the "Your assets" section should hidden

    @VolodLytvynenko
    Copy link
    Contributor

    One question: what does mean "one time" and "recurrent tabs"?
    image

    @status-im-auto
    Copy link
    Member

    71% of end-end tests have passed

    Total executed tests: 7
    Failed tests: 2
    Expected to fail tests: 0
    Passed tests: 5
    
    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: Tap on found: Button
    Device 2: Attempt 0 is successful clicking close-activity-center

    Test setup failed: critical/chats/test_public_chat_browsing.py:323: in prepare_devices
        self.home_2.handle_contact_request(self.username_1)
    ../views/home_view.py:410: 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 TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133

    Device 1: Find Button by accessibility id: show-profiles
    Device 1: Tap on found: Button

    critical/chats/test_public_chat_browsing.py:244: in test_restore_multiaccount_with_waku_backup_remove_switch
        self.errors.verify_no_errors()
    base_test_case.py:192: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     zQ3...dWXh5 was not restored as a contact from waku backup!
    E    zQ3...Vacac was not restored as a contact from waku backup!
    E    admin_open was not restored from waku-backup!!
    E    member_open was not restored from waku-backup!!
    E    admin_closed was not restored from waku-backup!!
    E    member_closed was not restored from waku-backup!!
    



    Device sessions

    Passed tests (5)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    Class TestWalletMultipleDevice:

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

    @briansztamfater briansztamfater force-pushed the fix/mercuryo-onramp branch 3 times, most recently from 4ad9ab0 to dc971da Compare October 7, 2024 15:15
    @briansztamfater
    Copy link
    Member Author

    @VolodLytvynenko IMO only in Select Asset to Pay screen makes sense to hide tokens with balance 0. I updated that, let me know if that is okay, we can create a follow up if this needs more thinking.

    About one-time and recurrent, some providers allow to buy recurrenty (monthly buys i.e.), so we list them there.

    @status-im-auto
    Copy link
    Member

    71% of end-end tests have passed

    Total executed tests: 7
    Failed tests: 2
    Expected to fail tests: 0
    Passed tests: 5
    
    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

    Device 1: Find Button by accessibility id: show-profiles
    Device 1: Tap on found: Button

    critical/chats/test_public_chat_browsing.py:244: in test_restore_multiaccount_with_waku_backup_remove_switch
        self.errors.verify_no_errors()
    base_test_case.py:192: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     zQ3...dWXh5 was not restored as a contact from waku backup!
    E    zQ3...Vacac was not restored as a contact from waku backup!
    E    admin_open was not restored from waku-backup!!
    E    member_open was not restored from waku-backup!!
    E    admin_closed was not restored from waku-backup!!
    E    member_closed was not restored from waku-backup!!
    



    Device sessions

    Passed tests (5)

    Click to expand

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    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

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    @briansztamfater
    Copy link
    Member Author

    briansztamfater commented Oct 8, 2024

    @VolodLytvynenko IMO only in Select Asset to Pay screen makes sense to hide tokens with balance 0. I updated that, let me know if that is okay, we can create a follow up if this needs more thinking.

    Should that fix #21341 @VolodLytvynenko ?

    @VolodLytvynenko
    Copy link
    Contributor

    hi @briansztamfater thank you for fixes. No issues from my side. If any additional commits are added after the review, let me know and I will retest. Otherwise, the PR can be merged.

    Issue 2 indeed can be considered as a feature

    Comment on lines +12 to +13
    _
    _
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Leftovers ?

    Copy link
    Contributor

    @shivekkhurana shivekkhurana left a comment

    Choose a reason for hiding this comment

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

    This PR looks good to go.

    We should merge this after QA, but as discussed on call, we might have to hide Mercuryo due to UK laws.

    Regardless, we should have this code on our master branch, so we can enable it whenever we have a decision.

    @VolodLytvynenko
    Copy link
    Contributor

    Hi @shivekkhurana I didn't test the token purchase process using Mercuryo in this PR; I only checked if the account address and tokens are fetched correctly from Status app, as shown in the screenshot
    image

    Should we test the entire buy transaction process within such Mercuryo-related PRs, or is it enough to check it during the release phase? (Minimum price to buy tokens within Mercuryo = 25 USD)

    Signed-off-by: Brian Sztamfater <[email protected]>
    @briansztamfater briansztamfater merged commit 00b0d75 into develop Oct 8, 2024
    6 checks passed
    @briansztamfater briansztamfater deleted the fix/mercuryo-onramp branch October 8, 2024 12:43
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    Status: Done
    4 participants