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: trigger swap transactions #21134

Merged
merged 1 commit into from
Sep 6, 2024
Merged

feat: trigger swap transactions #21134

merged 1 commit into from
Sep 6, 2024

Conversation

briansztamfater
Copy link
Member

@briansztamfater briansztamfater commented Aug 28, 2024

fixes #20381
fixes #20344

Summary

This PR integrates swaps transactions actually triggering after user confirms the transaction. Also adds proper toasts notifications as per designs.

executeswap.mp4

Platforms

  • Android
  • iOS
Functional
  • wallet / transactions

Steps to test

  • Open Status
  • Login
  • Go to wallet
  • Select an account
  • Select Swap option
  • Select a ERC20 token on Select asset to pay screen
  • Enter a valid amount
  • Wait for swap proposal to appear
  • Tap on "Review swap"
  • Slide to execute the transction
  • Enter password
  • Swap modal should be dismissed and toast should be shown
  • Wait for the swap transaction to be confirmed / failed and proper toasts are shown

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Aug 28, 2024

Jenkins Builds

Click to see older builds (60)
Commit #️⃣ Finished (UTC) Duration Platform Result
c131380 #2 2024-08-28 03:54:26 ~2 min tests 📄log
✔️ c131380 #2 2024-08-28 03:59:22 ~7 min android-e2e 🤖apk 📲
✔️ c131380 #2 2024-08-28 03:59:52 ~7 min android 🤖apk 📲
✔️ c131380 #2 2024-08-28 04:02:23 ~10 min ios 📱ipa 📲
✔️ dfcf773 #3 2024-08-28 18:09:51 ~4 min tests 📄log
✔️ dfcf773 #3 2024-08-28 18:12:49 ~7 min android-e2e 🤖apk 📲
✔️ dfcf773 #3 2024-08-28 18:13:12 ~7 min android 🤖apk 📲
✔️ dfcf773 #3 2024-08-28 18:15:01 ~9 min ios 📱ipa 📲
✔️ 4b44668 #4 2024-08-29 12:21:49 ~4 min tests 📄log
✔️ 4b44668 #4 2024-08-29 12:25:46 ~8 min android-e2e 🤖apk 📲
✔️ 4b44668 #4 2024-08-29 12:26:12 ~9 min android 🤖apk 📲
✔️ 4b44668 #4 2024-08-29 12:26:47 ~9 min ios 📱ipa 📲
698a8ec #5 2024-08-29 13:08:54 ~3 min tests 📄log
✔️ 698a8ec #5 2024-08-29 13:12:04 ~6 min android 🤖apk 📲
✔️ 698a8ec #5 2024-08-29 13:13:15 ~7 min android-e2e 🤖apk 📲
✔️ 698a8ec #5 2024-08-29 13:15:39 ~10 min ios 📱ipa 📲
538d2a7 #6 2024-08-30 04:34:37 ~3 min tests 📄log
✔️ 538d2a7 #6 2024-08-30 04:37:59 ~7 min android-e2e 🤖apk 📲
✔️ 538d2a7 #6 2024-08-30 04:39:58 ~9 min android 🤖apk 📲
✔️ 538d2a7 #6 2024-08-30 04:41:41 ~10 min ios 📱ipa 📲
40088e5 #7 2024-09-02 04:52:12 ~2 min tests 📄log
✔️ 40088e5 #7 2024-09-02 04:56:52 ~7 min android-e2e 🤖apk 📲
✔️ 40088e5 #7 2024-09-02 04:57:56 ~8 min android 🤖apk 📲
✔️ 40088e5 #7 2024-09-02 04:59:35 ~10 min ios 📱ipa 📲
a87a51b #8 2024-09-02 14:10:52 ~2 min tests 📄log
✔️ bd3111b #9 2024-09-02 14:25:10 ~10 min ios 📱ipa 📲
✔️ bd3111b #9 2024-09-02 14:25:55 ~11 min android-e2e 🤖apk 📲
bd3111b #9 2024-09-02 14:28:58 ~14 min tests 📄log
✔️ bd3111b #9 2024-09-02 14:29:04 ~14 min android 🤖apk 📲
184e9fe #10 2024-09-02 20:41:23 ~3 min tests 📄log
✔️ 184e9fe #10 2024-09-02 20:44:36 ~6 min android-e2e 🤖apk 📲
✔️ 184e9fe #10 2024-09-02 20:47:33 ~9 min android 🤖apk 📲
✔️ 184e9fe #10 2024-09-02 20:47:58 ~9 min ios 📱ipa 📲
066230f #11 2024-09-03 13:23:47 ~2 min tests 📄log
✔️ 066230f #11 2024-09-03 13:28:51 ~7 min android-e2e 🤖apk 📲
✔️ 066230f #11 2024-09-03 13:29:10 ~7 min android 🤖apk 📲
✔️ 066230f #11 2024-09-03 13:31:06 ~9 min ios 📱ipa 📲
1b58b9c #12 2024-09-03 15:30:13 ~2 min tests 📄log
✔️ 1b58b9c #12 2024-09-03 15:35:31 ~7 min android-e2e 🤖apk 📲
✔️ 1b58b9c #12 2024-09-03 15:35:51 ~7 min android 🤖apk 📲
✔️ 1b58b9c #12 2024-09-03 15:38:53 ~10 min ios 📱ipa 📲
6c6e4e1 #13 2024-09-03 17:10:40 ~3 min tests 📄log
✔️ 6c6e4e1 #13 2024-09-03 17:14:31 ~6 min android 🤖apk 📲
✔️ 6c6e4e1 #13 2024-09-03 17:15:50 ~8 min android-e2e 🤖apk 📲
✔️ 6c6e4e1 #13 2024-09-03 17:17:16 ~9 min ios 📱ipa 📲
0ae3d1b #15 2024-09-03 19:05:11 ~2 min tests 📄log
✔️ 0ae3d1b #15 2024-09-03 19:09:33 ~6 min android 🤖apk 📲
✔️ 0ae3d1b #15 2024-09-03 19:10:02 ~7 min android-e2e 🤖apk 📲
✔️ 981100f #16 2024-09-03 19:15:07 ~4 min tests 📄log
✔️ 981100f #16 2024-09-03 19:18:23 ~7 min android-e2e 🤖apk 📲
✔️ 981100f #16 2024-09-03 19:18:47 ~7 min android 🤖apk 📲
✔️ 981100f #16 2024-09-03 19:20:44 ~9 min ios 📱ipa 📲
✔️ ffde94f #17 2024-09-03 20:08:18 ~4 min tests 📄log
✔️ ffde94f #17 2024-09-03 20:10:38 ~6 min android-e2e 🤖apk 📲
✔️ ffde94f #17 2024-09-03 20:11:10 ~6 min android 🤖apk 📲
✔️ ffde94f #17 2024-09-03 20:14:27 ~10 min ios 📱ipa 📲
✔️ 85c05f1 #18 2024-09-04 15:49:32 ~4 min tests 📄log
✔️ 85c05f1 #18 2024-09-04 15:52:55 ~7 min android-e2e 🤖apk 📲
✔️ 85c05f1 #18 2024-09-04 15:53:17 ~7 min android 🤖apk 📲
✔️ 85c05f1 #18 2024-09-04 15:55:50 ~10 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 9940f3c #21 2024-09-04 17:02:38 ~4 min tests 📄log
✔️ 9940f3c #21 2024-09-04 17:04:30 ~6 min android-e2e 🤖apk 📲
✔️ 9940f3c #21 2024-09-04 17:06:26 ~8 min android 🤖apk 📲
✔️ 9940f3c #21 2024-09-04 17:10:52 ~12 min ios 📱ipa 📲
✔️ f12e0e5 #22 2024-09-06 14:20:19 ~4 min tests 📄log
✔️ f12e0e5 #22 2024-09-06 14:22:20 ~6 min android-e2e 🤖apk 📲
✔️ f12e0e5 #22 2024-09-06 14:23:12 ~7 min android 🤖apk 📲
✔️ f12e0e5 #22 2024-09-06 14:26:18 ~10 min ios 📱ipa 📲

