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: cross chain swaps - tx status #27740

Closed
wants to merge 139 commits into from

Conversation

infiniteflower
Copy link
Contributor

@infiniteflower infiniteflower commented Oct 9, 2024

Description

This PR does the following:

  1. Adds the BridgeStatusController to track the status of a Bridge transaction. It will also restart polling if you have closed the browser and you still have pending bridge txs.
  2. Displays 2 segment bars in an Activity List transaction representing the source + dest transaction.
  3. DIsplays a custom Bridge Transaction Detail screen when a Bridge transaction is clicked.

Open in GitHub Codespaces

Related issues

Related to and targetting: #27262

Manual testing steps

Simple bridge

  1. Go to Bridge
  2. Fill in source/dest token and amounts
  3. Get a quote
  4. Execute Bridge
  5. Click on Activity list item for Bridge tx
  6. Observe process

Restarting polling

  1. Go to Bridge
  2. Fill in source/dest token and amounts
  3. Get a quote
  4. Execute Bridge
  5. Observe Pending status
  6. Close browser
  7. Wait for 5 min
  8. Reopen browser
  9. Status should be Complete
  10. Click on Bridge tx
  11. Bridge tx details should look correct

Screenshots/Recordings

Before

After

Screen.Recording.2024-11-08.at.11.21.58.AM.mov

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

github-actions bot commented Oct 9, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@infiniteflower infiniteflower force-pushed the mb892-cross-chain-swap-tx-submit branch from d2d1d5a to 6de5ea4 Compare October 9, 2024 18:56
@infiniteflower infiniteflower force-pushed the mb893-cross-chain-swap-tx-status-2 branch 2 times, most recently from e4a6cc1 to 1fe19a5 Compare October 11, 2024 18:30
@infiniteflower infiniteflower changed the title chore: setup bridge status controller skeleton Cross chain swaps - tx status Oct 11, 2024
@infiniteflower infiniteflower force-pushed the mb893-cross-chain-swap-tx-status-2 branch 2 times, most recently from 3ac61cb to 337cf73 Compare October 15, 2024 15:24
@infiniteflower infiniteflower force-pushed the mb893-cross-chain-swap-tx-status-2 branch 2 times, most recently from d79e23d to 091155b Compare October 16, 2024 19:03
@infiniteflower infiniteflower force-pushed the mb893-cross-chain-swap-tx-status-2 branch from be26838 to 366505d Compare October 17, 2024 15:58
@infiniteflower infiniteflower force-pushed the mb893-cross-chain-swap-tx-status-2 branch from 96e6e20 to aabcc94 Compare October 21, 2024 19:51
@infiniteflower infiniteflower force-pushed the mb893-cross-chain-swap-tx-status-2 branch from a6352ec to 0ebe6c3 Compare November 4, 2024 21:31
@infiniteflower infiniteflower force-pushed the mb893-cross-chain-swap-tx-status-2 branch 2 times, most recently from af8e0c9 to 6aa4f93 Compare November 8, 2024 16:11
@metamaskbot
Copy link
Collaborator

