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

Transaction-list-item-details pop up to display the correct token information on token approve item #17422

Merged
merged 24 commits into from
Feb 24, 2023

Conversation

NiranjanaBinoy
Copy link
Contributor

@NiranjanaBinoy NiranjanaBinoy commented Jan 25, 2023

Explanation

Fixes #17228
Currently, for approve token pop up Transaction-list-item-details displays the details of only those tokens that are added to the wallet, if not a generic detail is displayed as shown in the ticket. With this fix, we are comparing the token address to the tokens available in detected tokens, tokens list, and custom tokens.

Screenshots/Screencaps

Before

After

Manual Testing Steps

  1. Create a token from the test-dapp
  2. Click approve token in the test-dapp
  3. Once the token is approved, go to the activity tab and click Approve Token spending Cap and verify the amount in spending cap.

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@NiranjanaBinoy NiranjanaBinoy requested a review from a team as a code owner January 25, 2023 22:29
@NiranjanaBinoy NiranjanaBinoy self-assigned this Jan 25, 2023
@github-actions
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.

@NiranjanaBinoy NiranjanaBinoy added type-bug Sev2-normal Normal severity; minor loss of service or inconvenience. labels Jan 25, 2023
ui/hooks/useAssetDetails.js Outdated Show resolved Hide resolved
@metamaskbot
Copy link
Collaborator

Builds ready [d37ae19]
Page Load Metrics (1156 ± 86 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint93161123189
domContentLoaded9671616114018187
load10031617115617986
domInteractive9671616114018187
Bundle size diffs
  • background: 0 bytes
  • ui: 683 bytes
  • common: 0 bytes

test/e2e/metamask-ui.spec.js Outdated Show resolved Hide resolved
jpuri
jpuri previously approved these changes Feb 5, 2023
Copy link
Contributor

@jpuri jpuri left a comment

Choose a reason for hiding this comment

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

👍

@digiwand digiwand self-requested a review February 7, 2023 13:51
digiwand
digiwand previously approved these changes Feb 7, 2023
Copy link
Contributor

@digiwand digiwand left a comment

Choose a reason for hiding this comment

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

tested on macOS x Chrome - LGTM!

left one minor suggestion above

@metamaskbot
Copy link
Collaborator

Builds ready [a00763f]
Page Load Metrics (1419 ± 148 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint100154120147
domContentLoaded101119831369298143
load101120861419308148
domInteractive101119831369298143
Bundle size diffs
  • background: 0 bytes
  • ui: 683 bytes
  • common: 0 bytes

@metamaskbot
Copy link
Collaborator

Builds ready [f37124e]
Page Load Metrics (1309 ± 120 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint923601285627
domContentLoaded100116891274268129
load101616891309250120
domInteractive100116891274268129
Bundle size diffs
  • background: 0 bytes
  • ui: 769 bytes
  • common: 0 bytes

@jpuri
Copy link
Contributor

jpuri commented Feb 15, 2023

Hey @NiranjanaBinoy , @seaona : I am curious why some much e2e fixes were needed in this PR. Does it introduces delay at some point ?

@metamaskbot
Copy link
Collaborator

Builds ready [0b8ebb6]
Page Load Metrics (1376 ± 117 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1021861232110
domContentLoaded108218421335254122
load109418421376243117
domInteractive108218411335254122
Bundle size diffs
  • background: 0 bytes
  • ui: 769 bytes
  • common: 0 bytes

@metamaskbot
Copy link
Collaborator

Builds ready [0444a16]
Page Load Metrics (1509 ± 54 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint95151110157
domContentLoaded1236155714619043
load12551650150911254
domInteractive1236155714619043
Bundle size diffs
  • background: 0 bytes
  • ui: 769 bytes
  • common: 0 bytes

@NiranjanaBinoy
Copy link
Contributor Author

NiranjanaBinoy commented Feb 15, 2023

Hey @NiranjanaBinoy , @seaona : I am curious why some much e2e fixes were needed in this PR. Does it introduces delay at some point ?

Hi @jpuri,
The tests are failing only on firefox Circle CI.

In this PR, we are introducing useAssetDetails to useTransactionDisplayData, which will be called when the transaction lists are displayed in the activity tab. This means useAssetDetails will be getting called for all the transactions, but inside the useAssetDetails, we are restricting the getAssetDetails calls based on the isTokenCategory so the getAssetDetails will get executed only for token approvals and transfers. I am not exactly sure, but I am suspecting that calling useAssetDetails for the transactions in the list might have introduced a slight delay but the functionalities inside the hook are not fully executed for any transaction other than token transfer or approval.

@metamaskbot
Copy link
Collaborator

Builds ready [f65a939]
Page Load Metrics (1633 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint93151119168
domContentLoaded1506173415876029
load1519178816338641
domInteractive1506173415876029
Bundle size diffs
  • background: 0 bytes
  • ui: 814 bytes
  • common: 0 bytes

Katew212

This comment was marked as spam.

jpuri
jpuri previously approved these changes Feb 21, 2023
Copy link
Contributor

@jpuri jpuri left a comment

Choose a reason for hiding this comment

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

LGTM, just a small feedback added.

@metamaskbot
Copy link
Collaborator

Builds ready [8365d4a]
Page Load Metrics (1579 ± 70 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint991711202110
domContentLoaded14161979157014469
load14161980157914570
domInteractive14161979157014469
Bundle size diffs
  • background: 0 bytes
  • ui: 819 bytes
  • common: 0 bytes

@NiranjanaBinoy NiranjanaBinoy merged commit bc19856 into develop Feb 24, 2023
@NiranjanaBinoy NiranjanaBinoy deleted the update-spending-cap branch February 24, 2023 19:21
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Spend Limit amount from an Approve transaction points to ETH instead of the ERC20 token
6 participants