@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: 727230,727229 

Failed tests (2)

Click to expand
  • Rerun failed tests

  • Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    # STEP: Getting ETH amount in the wallet of the sender before transaction
    Device 1: Find `Button` by `xpath`: `//android.view.ViewGroup[contains(@content-desc,'Account 1')]`

    critical/test_wallet.py:164: in test_wallet_send_asset_from_drawer
        sender_balance, receiver_balance, eth_amount_sender, eth_amount_receiver = self._get_balances_before_tx()
    critical/test_wallet.py:43: in _get_balances_before_tx
        self.wallet_1.get_account_element().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 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
    



    2. test_wallet_send_eth, id: 727229

    Expected amount of confirmations is 7, in fact 80533
    No valid JSON response from Etherscan: Expecting value: line 1 column 1 (char 0)

    critical/test_wallet.py:142: in test_wallet_send_eth
        self.network_api.wait_for_confirmation_of_transaction(address=self.sender['wallet_address'],
    ../support/api/network_api.py:123: in wait_for_confirmation_of_transaction
        transaction = self.get_transactions(address)[0]
     'NoneType' object is not subscriptable
    



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

    1. test_community_message_edit, id: 702843
    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

    2. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    @VolodLytvynenko
    Copy link
    Contributor

    hi @briansztamfater could you please rebase the current PR? thanx

    @VolodLytvynenko
    Copy link
    Contributor

    @briansztamfater should the swap feature still be feature-flagged? In the latest build, I had to manually enable it in the feature flags to see the swap option

    @VolodLytvynenko
    Copy link
    Contributor

    PR_ISSUE 1: "Something went wrong, please try again later" Error message shown after entering valid value to swap

    Steps:

    1. Go to swap page
    2. Enter valid available value

    Actual result:

    'Something went wrong, please try again later' error message is shown
    image

    Expected result:

    The user should be able to proceed to the swap confirmation page after entering a valid amount.

    OS:

    IOS, Android

    Devices:

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

    Logs

    logs (9).zip

    @VolodLytvynenko
    Copy link
    Contributor

    @briansztamfater I think some commits might be missing in the latest build because the swap UI looks completely different from what was shown in the demo compared with the latest build where the issue is found. Could you please check?

    swap-approval-transaction? (= swap-approval-transaction-id tx-hash)
    swap-transaction-ids (get-in db [:wallet :swap-transaction-ids])
    swap-transaction? (and swap-transaction-ids
    (contains? swap-transaction-ids tx-hash))]
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Is swap-transactions-id a set ?

    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 is

    receive-amount receive-token-symbol]} (get-in db
    [:wallet :transactions tx-hash
    :swap-data])
    transaction-confirmed-or-failed? (#{:confirmed :failed} status)
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    What is this sorcery 😅

    Copy link
    Member Author

    @briansztamfater briansztamfater Aug 29, 2024

    Choose a reason for hiding this comment

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

    Just checking if status of the transaction is the final one (either confirmed or failed). Saw this pattern in many places of the codebase, for example this:

    (when (and (not dont-sync?) (#{:name :preferred-name} setting))

    @briansztamfater
    Copy link
    Member Author

    @briansztamfater should the swap feature still be feature-flagged? In the latest build, I had to manually enable it in the feature flags to see the swap option

    We should remove it at some point, I'll raise a new PR removing the flag 👍

    About issue 1, please try again, I have just updated the code. As we don't have a way (yet) to select the asset to receive, I hardcoded USDT for testing purposes, but SNT should be the default, which is a token available for all users. If you don't have USDT in your tokens list that may cause problems for now. Once #21140 is done that should be fine.

    @briansztamfater
    Copy link
    Member Author

    Also I will rebase, it will take some time as there is some PR chaining so I need to rebase the dependant PRs first

    @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: 727230,727229 
    

    Failed tests (2)

    Click to expand
  • Rerun failed tests

  • 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.04239 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))]))
     Sender balance is not updated on Etherscan, it is 0.4471 but expected to be 0.4473
    



    2. test_wallet_send_eth, id: 727229

    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.04229 ETH

    critical/test_wallet.py:159: in test_wallet_send_eth
        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))]))
     Sender balance is not updated on Etherscan, it is 0.4474 but expected to be 0.4475
    



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

    1. test_community_message_edit, id: 702843
    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

    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented Aug 29, 2024

    @briansztamfater thank you for clarification. Unfortunately I am blocked to test the swap flow fully due status go issue .

    Only some UI issues are found:

    ISSUE 2: [Android] Device's native keyboard appears on Swap page

    Steps:

    Go to the swap page within the app on an Android device.

    Actual result:

    The device's native keyboard automatically opens, resulting in two keyboards being displayed: the app's keyboard and the device's native keyboard.
    image

    Expected result:

    Only the app's keyboard should be displayed, without triggering the device's native keyboard.
    image

    ENV:

    Pixel 7a, Android 13

    @VolodLytvynenko
    Copy link
    Contributor

    ISSUE 3: Max value balances not updating according to selected account

    Steps:

    1. Recover a user with at least 2 accounts.
    2. Navigate to the swap page.
    3. Select a different account on the swap page.

    Actual result:

    The max value balances displayed do not update to reflect the newly selected account's balances

    swapbalances.mp4

    Expected result:

    The max balances should update to reflect the selected account's available funds on the swap page.

    @VolodLytvynenko
    Copy link
    Contributor

    @briansztamfater Not sure if issue 2 and issue 3 are within the scope of this PR. If not, I'll create them separately.

    @briansztamfater briansztamfater force-pushed the feat/trigger-swap branch 3 times, most recently from 0ae3d1b to 981100f Compare September 3, 2024 19:10
    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented Sep 4, 2024

    issue 5 is not fixed fully.
    the value in the receiving section is still not rounded. However, this can be addressed in a follow-up

    image

    @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: 727231 
    

    Failed tests (1)

    Click to expand
  • Rerun failed tests

  • Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231

    Device 1: Tap on found: Button
    Device 1: Find `Button` by `accessibility id`: `Wallet`

    critical/test_wallet.py:222: in test_wallet_add_remove_regular_account
        self.home_view.share_wallet_tab_button.click()
    ../views/base_element.py:90: in click
        element = self.find_element()
    ../views/base_element.py:84: in find_element
        raise exception
    ../views/base_element.py:77: in find_element
        return self.driver.find_element(self.by, self.locator)
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/appium/webdriver/webdriver.py:409: in find_element
        return self.execute(RemoteCommand.FIND_ELEMENT, {'using': by, 'value': value})['value']
    ../../../../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/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
    E   Stacktrace:
    E   UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
    E       at UIA2Proxy.command (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/jsonwp-proxy/proxy.js:355:13)
    E       at processTicksAndRejections (node:internal/process/task_queues:95:5)
    E       at AndroidUiautomator2Driver.helpers.doFindElementOrEls (/mnt/sauce/appium/appium-v2.0.0/appium_home/linux/node_modules/appium-uiautomator2-driver/lib/commands/find.js:30:10)
    E       at doFind (/mnt/sauce/appium/appium-v2.0.0/appium_home/linux/node_modules/appium-uiautomator2-driver/node_modules/appium-android-driver/lib/commands/find.js:36:17)
    E       at wrappedCondFn (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/basedriver/commands/timeout.ts:137:14)
    E       at spin (/mnt/sauce/appium/appium-v2.0.0/node_modules/asyncbox/lib/asyncbox.js:221:20)
    E       at waitForCondition (/mnt/sauce/appium/appium-v2.0.0/node_modules/asyncbox/lib/asyncbox.js:238:10)
    E       at AndroidUiautomator2Driver.implicitWaitForCondition (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/basedriver/commands/timeout.ts:139:12)
    E       at AndroidUiautomator2Driver.findElOrEls (/mnt/sauce/appium/appium-v2.0.0/appium_home/linux/node_modules/appium-uiautomator2-driver/node_modules/appium-android-driver/lib/commands/find.js:60:5)
    E       at AndroidUiautomator2Driver.findElOrElsWithProcessing (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/basedriver/commands/find.ts:60:12)
    E       at AndroidUiautomator2Driver.findElement (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/basedriver/commands/find.ts:75:12)
    



    Device sessions

    Passed tests (6)

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

    1. test_community_message_edit, id: 702843
    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

    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented Sep 4, 2024

    issue 2 is still reproducible. I missed one more scenario where it occurs: the keyboard appears when the app returns from the background.

    Steps:

    1. Go to swap page
    2. Go to background
    3. return device background

    Actual result:

    The device's native keyboard automatically opens, resulting in two keyboards being displayed: the app's keyboard and the device's native keyboard

    keyboard.mp4

    Device:

    Pixel 7a, Android 14

    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented Sep 4, 2024

    ISSUE 7: "View" button available after and during ERC-20 Token approval, leading to errors

    Steps:

    1. Go to swap page selecting ERC-20 token for swap
    2. Enter the value and approve it
    3. Tap view button perfoem approving again

    Actual result:

    The view button is shown that helps to perfrom approving one more time that leads to the error

    view_button_error.mp4

    Expected result:

    The view button is not shown
    https://www.figma.com/design/AD2JSKg0I8dZcylyiGa62O/Swap-for-Mobile?node-id=61-21859&node-type=INSTANCE&m=dev

    @VolodLytvynenko
    Copy link
    Contributor

    It looks like Paraswap struggles with certain decimal values on the Swap Page. To prevent this, I suggest implementing rounding for entered amounts on the swap page, similar to what was done on the send page in PR #20915. This would round values so that the final decimal place represents a value between $0.01 and $0.10 USD, ensuring proper display of small amounts and avoiding issues with third-party integrations. WDYT, @xAlisher?

    @briansztamfater
    Copy link
    Member Author

    briansztamfater commented Sep 4, 2024

    @VolodLytvynenko issue 2 happening this way is weird, for now I am forcing keyboard dismiss on Android every time the input is focused. The trade-off of this approach is that the input will loose focus and cursor will not be shown. We can create an issue to do some further research on this. iOS behavior remains as usual.

    Also regarding issue 7, I removed the View button as it is not shown in Swap designs.

    @briansztamfater
    Copy link
    Member Author

    It looks like Paraswap struggles with certain decimal values on the Swap Page. To prevent this, I suggest implementing rounding for entered amounts on the swap page, similar to what was done on the send page in PR #20915. This would round values so that the final decimal place represents a value between $0.01 and $0.10 USD, ensuring proper display of small amounts and avoiding issues with third-party integrations. WDYT, @xAlisher?

    IMO this deserves a bit more research, we can track it in a separate issue and add all the findings there, because I am not sure what are the actual errors (will add better error handling for mobile soon) and how is the best way to prevent them, if there is any. Also maybe this impacts Desktop implementation too.

    Base automatically changed from feat/swap-approve-token to develop September 4, 2024 16:53
    @briansztamfater briansztamfater force-pushed the feat/trigger-swap branch 2 times, most recently from 4abc589 to 9940f3c Compare September 4, 2024 16:57
    @VolodLytvynenko
    Copy link
    Contributor

    It looks like Paraswap struggles with certain decimal values on the Swap Page. To prevent this, I suggest implementing rounding for entered amounts on the swap page, similar to what was done on the send page in PR #20915. This would round values so that the final decimal place represents a value between $0.01 and $0.10 USD, ensuring proper display of small amounts and avoiding issues with third-party integrations. WDYT, @xAlisher?

    IMO this deserves a bit more research, we can track it in a separate issue and add all the findings there, because I am not sure what are the actual errors (will add better error handling for mobile soon) and how is the best way to prevent them, if there is any. Also maybe this impacts Desktop implementation too.

    @briansztamfater For sure. You've done a lot of work in this PR. This feature needs a separate follow-up.

    @briansztamfater
    Copy link
    Member Author

    briansztamfater commented Sep 5, 2024

    issue 5 is not fixed fully. the value in the receiving section is still not rounded. However, this can be addressed in a follow-up

    image

    Yes, we can work on this on a follow up, and discuss the desired approach with designers. Not sure if we should round the value returned by the swap provider, but we can discuss it in a separate issue.

    Let me know if there's something else to fix in this PR!

    @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: 727230 
    

    Failed tests (1)

    Click to expand
  • Rerun failed tests

  • 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.04989 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))]))
     Sender balance is not updated on Etherscan, it is 0.437 but expected to be 0.4371
    



    Passed tests (6)

    Click to expand

    Class TestWalletMultipleDevice:

    1. 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

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843
    Device sessions

    @VolodLytvynenko
    Copy link
    Contributor

    Hi @briansztamfater, thank you for your work. Issues are fixed. PR is ready to be merged

    @briansztamfater briansztamfater merged commit e2d5974 into develop Sep 6, 2024
    6 checks passed
    @briansztamfater briansztamfater deleted the feat/trigger-swap branch September 6, 2024 14:30
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    Trigger Swap Notifications
    5 participants