1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

UX: Remove Goerli buy link and disable button (#18137)

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
This commit is contained in:
David Walsh 2023-04-26 08:35:28 -05:00 committed by GitHub
parent 062a8b376f
commit 755b6b5667
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 24 deletions

View File

@ -540,16 +540,13 @@ export const BUYABLE_CHAINS_MAP: {
| typeof CHAIN_IDS.MOONRIVER | typeof CHAIN_IDS.MOONRIVER
| typeof CHAIN_IDS.AURORA | typeof CHAIN_IDS.AURORA
| typeof CHAIN_IDS.LINEA_TESTNET | typeof CHAIN_IDS.LINEA_TESTNET
| typeof CHAIN_IDS.GOERLI
>]: BuyableChainSettings; >]: BuyableChainSettings;
} = { } = {
[CHAIN_IDS.MAINNET]: { [CHAIN_IDS.MAINNET]: {
nativeCurrency: CURRENCY_SYMBOLS.ETH, nativeCurrency: CURRENCY_SYMBOLS.ETH,
network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME, network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME,
}, },
[CHAIN_IDS.GOERLI]: {
nativeCurrency: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.GOERLI],
network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME,
},
[CHAIN_IDS.SEPOLIA]: { [CHAIN_IDS.SEPOLIA]: {
nativeCurrency: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.SEPOLIA], nativeCurrency: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.SEPOLIA],
network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME, network: BUYABLE_CHAIN_ETHEREUM_NETWORK_NAME,

View File

@ -26,24 +26,6 @@ describe('useRamps', () => {
}); });
}); });
it('should open the buy crypto URL for GOERLI chain ID', () => {
const mockChainId = '5';
const mockBuyURI = 'https://goerli-faucet.slock.it/';
useSelector.mockReturnValue(mockChainId);
const openTabSpy = jest.spyOn(global.platform, 'openTab');
const { result } = renderHook(() => useRamps());
expect(typeof result.current.openBuyCryptoInPdapp).toBe('function');
result.current.openBuyCryptoInPdapp();
expect(openTabSpy).toHaveBeenCalledWith({
url: mockBuyURI,
});
});
it('should open the buy crypto URL for SEPOLIA chain ID', () => { it('should open the buy crypto URL for SEPOLIA chain ID', () => {
const mockChainId = '10'; const mockChainId = '10';
const mockBuyURI = 'https://faucet.sepolia.dev/'; const mockBuyURI = 'https://faucet.sepolia.dev/';

View File

@ -15,8 +15,6 @@ const useRamps = (): IUseRamps => {
const getBuyURI = useCallback((_chainId: ChainId) => { const getBuyURI = useCallback((_chainId: ChainId) => {
switch (_chainId) { switch (_chainId) {
case CHAIN_IDS.GOERLI:
return 'https://goerli-faucet.slock.it/';
case CHAIN_IDS.SEPOLIA: case CHAIN_IDS.SEPOLIA:
return 'https://faucet.sepolia.dev/'; return 'https://faucet.sepolia.dev/';
default: default: