Skip to content

Commit

Permalink
Integrate pylon evm (#1478)
Browse files Browse the repository at this point in the history
* bump version

* remove infura and alchemy presets, use pylon

* update package lock

* remove gnosis chain preset

* fix chain name
  • Loading branch information
mholtzman committed Jul 26, 2023
1 parent 0752ca2 commit d7dde03
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 39 deletions.
4 changes: 1 addition & 3 deletions main/chains/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ class ChainConnection extends EventEmitter {

this[priority].provider = provider(target, {
name: priority,
origin: 'frame',
infuraId: '786ade30f36244469480aa5c2bf0743b',
alchemyId: 'NBms1eV9i16RFHpFqQxod56OLdlucIq0'
origin: 'frame'
})

this[priority].blockMonitor = this._createBlockMonitor(this[priority].provider, priority)
Expand Down
48 changes: 16 additions & 32 deletions main/store/state/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const initial = {
isUS: true
},
main: {
_version: main('_version', 32),
_version: main('_version', 36),
instanceId: main('instanceId', generateUuid()),
colorway: main('colorway', 'dark'),
colorwayPrimary: {
Expand Down Expand Up @@ -246,38 +246,22 @@ const initial = {
local: 'direct'
},
1: {
alchemy: 'alchemy',
infura: 'infura'
},
3: {
alchemy: 'alchemyRopsten',
infura: 'infuraRopsten'
},
4: {
alchemy: 'alchemyRinkeby',
infura: 'infuraRinkeby'
pylon: 'wss://evm.pylon.link/mainnet'
},
5: {
infura: 'infuraGoerli'
pylon: 'wss://evm.pylon.link/goerli'
},
10: {
infura: 'infuraOptimism'
},
42: {
alchemy: 'alchemyKovan',
infura: 'infuraKovan'
},
100: {
poa: 'gnosis'
pylon: 'wss://evm.pylon.link/optimism'
},
137: {
infura: 'infuraPolygon'
pylon: 'wss://evm.pylon.link/polygon'
},
42161: {
infura: 'infuraArbitrum'
pylon: 'wss://evm.pylon.link/arbitrum'
},
11155111: {
infura: 'infuraSepolia'
pylon: 'wss://evm.pylon.link/sepolia'
}
}
},
Expand All @@ -299,7 +283,7 @@ const initial = {
connection: {
primary: {
on: true,
current: 'infura',
current: 'pylon',
status: 'loading',
connected: false,
type: '',
Expand Down Expand Up @@ -334,7 +318,7 @@ const initial = {
connection: {
primary: {
on: true,
current: 'infura',
current: 'pylon',
status: 'loading',
connected: false,
type: '',
Expand Down Expand Up @@ -369,7 +353,7 @@ const initial = {
connection: {
primary: {
on: true,
current: 'infura',
current: 'pylon',
status: 'loading',
connected: false,
type: '',
Expand Down Expand Up @@ -403,13 +387,13 @@ const initial = {
},
connection: {
primary: {
on: true,
current: 'poa',
on: false,
current: 'custom',
status: 'loading',
connected: false,
type: '',
network: '',
custom: ''
custom: 'https://rpc.gnosischain.com'
},
secondary: {
on: false,
Expand Down Expand Up @@ -439,7 +423,7 @@ const initial = {
connection: {
primary: {
on: true,
current: 'infura',
current: 'pylon',
status: 'loading',
connected: false,
type: '',
Expand Down Expand Up @@ -474,7 +458,7 @@ const initial = {
connection: {
primary: {
on: true,
current: 'infura',
current: 'pylon',
status: 'loading',
connected: false,
type: '',
Expand Down Expand Up @@ -544,7 +528,7 @@ const initial = {
connection: {
primary: {
on: true,
current: 'infura',
current: 'pylon',
status: 'loading',
connected: false,
type: '',
Expand Down
44 changes: 44 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions test/main/store/migrations/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ afterAll(() => {
log.transports.console.level = 'debug'
})

const createChainState = (chainId) => {
state.main.networks.ethereum[chainId] = { id: chainId }
state.main.networksMeta.ethereum[chainId] = { nativeCurrency: {} }
}

beforeEach(() => {
state = {
main: {
Expand Down Expand Up @@ -1335,10 +1340,6 @@ describe('migration 32', () => {

describe('migration 34', () => {
const getNativeCurrency = (state, chainId) => state.main.networksMeta.ethereum[chainId].nativeCurrency
const createChainState = (chainId) => {
state.main.networks.ethereum[chainId] = { id: chainId }
state.main.networksMeta.ethereum[chainId] = { nativeCurrency: {} }
}

const expectedData = {
1: {
Expand Down

0 comments on commit d7dde03

Please sign in to comment.