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

chore: add bridge controller, store and api utils #25044

Merged
merged 6 commits into from
Jun 28, 2024

Conversation

micaelae
Copy link
Member

@micaelae micaelae commented Jun 5, 2024

Description

This PR doesn't have user-facing effects, just setting up state management for subsequent feature PRs.

Changes include

  • a new bridge controller that manages background state for the cross-chain swaps experience
  • basic redux slice for bridging. Note that the slice extends swaps, since we plan to decouple the frontend components for now but merge the experiences later on
  • e2e tests for current bridge button behavior
  • new logic for fetching and setting bridge feature flags

Open in GitHub Codespaces

Related issues

Fixes: METABRIDGE-889

Manual testing steps

  1. Load extension
  2. Verify that Bridge button behavior has not changed

Screenshots/Recordings

Before

After

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.

@micaelae micaelae requested review from a team as code owners June 5, 2024 00:03
@micaelae micaelae marked this pull request as draft June 5, 2024 00:03
@micaelae micaelae force-pushed the mb889-bridge-controller branch 12 times, most recently from 1dccfa0 to 2598383 Compare June 8, 2024 00:42
@micaelae micaelae force-pushed the mb889-bridge-controller branch 14 times, most recently from 32dd55f to 512636b Compare June 19, 2024 01:23
@micaelae micaelae force-pushed the mb889-bridge-controller branch from ab9fd63 to 581e6b7 Compare June 25, 2024 20:44
@metamaskbot
Copy link
Collaborator

Builds ready [581e6b7]
Page Load Metrics (44 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint611017694
domContentLoaded8131011
load39614463
domInteractive8131011
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.61 KiB (0.05%)
  • ui: 798 Bytes (0.01%)
  • common: 313 Bytes (0.00%)

BZahory
BZahory previously approved these changes Jun 26, 2024
@micaelae micaelae force-pushed the mb889-bridge-controller branch from 2cf440c to 5d90ab0 Compare June 26, 2024 19:13
@micaelae micaelae removed the request for review from a team June 26, 2024 19:14
ejwessel
ejwessel previously approved these changes Jun 26, 2024
@micaelae micaelae force-pushed the mb889-bridge-controller branch from 5d90ab0 to 574eaa6 Compare June 27, 2024 02:14
@metamaskbot
Copy link
Collaborator

Builds ready [5d90ab0]
Page Load Metrics (149 ± 197 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint70204912914
domContentLoaded9151111
load401938149411197
domInteractive9151111
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.61 KiB (0.05%)
  • ui: 798 Bytes (0.01%)
  • common: 363 Bytes (0.01%)

@metamaskbot
Copy link
Collaborator

Builds ready [5d90ab0]
Page Load Metrics (149 ± 197 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint70204912914
domContentLoaded9151111
load401938149411197
domInteractive9151111
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.61 KiB (0.05%)
  • ui: 798 Bytes (0.01%)
  • common: 363 Bytes (0.01%)

@micaelae micaelae dismissed stale reviews from BZahory and ejwessel via 4ecb621 June 27, 2024 18:06
@micaelae micaelae force-pushed the mb889-bridge-controller branch from 4ecb621 to 3bbb6eb Compare June 28, 2024 18:53
Copy link

codecov bot commented Jun 28, 2024

Codecov Report

Attention: Patch coverage is 82.92683% with 7 lines in your changes missing coverage. Please review.

Project coverage is 69.58%. Comparing base (4a9c480) to head (3bbb6eb).

Files Patch % Lines
ui/hooks/bridge/useBridging.ts 0.00% 5 Missing ⚠️
app/scripts/controllers/bridge.ts 85.71% 1 Missing ⚠️
shared/constants/bridge.ts 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25044      +/-   ##
===========================================
+ Coverage    69.57%   69.58%   +0.01%     
===========================================
  Files         1360     1365       +5     
  Lines        48172    48213      +41     
  Branches     13296    13299       +3     
===========================================
+ Hits         33513    33548      +35     
- Misses       14659    14665       +6     

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

@metamaskbot
Copy link
Collaborator

Builds ready [3bbb6eb]
Page Load Metrics (68 ± 9 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6815795199
domContentLoaded108027157
load4913068189
domInteractive108027157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.61 KiB (0.05%)
  • ui: 798 Bytes (0.01%)
  • common: 363 Bytes (0.01%)

@micaelae micaelae merged commit 58082f5 into develop Jun 28, 2024
61 checks passed
@micaelae micaelae deleted the mb889-bridge-controller branch June 28, 2024 21:31
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2024
@metamaskbot metamaskbot added the release-12.2.0 Issue or pull request that will be included in release 12.2.0 label Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.2.0 Issue or pull request that will be included in release 12.2.0 team-bridge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants