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

🧚🏻 Remove goerli from example app multichain section #1157

Merged
merged 7 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
13 changes: 6 additions & 7 deletions packages/example/playwright/with-metamask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,21 +276,20 @@ export const withMetamaskTest = (baseUrl: string) => {

await waitForExpect(async () => {
expect(await page.isVisible(XPath.text('span', 'Mainnet'))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Goerli'))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Optimism'))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Optimism Goerli'))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Sepolia'))).to.be.true
})
})

it('Check if all chains were loaded', async () => {
await page.goto(`${baseUrl}multichain`)

await waitForExpect(async () => {
expect(await page.isVisible(XPath.text('span', 'Chain id:', 4))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Current block timestamp:', 4))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Current difficulty:', 4))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Current block:', 4))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Ether balance:', 4))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Chain id:', 3))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Current block timestamp:', 3))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Current difficulty:', 3))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Current block:', 3))).to.be.true
expect(await page.isVisible(XPath.text('span', 'Ether balance:', 3))).to.be.true
})
})
})
Expand Down
2 changes: 2 additions & 0 deletions packages/example/src/entrypoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Goerli,
OptimismGoerli,
Optimism,
Sepolia,
} from '@usedapp/core'
import { App } from './App'
import { PortisConnector } from '@usedapp/portis-connector'
Expand All @@ -18,6 +19,7 @@ import { getDefaultProvider } from '@ethersproject/providers'

const readOnlyUrls: Config['readOnlyUrls'] = {
[Mainnet.chainId]: process.env.MAINNET_URL || getDefaultProvider('mainnet'),
[Sepolia.chainId]: 'https://rpc.sepolia.org',
[Goerli.chainId]: process.env.MAINNET_URL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we remove it?

? process.env.MAINNET_URL.replace('mainnet', 'goerli')
: getDefaultProvider('goerli'),
Expand Down
4 changes: 2 additions & 2 deletions packages/example/src/pages/Multichain.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react'
import { Container, MainContent, Section, SectionRow } from '../components/base/base'
import { Goerli, Mainnet, Optimism, OptimismGoerli } from '@usedapp/core'
import { Mainnet, Optimism, Sepolia } from '@usedapp/core'
import { ChainState } from '../components/ChainState'
import { Title } from '../typography/Title'
import styled from 'styled-components'

const chains = [Mainnet.chainId, Goerli.chainId, Optimism.chainId, OptimismGoerli.chainId]
const chains = [Mainnet.chainId, Optimism.chainId, Sepolia.chainId]

export const Multichain = () => {
return (
Expand Down
Loading