Skip to content

fix: remove btc account from permission connect lists#25980

Merged
montelaidev merged 18 commits intodevelopfrom
fix/remove-btc-account-from-permission-connect-lists
Jul 25, 2024
Merged

fix: remove btc account from permission connect lists#25980
montelaidev merged 18 commits intodevelopfrom
fix/remove-btc-account-from-permission-connect-lists

Conversation

@montelaidev
Copy link
Copy Markdown
Contributor

Description

This PR filters BTC accounts from the permission connect list.

Related issues

Fixes:

Manual testing steps

  1. Create a BTC account
  2. Connect to a dapp
  3. Open popup
  4. Click network icon
  5. Click on Connect more accounts
  6. See that there aren't any btc accounts

Screenshots/Recordings

Before

Screenshot 2024-07-19 at 21 09 57

After

Screenshot 2024-07-19 at 21 04 04

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 added the team-accounts-framework Accounts team label Jul 19, 2024
@montelaidev montelaidev self-assigned this Jul 19, 2024
@github-actions
Copy link
Copy Markdown
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.

@montelaidev montelaidev marked this pull request as ready for review July 19, 2024 13:48
@montelaidev montelaidev requested a review from a team as a code owner July 19, 2024 13:48
@montelaidev montelaidev force-pushed the fix/remove-btc-account-from-permission-connect-lists branch from f72235d to b37090e Compare July 19, 2024 15:09
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR filters out BTC accounts from the permission connect list to ensure only EVM-compatible accounts are displayed.

  • ui/components/multichain/connect-accounts-modal/connect-accounts-modal.tsx: Filters out non-EVM accounts using isEvmAccountType function.
  • ui/pages/permissions-connect/permissions-connect.container.js: Filters non-EVM accounts from the permissions connect list.
  • ui/components/multichain/connect-accounts-modal/connect-accounts-modal.test.tsx: Updates tests to ensure only EVM accounts are rendered.
  • ui/pages/permissions-connect/permissions-connect.test.tsx: Adds tests to verify BTC accounts are excluded from the permission connect list.
  • test/jest/mocks.ts: Migrates to TypeScript, enhancing type safety and maintainability.

10 file(s) reviewed, 25 comment(s)
Edit PR Review Bot Settings

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR focuses on filtering out BTC accounts from the permission connect list to ensure only EVM-compatible accounts are displayed.

  • .circleci/config.yml: Removed jobs related to 'confirmation redesign' feature, simplifying CI configuration.
  • app/scripts/background.js: Enhanced initialization process with test-specific overrides for keyring bridges.
  • app/scripts/controllers/preferences.js: Added isRedesignedConfirmationsDeveloperEnabled state property.
  • app/scripts/lib/ppom/ppom-middleware.ts: Introduced isChainSupported function for dynamic chain support checks.
  • ui/selectors/selectors.js: Filtered out BTC accounts from permission connect lists.

123 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR filters BTC accounts from the permission connect list to ensure only EVM-compatible accounts are displayed.

  • test/e2e/api-specs/ConfirmationRejectionRule.ts: Removed rejectButtonInsteadOfCancel array and associated logic, now consistently clicking 'Cancel' for all methods.
  • /ui/selectors/accounts.ts: Added utility functions to identify BTC accounts and filter them out.
  • /ui/pages/permissions-connect/choose-account: Updated ChooseAccount component to exclude BTC accounts.
  • /ui/components/ui/account-list/account-list.js: Modified handleEvmAccountClick to ensure only EVM accounts are selectable.
  • /app/scripts/controllers/permissions/background-api.js: Adjusted removePermittedAccount to handle BTC accounts appropriately.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR filters BTC accounts from the permission connect list to ensure only EVM-compatible accounts are displayed.

  • .circleci/config.yml: Removed test-e2e-swap-playwright job to streamline CI pipeline.
  • app/scripts/background.js: Added conditional logic to initialize socket connection for Mocha tests.
  • shared/lib/transactions-controller-utils.js: Introduced precision parameter to getSwapsTokensReceivedFromTxMeta for flexible rounding.
  • ui/pages/permissions-connect/choose-account: Updated ChooseAccount component to exclude BTC accounts.
  • test/e2e/background-socket/server-mocha-to-background.ts: Added WebSocket server class for enhanced end-to-end testing.

125 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR filters BTC accounts from the permission connect list to ensure only EVM-compatible accounts are displayed.

  • app/scripts/metamask-controller.js: Added getIsConfirmationAdvancedDetailsOpen method to filter BTC accounts.
  • ui/pages/permissions-connect/choose-account: Updated ChooseAccount component to exclude BTC accounts.
  • ui/selectors/accounts.ts: Added utility functions to identify BTC accounts.
  • ui/components/multichain/account-list-item/account-list-item.js: Modified to handle BTC account exclusion.
  • ui/components/multichain/account-list-menu/account-list-menu.js: Updated account list menu to exclude BTC accounts.

10 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR filters BTC accounts from the permission connect list to ensure only EVM-compatible accounts are displayed.

  • test/e2e/flask/btc/btc-dapp-connection.spec.ts: Removed BTC account interactions and assertions to align with the new filtering requirement.
  • app/scripts/metamask-controller.js: Added logic to filter BTC accounts from the permission connect list.
  • ui/pages/permissions-connect/choose-account: Updated ChooseAccount component to exclude BTC accounts.
  • ui/selectors/accounts.ts: Added utility functions to identify and filter BTC accounts.
  • ui/components/multichain/account-list-item/account-list-item.js: Modified to handle BTC account exclusion in the account list.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [db5849a]
Page Load Metrics (159 ± 181 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint591571042713
domContentLoaded97331199
load461795159376181
domInteractive97331199
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 342 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@MetaMask MetaMask deleted a comment from greptile-apps bot Jul 25, 2024
@MetaMask MetaMask deleted a comment from greptile-apps bot Jul 25, 2024
@MetaMask MetaMask deleted a comment from greptile-apps bot Jul 25, 2024
@MetaMask MetaMask deleted a comment from greptile-apps bot Jul 25, 2024
@MetaMask MetaMask deleted a comment from greptile-apps bot Jul 25, 2024
Co-authored-by: Daniel Rocha <daniel.rocha@consensys.net>
danroc
danroc previously approved these changes Jul 25, 2024
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR filters BTC accounts from the permission connect list to ensure only EVM-compatible accounts are displayed.

  • ui/pages/permissions-connect/permissions-connect.test.tsx: Added test case to verify BTC accounts are excluded from the permission connect list.
  • ui/selectors/accounts.ts: Added utility functions to identify and filter BTC accounts.
  • ui/selectors/accounts.test.ts: Updated tests to cover new BTC account filtering logic.

No major changes found since the last review.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@danroc danroc requested review from greptile-apps[bot] and removed request for greptile-apps[bot] July 25, 2024 13:30
ccharly
ccharly previously approved these changes Jul 25, 2024
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR filters BTC accounts from the permission connect list to ensure only EVM-compatible accounts are displayed.

  • app/scripts/lib/accounts/BalancesController.test.ts: Removed TypeScript error suppression comments, improving type safety.
  • test/e2e/flask/btc/btc-dapp-connection.spec.ts: Updated to ensure BTC accounts are not present in the account selection list.
  • ui/components/multichain/connect-accounts-modal/connect-accounts-modal.tsx: Filters out non-EVM accounts using isEvmAccountType function.
  • ui/pages/permissions-connect/permissions-connect.container.js: Filters BTC accounts from the permissions connect list.
  • ui/pages/permissions-connect/permissions-connect.test.tsx: Added tests to verify BTC accounts are excluded from the permission connect list.

11 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@montelaidev montelaidev dismissed stale reviews from ccharly and danroc via 6b4133d July 25, 2024 14:00
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR filters BTC accounts from the permission connect list to ensure only EVM-compatible accounts are displayed.

  • ui/components/multichain/connect-accounts-modal/connect-accounts-modal.tsx: Filters out non-EVM accounts using isEvmAccountType function.
  • ui/pages/permissions-connect/choose-account/choose-account.js: Filters BTC accounts from the permissions connect list.
  • ui/pages/permissions-connect/permissions-connect.container.js: Filters BTC accounts from the permissions connect list.
  • ui/helpers/utils/permissions.ts: Adds utility function to check for ETH permissions and non-EVM accounts.
  • test/e2e/flask/btc/btc-dapp-connection.spec.ts: Updated to ensure BTC accounts are not present in the account selection list.

No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@sonarqubecloud
Copy link
Copy Markdown

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [6b4133d]
Page Load Metrics (185 ± 233 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint811861212512
domContentLoaded96625167
load472293185484233
domInteractive96625167
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 342 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@montelaidev montelaidev merged commit 95f7753 into develop Jul 25, 2024
@montelaidev montelaidev deleted the fix/remove-btc-account-from-permission-connect-lists branch July 25, 2024 14:37
@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2024
@metamaskbot metamaskbot added the release-12.3.0 Issue or pull request that will be included in release 12.3.0 label Jul 25, 2024
@metamaskbot metamaskbot added release-12.2.0 Issue or pull request that will be included in release 12.2.0 and removed release-12.3.0 Issue or pull request that will be included in release 12.3.0 labels Aug 30, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Missing release label release-12.2.0 on PR. Adding release label release-12.2.0 on PR and removing other release labels(release-12.3.0), as PR was cherry-picked in branch 12.2.0.

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-accounts-framework Accounts team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants