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

fix: replace decomissioned cloudflare-ipfs.com with gateway.pinata.cloud #11401

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/Base/RemoteImage/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jest.mock('react-redux', () => ({
...jest.requireActual('react-redux'),
useSelector: jest
.fn()
.mockImplementation(() => 'https://cloudflare-ipfs.com/ipfs/'),
.mockImplementation(() => 'https://gateway.pinata.cloud/ipfs/'),
}));

jest.mock('../../../components/hooks/useIpfsGateway', () => jest.fn());
Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/AssetIcon/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const mockInitialState = {
...backgroundState,
PreferencesController: {
featureFlags: {},
ipfsGateway: 'https://cloudflare-ipfs.com/ipfs/',
ipfsGateway: 'https://gateway.pinata.cloud/ipfs/',
lostIdentities: {},
selectedAddress: '0x76cf1CdD1fcC252442b50D6e97207228aA4aefC3',
useTokenDetection: true,
Expand All @@ -24,7 +24,7 @@ const mockInitialState = {
_W: {
featureFlags: {},
frequentRpcList: [],
ipfsGateway: 'https://cloudflare-ipfs.com/ipfs/',
ipfsGateway: 'https://gateway.pinata.cloud/ipfs/',
lostIdentities: {},
selectedAddress: '0x76cf1CdD1fcC252442b50D6e97207228aA4aefC3',
useTokenDetection: true,
Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/Swaps/components/TokenIcon.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('TokenIcon component', () => {
const icon = shallow(
<TokenIcon
symbol="DAI"
icon="https://cloudflare-ipfs.com/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
icon="https://gateway.pinata.cloud/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
/>,
);
expect(icon).toMatchSnapshot();
Expand All @@ -27,7 +27,7 @@ describe('TokenIcon component', () => {
<TokenIcon
medium
symbol="DAI"
icon="https://cloudflare-ipfs.com/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
icon="https://gateway.pinata.cloud/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
/>,
);
expect(iconMedium).toMatchSnapshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ describe('TokenSelectButton component', () => {
<TokenSelectButton
label="Select a token"
symbol="DAI"
icon="https://cloudflare-ipfs.com/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
icon="https://gateway.pinata.cloud/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
/>,
);
expect(icon).toMatchSnapshot();
const onPress = shallow(
<TokenSelectButton
label="Select a token"
symbol="DAI"
icon="https://cloudflare-ipfs.com/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
icon="https://gateway.pinata.cloud/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
onPress={dummyHandler}
/>,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ exports[`TokenIcon component should Render correctly 4`] = `
onError={[Function]}
source={
{
"uri": "https://cloudflare-ipfs.com/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ",
"uri": "https://gateway.pinata.cloud/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ",
}
}
style={
Expand Down Expand Up @@ -146,7 +146,7 @@ exports[`TokenIcon component should Render correctly 8`] = `
onError={[Function]}
source={
{
"uri": "https://cloudflare-ipfs.com/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ",
"uri": "https://gateway.pinata.cloud/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ",
}
}
style={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ exports[`TokenSelectButton component should Render correctly 4`] = `
}
>
<TokenIcon
icon="https://cloudflare-ipfs.com/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
icon="https://gateway.pinata.cloud/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
symbol="DAI"
/>
</View>
Expand All @@ -95,7 +95,7 @@ exports[`TokenSelectButton component should Render correctly 5`] = `
}
>
<TokenIcon
icon="https://cloudflare-ipfs.com/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
icon="https://gateway.pinata.cloud/ipfs/QmNYVMm3iC7HEoxfvxsZbRoapdjDHj9EREFac4BPeVphSJ"
symbol="DAI"
/>
</View>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/confirmations/Send/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const initialState: DeepPartial<RootState> = {
},
PreferencesController: {
featureFlags: {},
ipfsGateway: 'https://cloudflare-ipfs.com/ipfs/',
ipfsGateway: 'https://gateway.pinata.cloud/ipfs/',
lostIdentities: {},
selectedAddress: MOCK_ADDRESS_2,
useTokenDetection: true,
Expand Down
2 changes: 1 addition & 1 deletion app/constants/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const RPC = NetworkType.rpc;
export const NO_RPC_BLOCK_EXPLORER = 'NO_BLOCK_EXPLORER';
export const PRIVATENETWORK = 'PRIVATENETWORK';
export const DEFAULT_MAINNET_CUSTOM_NAME = 'Ethereum Main Custom';
export const IPFS_DEFAULT_GATEWAY_URL = 'https://cloudflare-ipfs.com/ipfs/';
export const IPFS_DEFAULT_GATEWAY_URL = 'https://gateway.pinata.cloud/ipfs/';

/**
* @enum {string}
Expand Down
4 changes: 2 additions & 2 deletions app/core/AppConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export default {
DEFAULT_SEARCH_ENGINE: 'DuckDuckGo',
TX_CHECK_BACKGROUND_FREQUENCY: 30000,
IPFS_OVERRIDE_PARAM: 'mm_override',
IPFS_DEFAULT_GATEWAY_URL: 'https://cloudflare-ipfs.com/ipfs/',
IPNS_DEFAULT_GATEWAY_URL: 'https://cloudflare-ipfs.com/ipns/',
IPFS_DEFAULT_GATEWAY_URL: 'https://gateway.pinata.cloud/ipfs/',
IPNS_DEFAULT_GATEWAY_URL: 'https://gateway.pinata.cloud/ipns/',
SWARM_DEFAULT_GATEWAY_URL: 'https://swarm-gateways.net/bzz:/',
supportedTLDs: ['eth', 'xyz', 'test'],
MAX_PUSH_NOTIFICATION_PROMPT_TIMES: 2,
Expand Down
2 changes: 1 addition & 1 deletion app/store/sagas/xmlHttpRequestOverride.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const blockedURLs = [
];
const notBlockedURLs = [
'https://proxy.metafi.codefi.network/opensea/api/v2',
'https://cloudflare-ipfs.com/',
'https://gateway.pinata.cloud/',
'https://api.etherscan.io/',
'https://api2.branch.io/',
'https://cdn.branch.io/',
Expand Down
5 changes: 0 additions & 5 deletions app/util/ipfs-gateways.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
"key": 2,
"label": "https://ipfs.infura.io/ipfs/"
},
{
"value": "https://cloudflare-ipfs.com/ipfs/",
"key": 17,
"label": "https://cloudflare-ipfs.com/ipfs/"
},
{
"value": "https://gateway.pinata.cloud/ipfs/",
"key": 24,
Expand Down
2 changes: 1 addition & 1 deletion app/util/sentry/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ describe('captureSentryFeedback', () => {
name: 'Account 1',
},
},
ipfsGateway: 'https://cloudflare-ipfs.com/ipfs/',
ipfsGateway: 'https://gateway.pinata.cloud/ipfs/',
isIpfsGatewayEnabled: true,
isMultiAccountBalancesEnabled: true,
lostIdentities: {},
Expand Down
2 changes: 1 addition & 1 deletion app/util/test/initial-background-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"PreferencesController": {
"featureFlags": {},
"identities": {},
"ipfsGateway": "https://cloudflare-ipfs.com/ipfs/",
legobeat marked this conversation as resolved.
Show resolved Hide resolved
"ipfsGateway": "https://gateway.pinata.cloud/ipfs/",
"lostIdentities": {},
"selectedAddress": "",
"useTokenDetection": true,
Expand Down
4 changes: 2 additions & 2 deletions e2e/fixtures/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class FixtureBuilder {
importTime: 1684232000456,
},
},
ipfsGateway: 'https://cloudflare-ipfs.com/ipfs/',
ipfsGateway: 'https://gateway.pinata.cloud/ipfs/',
lostIdentities: {},
selectedAddress: '0x76cf1CdD1fcC252442b50D6e97207228aA4aefC3',
useTokenDetection: true,
Expand All @@ -245,7 +245,7 @@ class FixtureBuilder {
importTime: 1684232000456,
},
},
ipfsGateway: 'https://cloudflare-ipfs.com/ipfs/',
ipfsGateway: 'https://gateway.pinata.cloud/ipfs/',
lostIdentities: {},
selectedAddress: '0x76cf1CdD1fcC252442b50D6e97207228aA4aefC3',
useTokenDetection: true,
Expand Down
2 changes: 1 addition & 1 deletion e2e/resources/blacklistURLs.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
".*static.cx.metamask.io/.*",
".*rpc.tenderly.co/.*",
".*api-goerli.etherscan.io/.*",
".*cloudflare-ipfs.com/.*",
".*gateway.pinata.cloud/.*",
".*stale.*",
".*phishing-detection.metafi.codefi.network/.*",
".*phishing-detection.cx.metamask.io/.*",
Expand Down
Loading