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: Redesigned setApprovalForAll confirmations #27061

Merged
merged 14 commits into from
Sep 24, 2024
Merged

Conversation

pedronfigueiredo
Copy link
Contributor

@pedronfigueiredo pedronfigueiredo commented Sep 11, 2024

Description

Implement setApprovalForAll redesigned confirmation for ERC721 and ERC1155 tokens. Includes e2e tests that use the Page Object Model, and refactors withRedesignedConfirmations to support EIP1559 transactions.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2937

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Screenshot 2024-09-11 at 14 17 54

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.

@pedronfigueiredo pedronfigueiredo added the team-confirmations Push issues to confirmations team label Sep 11, 2024
@pedronfigueiredo pedronfigueiredo self-assigned this Sep 11, 2024
Copy link
Contributor

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
Copy link
Collaborator

Builds ready [1244155]
Page Load Metrics (1767 ± 73 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30121061622452217
domContentLoaded15662094175214570
load15742108176715273
domInteractive156433157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.58 KiB (0.08%)
  • common: 317 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [4a0bd3a]
Page Load Metrics (1568 ± 68 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14391958157713464
domContentLoaded13961949155713766
load14041960156814168
domInteractive216030126
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.58 KiB (0.08%)
  • common: 317 Bytes (0.00%)

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

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

Project coverage is 70.01%. Comparing base (1d686e2) to head (5bbbe7b).
Report is 19 commits behind head on develop.

Files with missing lines Patch % Lines
...s/confirmations/components/confirm/title/title.tsx 0.00% 4 Missing ⚠️
...m/info/approve/approve-details/approve-details.tsx 85.71% 1 Missing ⚠️
...ges/confirmations/components/confirm/info/info.tsx 0.00% 1 Missing ⚠️
...pproval-for-all-info/set-approval-for-all-info.tsx 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #27061      +/-   ##
===========================================
- Coverage    70.09%   70.01%   -0.08%     
===========================================
  Files         1438     1447       +9     
  Lines        49971    50218     +247     
  Branches     13989    14048      +59     
===========================================
+ Hits         35026    35157     +131     
- Misses       14945    15061     +116     

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

OGPoyraz
OGPoyraz previously approved these changes Sep 13, 2024
Comment on lines 46 to 62
await withFixtures(
{
dapp: true,
fixtures: new FixtureBuilder()
.withPermissionControllerConnectedToTestDapp()
.withPreferencesController({
preferences: {
redesignedConfirmationsEnabled: true,
isRedesignedConfirmationsDeveloperEnabled: true,
},
})
.build(),
ganacheOptions: defaultGanacheOptionsForType2Transactions,
smartContract,
testSpecificMock: mocks,
title: this.test?.fullTitle(),
},
Copy link
Contributor

Choose a reason for hiding this comment

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

[comment]

we have a helper method withRedesignConfirmationFixtures which we could update to support more options. The more I think about it, we could do what we did in the last PR and create a method to generate the fixture options object with these options instead.

@@ -16,7 +16,11 @@ import {
RecipientRow,
} from '../../shared/transaction-details/transaction-details';

const Spender = () => {
const Spender = ({
isSetApprovalForAll,
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] we could set a default value to fix type to boolean

Suggested change
isSetApprovalForAll,
isSetApprovalForAll = false,

@@ -44,14 +51,18 @@ const Spender = () => {
);
};

export const ApproveDetails = () => {
export const ApproveDetails = ({
isSetApprovalForAll,
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] we could set a default value to fix type to boolean

Suggested change
isSetApprovalForAll,
isSetApprovalForAll = false,

digiwand
digiwand previously approved these changes Sep 13, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [1fd42fe]
Page Load Metrics (1783 ± 127 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint22126701717431207
domContentLoaded147426491768262126
load148226611783264127
domInteractive146329105
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.58 KiB (0.08%)
  • common: 317 Bytes (0.00%)

OGPoyraz
OGPoyraz previously approved these changes Sep 23, 2024
@digiwand
Copy link
Contributor

2 tests suites failing which requires updates:

minor lint fix
CleanShot 2024-09-23 at 20 26 32@2x

SonarCloud is flagging coverage < 80%
https://sonarcloud.io/component_measures?id=metamask-extension&pullRequest=27061&metric=new_coverage&view=list
CleanShot 2024-09-24 at 00 37 53@2x

Copy link

sonarcloud bot commented Sep 23, 2024

@pedronfigueiredo pedronfigueiredo merged commit 0a7732b into develop Sep 24, 2024
76 of 77 checks passed
@pedronfigueiredo pedronfigueiredo deleted the pnf/2937 branch September 24, 2024 09:07
@metamaskbot
Copy link
Collaborator

Builds ready [717c4ff]
Page Load Metrics (1759 ± 103 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint11124301688419201
domContentLoaded14922363173520699
load150024451759215103
domInteractive15105422311
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 5.58 KiB (0.08%)
  • common: 317 Bytes (0.00%)

@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2024
@metamaskbot metamaskbot added release-12.6.0 Issue or pull request that will be included in release 12.6.0 release-12.5.0 Issue or pull request that will be included in release 12.5.0 and removed release-12.6.0 Issue or pull request that will be included in release 12.6.0 labels Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.5.0 Issue or pull request that will be included in release 12.5.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants