Skip to content

chore: migrate swaps controller to typescript#25063

Merged
nikoferro merged 28 commits intodevelopfrom
swaps/controller-ts
Jun 21, 2024
Merged

chore: migrate swaps controller to typescript#25063
nikoferro merged 28 commits intodevelopfrom
swaps/controller-ts

Conversation

@nikoferro
Copy link
Copy Markdown
Contributor

@nikoferro nikoferro commented Jun 5, 2024

Description

This PR refactors the SwapsController class to be rewritten in typescript. For the sake of making sure all functionality stays the same, the tests have not been affected

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

Go to swaps. Swap on the following scenarios:

ETH -> WETH
WETH -> ETH
ETH -> ERC20
ERC20 -> ETH
ERC20 -> ERC20

Screenshots/Recordings

N/A

Before

N/A

After

N/A

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • 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 format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). 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.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Policy update failed. You can review the logs or retry the policy update here

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [47bff00]
Page Load Metrics (54 ± 7 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6815490189
domContentLoaded9421373
load4310854147
domInteractive9421373
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 3.08 KiB (0.09%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 11, 2024

Codecov Report

Attention: Patch coverage is 15.95331% with 216 lines in your changes missing coverage. Please review.

Project coverage is 64.87%. Comparing base (2ccf3cf) to head (a24c33d).

Files Patch % Lines
app/scripts/controllers/swaps.ts 14.35% 179 Missing ⚠️
app/scripts/controllers/swaps.utils.ts 11.90% 37 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25063      +/-   ##
===========================================
- Coverage    64.93%   64.87%   -0.06%     
===========================================
  Files         1385     1387       +2     
  Lines        54958    55014      +56     
  Branches     14421    14451      +30     
===========================================
+ Hits         35682    35687       +5     
- Misses       19276    19327      +51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nikoferro nikoferro added the team-swaps-deprecated DEPRECATED: please use "team-swaps-and-bridge" instead label Jun 11, 2024
@nikoferro nikoferro marked this pull request as ready for review June 11, 2024 13:37
@nikoferro nikoferro requested a review from a team as a code owner June 11, 2024 13:37
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [7050331]
Page Load Metrics (50 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint70998284
domContentLoaded8131010
load41655073
domInteractive8131010
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 3.08 KiB (0.09%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

callumelvidge
callumelvidge previously approved these changes Jun 12, 2024
@nikoferro nikoferro added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jun 14, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [21b9c5e]
Page Load Metrics (216 ± 238 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint69998084
domContentLoaded10201221
load441846216495238
domInteractive10201221
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 3.08 KiB (0.09%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

infiniteflower
infiniteflower previously approved these changes Jun 19, 2024
@nikoferro nikoferro dismissed stale reviews from infiniteflower and callumelvidge via 15b7f81 June 19, 2024 18:00
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [7c9857b]
Page Load Metrics (39 ± 1 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint60142752211
domContentLoaded812910
load37473931
domInteractive812910
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 3.08 KiB (0.09%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@infiniteflower infiniteflower self-requested a review June 19, 2024 19:08
@nikoferro nikoferro requested a review from callumelvidge June 19, 2024 19:41
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [a24c33d]
Page Load Metrics (238 ± 250 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint752211003014
domContentLoaded108616168
load461939238521250
domInteractive98616168
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 3.08 KiB (0.09%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@nikoferro nikoferro merged commit 533a483 into develop Jun 21, 2024
@nikoferro nikoferro deleted the swaps/controller-ts branch June 21, 2024 08:37
@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jun 21, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-swaps-deprecated DEPRECATED: please use "team-swaps-and-bridge" instead

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants