Skip to content

Commit

Permalink
refactor: rename SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS_FALLBACK_LIST (#…
Browse files Browse the repository at this point in the history
…28337)

## **Description**

Rename `SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS` →
`SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS_FALLBACK_LIST` to be more
explicit now that we are fetching the chain ids list from the Security
Provider API introduced in
#25716

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28337?quickstart=1)

## **Related issues**

Fixes: MetaMask/MetaMask-planning#2846
Related: #25716

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
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.
  • Loading branch information
digiwand authored Nov 7, 2024
1 parent 0064020 commit bde47a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/scripts/lib/ppom/ppom-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SignatureController } from '@metamask/signature-controller';
import {
BlockaidReason,
BlockaidResultType,
SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS,
SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS_FALLBACK_LIST,
SecurityAlertSource,
} from '../../../../shared/constants/security-provider';
import { SIGNING_METHODS } from '../../../../shared/constants/transaction';
Expand Down Expand Up @@ -123,7 +123,7 @@ export function handlePPOMError(
}

export async function isChainSupported(chainId: Hex): Promise<boolean> {
let supportedChainIds = SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS;
let supportedChainIds = SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS_FALLBACK_LIST;

try {
if (isSecurityAlertsAPIEnabled()) {
Expand Down
2 changes: 1 addition & 1 deletion shared/constants/security-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const FALSE_POSITIVE_REPORT_BASE_URL =

export const SECURITY_PROVIDER_UTM_SOURCE = 'metamask-ppom';

export const SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS: Hex[] = [
export const SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS_FALLBACK_LIST: Hex[] = [
CHAIN_IDS.ARBITRUM,
CHAIN_IDS.AVALANCHE,
CHAIN_IDS.BASE,
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/mock-e2e.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require('fs');

const {
SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS,
SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS_FALLBACK_LIST,
} = require('../../shared/constants/security-provider');
const {
BRIDGE_DEV_API_BASE_URL,
Expand Down Expand Up @@ -160,7 +160,7 @@ async function setupMocking(
.thenCallback(() => {
return {
statusCode: 200,
json: SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS,
json: SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS_FALLBACK_LIST,
};
});

Expand Down

0 comments on commit bde47a6

Please sign in to comment.