Skip to content

Commit

Permalink
remove Goerli from preset chains in advance of deprecation (#1703)
Browse files Browse the repository at this point in the history
* remove Goerli from preset chains in advance of deprecation

* remove more goerli stuff

* clean up tests
  • Loading branch information
mholtzman authored Mar 6, 2024
1 parent ac2dc93 commit 5afcfbe
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 145 deletions.
8 changes: 1 addition & 7 deletions main/ens/artifacts/addresses.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
module.exports = {
// Mainnet
1: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
// Ropsten
3: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
// Rinkeby
4: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
// Goerli
5: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e'
1: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e'
}
4 changes: 0 additions & 4 deletions main/multicall/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ export const multicallAddresses: Record<number, { version: MulticallVersion; add
version: MulticallVersion.V2,
address: '0x5ba1e12693dc8f9c48aad8770482f4739beed696' // rinkeby
},
5: {
version: MulticallVersion.V2,
address: '0x5ba1e12693dc8f9c48aad8770482f4739beed696' // goerli
},
10: {
version: MulticallVersion.V2,
address: '0xed386Fe855C1EFf2f843B910923Dd8846E45C5A4' // optimism
Expand Down
57 changes: 0 additions & 57 deletions main/store/state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,41 +206,6 @@ const mainState: M = {
},
on: true
},
5: {
id: 5,
type: 'ethereum',
layer: 'testnet',
isTestnet: true,
name: 'Görli',
explorer: 'https://goerli.etherscan.io',
gas: {
price: {
selected: 'standard',
levels: { slow: '', standard: '', fast: '', asap: '', custom: '' }
}
},
connection: {
primary: {
on: true,
current: 'pylon',
status: 'loading',
connected: false,
type: '',
network: '',
custom: ''
},
secondary: {
on: false,
current: 'custom',
status: 'loading',
connected: false,
type: '',
network: '',
custom: ''
}
},
on: false
},
10: {
id: 10,
type: 'ethereum',
Expand Down Expand Up @@ -547,28 +512,6 @@ const mainState: M = {
icon: '',
primaryColor: 'accent1' // Mainnet
},
5: {
blockHeight: 0,
gas: {
fees: {},
price: {
selected: 'standard',
levels: { slow: '', standard: '', fast: '', asap: '', custom: '' }
}
},
nativeCurrency: {
symbol: 'görETH',
usd: {
price: 0,
change24hr: 0
},
icon: '',
name: 'Görli Ether',
decimals: 18
},
icon: '',
primaryColor: 'accent2' // Testnet
},
10: {
blockHeight: 0,
gas: {
Expand Down
3 changes: 0 additions & 3 deletions resources/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ const NETWORK_PRESETS = {
1: {
pylon: 'wss://evm.pylon.link/mainnet'
},
5: {
pylon: 'wss://evm.pylon.link/goerli'
},
10: {
pylon: 'wss://evm.pylon.link/optimism'
},
Expand Down
19 changes: 0 additions & 19 deletions test/e2e/txWarnings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,3 @@ test('Failing Transaction (Mainnet)', async () => {
return Boolean(e)
}
})

// test('Failing Transaction (Goerli)', async done => {
// try {
// await frame.request({
// method: 'eth_sendTransaction',
// params: [{
// value: '0x4f0c41d240a0000',
// from: (await frame.request({ method: 'eth_requestAccounts' }))[0],
// to: '0x7a250d5630b4cf539739df2c5dacb4c659f2488d',
// data: '0x7ff36ab50000000000000000000000000000000000000000000000004894258e83a4c02300000000000000000000000000000000000000000000000000000000000000800000000000000000000000001a5cfbee61219d830bc277012519a30a8730783e0000000000000000000000000000000000000000000000000000000060238e5f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000b4fbf271143f4fbf7b91a5ded31805e42b2208d60000000000000000000000001f9840a85d5af5bf1d1700000000000000000000',
// chainId: '0x5',
// gasPrice: '0x4a817c800'
// }]
// })
// } catch (e) {
// done()
// }
// frame.close()
// })
18 changes: 9 additions & 9 deletions test/main/chains/index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import log from 'electron-log'
import EventEmitter from 'events'
import { addHexPrefix, intToHex } from '@ethereumjs/util'
import log from 'electron-log'

import store from '../../../main/store'
import { gweiToHex } from '../../util'
Expand Down Expand Up @@ -64,14 +64,14 @@ const state = {
main: {
currentNetwork: {
type: 'ethereum',
id: '5'
id: '11155111'
},
networks: {
ethereum: {
5: {
id: 5,
11155111: {
id: 11155111,
type: 'ethereum',
name: 'Goerli',
name: 'Sepolia',
connection: {
primary: {
on: false,
Expand Down Expand Up @@ -124,7 +124,7 @@ const state = {
},
networksMeta: {
ethereum: {
5: {
11155111: {
gas: {
price: {
selected: 'standard',
Expand All @@ -151,9 +151,9 @@ jest.mock('../../../main/accounts', () => ({ updatePendingFees: jest.fn() }))
jest.mock('../../../main/store/persist')

const mockConnections = {
'wss://evm.pylon.link/goerli': {
id: '5',
name: 'goerli',
'wss://evm.pylon.link/sepolia': {
id: '11155111',
name: 'sepolia',
connection: new MockConnection(5)
},
'wss://evm.pylon.link/polygon': {
Expand Down
78 changes: 39 additions & 39 deletions test/main/provider/chains/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ const chains = {
connection: { primary: { connected: true }, secondary: { connected: false } },
on: true
},
5: {
name: 'Ethereum Testnet Görli',
id: 5,
explorer: 'https://goerli.etherscan.io',
connection: {
primary: { status: 'disconnected', connected: false, on: true },
secondary: { status: 'disconnected', connected: false, on: true }
},
on: true
},
137: {
name: 'Polygon',
id: 137,
connection: { primary: { connected: true }, secondary: { connected: false } },
on: false
},
11155111: {
name: 'Ethereum Testnet Sepolia',
id: 11155111,
explorer: 'https://sepolia.etherscan.io',
connection: {
primary: { status: 'disconnected', connected: false, on: true },
secondary: { status: 'disconnected', connected: false, on: true }
},
on: true
}
}

Expand All @@ -45,14 +45,14 @@ const chainMeta = {
nativeCurrency: ether,
primaryColor: 'accent1'
},
5: {
137: { nativeCurrency: {}, primaryColor: 'accent6' },
11155111: {
nativeCurrency: {
...ether,
name: 'Görli Ether'
name: 'Sepolia Ether'
},
primaryColor: 'accent2'
},
137: { nativeCurrency: {}, primaryColor: 'accent6' }
}
}

const selectedAddress = '0x2796317b0ff8538f253012862c06787adfb8ceb6'
Expand All @@ -63,7 +63,7 @@ beforeEach(() => {

describe('#getActiveChains', () => {
it('returns all chains that are active', () => {
expect(getActiveChains().map((chain) => chain.chainId)).toEqual([1, 5])
expect(getActiveChains().map((chain) => chain.chainId)).toEqual([1, 11155111])
})

it('returns an EVM chain object', () => {
Expand Down Expand Up @@ -149,48 +149,48 @@ describe('#createChainsObserver', () => {
connected: true
},
{
chainId: 5,
networkId: 5,
name: 'Ethereum Testnet Görli',
chainId: 10,
networkId: 10,
name: 'Optimism',
icon: [{ url: 'https://assets.coingecko.com/coins/images/ethereum.png' }],
nativeCurrency: {
name: 'Görli Ether',
name: 'Ether',
symbol: 'ETH',
decimals: 18
},
explorers: [
{
url: 'https://goerli.etherscan.io'
url: 'https://optimistic.etherscan.io'
}
],
external: {
wallet: {
colors: [{ r: 255, g: 153, b: 51, hex: '#ff9933' }]
colors: [{ r: 246, g: 36, b: 35, hex: '#f62423' }]
}
},
connected: false
connected: true
},
{
chainId: 10,
networkId: 10,
name: 'Optimism',
chainId: 11155111,
networkId: 11155111,
name: 'Ethereum Testnet Sepolia',
icon: [{ url: 'https://assets.coingecko.com/coins/images/ethereum.png' }],
nativeCurrency: {
name: 'Ether',
name: 'Sepolia Ether',
symbol: 'ETH',
decimals: 18
},
explorers: [
{
url: 'https://optimistic.etherscan.io'
url: 'https://sepolia.etherscan.io'
}
],
external: {
wallet: {
colors: [{ r: 246, g: 36, b: 35, hex: '#f62423' }]
colors: [{ r: 255, g: 153, b: 51, hex: '#ff9933' }]
}
},
connected: true
connected: false
}
])
})
Expand All @@ -209,11 +209,11 @@ describe('#createChainsObserver', () => {
fireObserver()

const changedChains = handler.chainsChanged.mock.calls[0][1]
expect(changedChains.map((c) => c.chainId)).toEqual([1, 5, 10])
expect(changedChains.map((c) => c.chainId)).toEqual([1, 10, 11155111])
})

it('invokes the handler when a chain is removed', () => {
const { 5: goerli, ...remaining } = chains
const { 11155111: sepolia, ...remaining } = chains
setChains(remaining)

fireObserver()
Expand All @@ -233,16 +233,16 @@ describe('#createChainsObserver', () => {
fireObserver()

const changedChains = handler.chainsChanged.mock.calls[0][1]
expect(changedChains.map((c) => c.chainId)).toEqual([1, 5, 137])
expect(changedChains.map((c) => c.chainId)).toEqual([1, 137, 11155111])
})

it('invokes the handler when a chain is deactivated', () => {
const {
5: { ...goerli }
11155111: { ...sepolia }
} = chains
goerli.on = false
sepolia.on = false

setChains({ ...chains, 5: goerli })
setChains({ ...chains, 11155111: sepolia })

fireObserver()

Expand All @@ -252,16 +252,16 @@ describe('#createChainsObserver', () => {

it('invokes the handler when a chain name changes', () => {
const {
5: { ...goerli }
11155111: { ...sepolia }
} = chains
goerli.name = 'Girly'
sepolia.name = 'Seppohleea'

setChains({ ...chains, 5: goerli })
setChains({ ...chains, 11155111: sepolia })

fireObserver()

const changedChains = handler.chainsChanged.mock.calls[0][1]
expect(changedChains.map((c) => c.chainId)).toEqual([1, 5])
expect(changedChains.map((c) => c.chainId)).toEqual([1, 11155111])
})

it('does not invoke the handler when no chains have changed', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/main/provider/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe('#send', () => {
done()
}

sendRequest({ chainId: '0x5', chainName: 'Goerli' }, cb)
sendRequest({ chainId: '0xaa36a7', chainName: 'Sepolia' }, cb)
})

it('should create a request to add the chain', (done) => {
Expand Down
6 changes: 0 additions & 6 deletions test/main/signers/hot/HotSigner/worker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ describe('#signTransaction', () => {
expectedSignature:
'0xf8698084b2d05e0082520894be188d6641e8b680743a4815dfa0f6208038960f86b5e620f480008025a0c8ca5f76f568578bebbdfc257be09d8e8a4512d0ffd45e991da86be8141d97e0a037179047d9810e211657d9dd60d4bac66ed576fd65ef65a55f007314587036ec'
},
{
name: 'goerli',
chainId: 5,
expectedSignature:
'0xf8698084b2d05e0082520894be188d6641e8b680743a4815dfa0f6208038960f86b5e620f48000802da074c3b69fa979e92253c7f66d323f91f7f11eb16dd2b4838a274b584ddb708895a03e76e91351b2be3fd4a065195a0c71a4359d0fe4230f5f3ae457b2cb5a30bf03'
},
{
name: 'optimism',
chainId: 10,
Expand Down

0 comments on commit 5afcfbe

Please sign in to comment.