-
Notifications
You must be signed in to change notification settings - Fork 195
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
test: add custom gas token e2e tests #1960
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…e into e2e-custom-fee-token
…um-token-bridge into e2e-custom-fee-token
nitro-testnode-ref: aab133aceadec2e622f15fa438f6327e3165392d | ||
l3-node: ${{ matrix.test.type == 'orbit' }} | ||
no-l3-token-bridge: ${{ matrix.test.type != 'orbit' }} | ||
nitro-testnode-ref: badbcbea9b43d46e115da4d7c9f2f57c31af8431 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a newer tag that funds the wallet with native currency on L2. You can see the change here:
OffchainLabs/nitro-testnode@badbcbe
import { Layout } from '../components/common/Layout' | ||
import { siteTitle } from './_document' | ||
|
||
import '../styles/tailwind.css' | ||
import '../styles/purple.css' | ||
import { isUserRejectedError } from '../util/isUserRejectedError' | ||
|
||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Register local network is async now so we do it when importing the component. See index.tsx
process.env.NODE_ENV !== 'production' || | ||
process.env.NEXT_PUBLIC_IS_E2E_TEST | ||
) { | ||
await registerLocalNetwork() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it's async we do it before rendering the component
process.env.NODE_ENV !== 'production' || | ||
process.env.NEXT_PUBLIC_IS_E2E_TEST | ||
) { | ||
await registerLocalNetwork() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to register networks so that it recognises L3 local and doesn't change the chain to default
bridge: '0xA584795e24628D9c067A6480b033C9E96281fcA3', | ||
inbox: '0xDcA690902d3154886Ec259308258D10EA5450996', | ||
outbox: '0xda243bD61B011024FC923164db75Dde198AC6175', | ||
rollup: process.env.NEXT_PUBLIC_IS_E2E_TEST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as with other local chains, different address in CI
@@ -358,14 +396,34 @@ export const localL3NetworkRpcUrl = loadEnvironmentVariableWithFallback({ | |||
fallback: 'http://127.0.0.1:3347' | |||
}) | |||
|
|||
export function registerLocalNetwork() { | |||
export async function registerLocalNetwork(isLocalCustomNativeToken?: boolean) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We fetch native token to see if it exists, this way we know it's a custom native token local chain. But we also need a way to specify it e.g. in e2e synpress setup because then fetching the token will fail
@@ -92,11 +102,14 @@ export const getL2TestnetNetworkConfig = (): NetworkConfig => { | |||
export const ERC20TokenName = 'Test Arbitrum Token' | |||
export const ERC20TokenSymbol = 'TESTARB' | |||
export const ERC20TokenDecimals = 18 | |||
export const invalidTokenAddress = '0x0000000000000000000000000000000000000000' | |||
export const invalidTokenAddress = utils.computeAddress(utils.randomBytes(32)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with custom fee token WETH is deployed to zero address for some reason, we use a random address instead
No description provided.