Builds ready [3d57b48]
Page Load Metrics (1746 ± 52 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint33820341673323155
domContentLoaded15632009172410450
load15712033174610852
domInteractive24103482110
backgroundConnect85825168
firstReactRender44207864421
getState460232110
initialActions00000
loadScripts1124149112598842
setupStore1272322311
uiStartup17662290196914670
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 6.71 KiB (0.15%)
  • ui: 41.88 KiB (0.54%)
  • common: 13.45 KiB (0.16%)

@infiniteflower infiniteflower changed the title Cross chain swaps - tx status feat: cross chain swaps - tx status Nov 14, 2024
@infiniteflower infiniteflower force-pushed the mb893-cross-chain-swap-tx-status-2 branch from 3d57b48 to c1adb80 Compare November 14, 2024 16:03
@metamaskbot
Copy link
Collaborator

Builds ready [c1adb80]
Page Load Metrics (1885 ± 59 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint40122031811346166
domContentLoaded16682179185511857
load16822202188512259
domInteractive28210794823
backgroundConnect786332311
firstReactRender511661042813
getState55318178
initialActions00000
loadScripts1220159213719646
setupStore544984
uiStartup18892411209013263
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 4.95 KiB (0.08%)
  • ui: 41.74 KiB (0.54%)
  • common: 12.14 KiB (0.15%)

@metamaskbot
Copy link
Collaborator

Builds ready [e43b87a]
Page Load Metrics (1928 ± 61 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17202160193312359
domContentLoaded16742083188611455
load17192157192812761
domInteractive2098532110
backgroundConnect10106432814
firstReactRender562931065426
getState55916168
initialActions01000
loadScripts1223157213899847
setupStore685162010
uiStartup19132448216615474
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 4.95 KiB (0.08%)
  • ui: 41.85 KiB (0.54%)
  • common: 12.18 KiB (0.15%)

@infiniteflower infiniteflower force-pushed the mb893-cross-chain-swap-tx-status-2 branch from 088a7b4 to 076a868 Compare November 21, 2024 19:45
@metamaskbot
Copy link
Collaborator

Builds ready [076a868]
Page Load Metrics (2071 ± 81 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint50024772003382184
domContentLoaded17672356203315172
load17842489207116981
domInteractive25186513517
backgroundConnect9126512914
firstReactRender632191314120
getState1070282110
initialActions00000
loadScripts13021716148011354
setupStore67918209
uiStartup198128152332208100
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 11.32 KiB (0.19%)
  • ui: 36.22 KiB (0.47%)
  • common: 2.61 KiB (0.03%)

micaelae
micaelae previously approved these changes Nov 22, 2024
@infiniteflower infiniteflower marked this pull request as ready for review November 22, 2024 15:27
@infiniteflower infiniteflower requested review from a team as code owners November 22, 2024 15:27
@infiniteflower infiniteflower marked this pull request as draft November 22, 2024 15:44
@metamaskbot
Copy link
Collaborator

Builds ready [d1ac948]
Page Load Metrics (1960 ± 92 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16632432195619091
domContentLoaded16522419192318287
load16652429196019192
domInteractive18149492814
backgroundConnect14117432813
firstReactRender562011103416
getState571242110
initialActions01000
loadScripts12061870142516077
setupStore66015178
uiStartup186127482184217104
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 11.27 KiB (0.19%)
  • ui: 36.25 KiB (0.47%)
  • common: 2.7 KiB (0.03%)

@metamaskbot
Copy link
Collaborator

Builds ready [fa941e9]
Page Load Metrics (1948 ± 99 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint27024121859414199
domContentLoaded16452401191019895
load16802417194820699
domInteractive19228514421
backgroundConnect11131383014
firstReactRender943701607737
getState583212512
initialActions01000
loadScripts11921860140215574
setupStore665202110
uiStartup184829012292282135
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 11.27 KiB (0.19%)
  • ui: 36.52 KiB (0.47%)
  • common: 2.77 KiB (0.03%)

@metamaskbot
Copy link
Collaborator

Builds ready [b074101]
Page Load Metrics (1914 ± 100 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint44225001826368177
domContentLoaded16382419188819895
load165125081914208100
domInteractive258841189
backgroundConnect1189292412
firstReactRender532181243215
getState56616189
initialActions00000
loadScripts11981741137813665
setupStore65510105
uiStartup184727252150212102
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 11.27 KiB (0.19%)
  • ui: 35.8 KiB (0.46%)
  • common: 2.77 KiB (0.03%)

github-merge-queue bot pushed a commit that referenced this pull request Nov 26, 2024
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

This PR is a collection of all the background related code from #27740
(no UI changes). It has been split up in order to make it easier to
review. A follow up PR containing all the UI changes from #27740 is
here: #28657

The main addition is the `BridgeStatusController` and its supporting
code.

If you would like to test the functionality of this PR through the UI,
please do so through #27740.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28636?quickstart=1)

## **Related issues**

Branched off from #27740

## **Manual testing steps**

Refer to #27740

## **Screenshots/Recordings**

Refer to #27740

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@infiniteflower
Copy link
Contributor Author

Closing this as #28657 is now the head of all the Bridge status work

@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants