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): Cancel & Speed Up Tx in Tx Status Screen #26947

Merged
merged 5 commits into from
Dec 16, 2024

Conversation

nuo-xu
Copy link
Contributor

@nuo-xu nuo-xu commented Dec 9, 2024

Resolves brave/brave-browser#41799
Resolves brave/brave-browser#41800

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  1. Create either a .ethSend, .erc20Approval, .erc20Transfer, .eth721Transfer or .ethSwap
  2. Once the tx is submitted to the chain, you are in the flow of displaying the current tx's status
  3. You will see Cancel transaction button enabled once the tx has been submitted
  4. Quickly click this button you will see a confirmation screen shows up
  5. Click the back button the cancel
  6. You might need to repeat step 1 to 4 if your transaction gets confirmed
  7. Click Cancel transaction in the confirmation
  8. The status screen will be dismissed and a new pending transaction created
  9. Click confirm
  10. Now you are entering again the tx status flow but for this new transaction
  11. Notice there is no Cancel transaction button anymore
  12. Let it gets confirmed
  13. You will see the confirmed status will display correct message.
  14. Go back to Activity tab
  15. You will see a transaction that sent 0 ETH is successfully confirmed on chain
  16. Create other transaction that is not Eth coin type
  17. You will not see the Cancel transaction button in the tx status flow
Cancel button Confirmation Activity
Simulator Screenshot - iPhone 16 Pro Max - 2024-12-06 at 14 35 08 Simulator Screenshot - iPhone 16 Pro Max - 2024-12-09 at 17 52 37 Simulator Screenshot - iPhone 16 Pro - 2024-12-04 at 14 03 30
Cancellation Tx Send Tx Cancelled ERC20Approval Cancelled
Simulator Screenshot - iPhone 16 Pro Max - 2024-12-06 at 14 35 08 Simulator Screenshot - iPhone 16 Pro Max - 2024-12-06 at 14 35 22 Simulator Screenshot - iPhone 16 Pro Max - 2024-12-06 at 15 06 19
ERC20 Tx Cancelled
Simulator Screenshot - iPhone 16 Pro Max - 2024-12-06 at 15 43 31

Speed up a eth tx
For demo purpose the banner will be displayed 1 second after tx status screen is visible. But the actual timer is 5 seconds. If you tx is confirmed or errored out before 5 seconds you won't see the speed up banner
https://github.com/user-attachments/assets/fd653976-db8b-4771-b55b-5291ad710fcd

  1. create a ETH tx and confirm it. Please take a glance of the gas fee.
  2. once the tx status shows up, wait for the speed up banner to be shown
  3. click the speed up button
  4. you will see the tx status screen will be dismissed and a new pending tx will be shown and notice that this pending tx's gas fee should be greater than the gas fee in step 1
  5. confirm this pending tx
  6. tx should get confirmed shortly.

@nuo-xu nuo-xu added CI/skip-android Do not run CI builds for Android CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-windows-x64 Do not run CI builds for Windows x64 CI/skip-macos-arm64 Do not run CI builds for macOS arm64 CI/skip-teamcity Do not run builds in TeamCity labels Dec 9, 2024
@nuo-xu nuo-xu requested a review from StephenHeaps December 9, 2024 22:58
@nuo-xu nuo-xu self-assigned this Dec 9, 2024
@nuo-xu nuo-xu requested a review from a team as a code owner December 9, 2024 22:58
@nuo-xu nuo-xu changed the title feat(wallet): Cancel Tx in Tx Status Screen feat(wallet): Cancel & Speed Up Tx in Tx Status Screen Dec 11, 2024
@nuo-xu nuo-xu force-pushed the feature/41799-cancel-tx branch from 505ff53 to d0a4e7f Compare December 13, 2024 21:06
@nuo-xu nuo-xu merged commit f960649 into master Dec 16, 2024
18 checks passed
@nuo-xu nuo-xu deleted the feature/41799-cancel-tx branch December 16, 2024 16:11
@github-actions github-actions bot added this to the 1.75.x - Nightly milestone Dec 16, 2024
@brave-builds
Copy link
Collaborator

Released in v1.75.104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-android Do not run CI builds for Android CI/skip-macos-arm64 Do not run CI builds for macOS arm64 CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-teamcity Do not run builds in TeamCity CI/skip-windows-x64 Do not run CI builds for Windows x64
Projects
None yet
3 participants