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: filter eth requests for non-EVM accounts #25038

Merged
merged 20 commits into from
Jun 14, 2024

Conversation

montelaidev
Copy link
Contributor

@montelaidev montelaidev commented Jun 4, 2024

Description

This PR adds a new middleware to filter EVM requests that goes to non-EVM accounts.

Related issues

Fixes https://github.com/MetaMask/accounts-planning/issues/462

Manual testing steps

Screenshots/Recordings

Before

After

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.

@montelaidev montelaidev self-assigned this Jun 4, 2024
@montelaidev montelaidev requested a review from a team as a code owner June 4, 2024 16:16
@montelaidev montelaidev changed the title Feat/filter eth requests for non evm accounts feat: filter eth requests for non evm accounts Jun 4, 2024
Copy link
Contributor

github-actions bot commented Jun 4, 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.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Jun 4, 2024
@montelaidev montelaidev marked this pull request as draft June 4, 2024 16:30
@montelaidev montelaidev marked this pull request as draft June 4, 2024 16:30
@montelaidev montelaidev force-pushed the feat/filter-eth-requests-for-non-evm-accounts branch from 27f9ea4 to 621f65d Compare June 6, 2024 14:38
@montelaidev montelaidev marked this pull request as ready for review June 7, 2024 15:31
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 93.10345% with 2 lines in your changes missing coverage. Please review.

Project coverage is 65.67%. Comparing base (e3071f2) to head (c4b6c1f).
Report is 7 commits behind head on develop.

Files Patch % Lines
.../scripts/controllers/permissions/specifications.js 66.67% 1 Missing ⚠️
...ateEvmMethodsToNonEvmAccountReqFilterMiddleware.ts 95.65% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25038      +/-   ##
===========================================
+ Coverage    65.65%   65.67%   +0.03%     
===========================================
  Files         1376     1377       +1     
  Lines        54569    54576       +7     
  Branches     14293    14295       +2     
===========================================
+ Hits         35822    35841      +19     
+ Misses       18747    18735      -12     

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

@metamaskbot
Copy link
Collaborator

Builds ready [a843ae1]
Page Load Metrics (777 ± 1118 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint713998288852409
domContentLoaded8167195362174
load411058277723291118
domInteractive8167195362174
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.96 KiB (0.06%)
  • ui: 0 Bytes (0.00%)
  • common: 482 Bytes (0.01%)

@metamaskbot
Copy link
Collaborator

Builds ready [8293cc0]
Page Load Metrics (148 ± 179 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint651821002914
domContentLoaded9391584
load431773148373179
domInteractive9391584
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.78 KiB (0.05%)
  • ui: 0 Bytes (0.00%)
  • common: 482 Bytes (0.01%)

@metamaskbot metamaskbot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Jun 13, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [796f872]
Page Load Metrics (231 ± 265 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6411182136
domContentLoaded9161121
load401899231552265
domInteractive9161121
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.72 KiB (0.05%)
  • ui: 0 Bytes (0.00%)
  • common: 482 Bytes (0.01%)

@@ -29,6 +29,7 @@ jest.mock('@metamask-institutional/portfolio-dashboard', () => ({
}));

jest.mock('./permissions', () => ({
...jest.requireActual('./permissions'),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only change here in the test. The rest was from linting.

@ccharly ccharly changed the title feat: filter eth requests for non evm accounts feat: filter eth requests for non-EVM accounts Jun 13, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [c4b6c1f]
Page Load Metrics (49 ± 4 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6711280115
domContentLoaded9281242
load40784994
domInteractive9281242
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.72 KiB (0.05%)
  • ui: 0 Bytes (0.00%)
  • common: 482 Bytes (0.01%)

@ccharly ccharly merged commit 8539477 into develop Jun 14, 2024
80 checks passed
@ccharly ccharly deleted the feat/filter-eth-requests-for-non-evm-accounts branch June 14, 2024 07:53
@github-actions github-actions bot locked and limited conversation to collaborators Jun 14, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 14, 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-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants