Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
brtkx committed Oct 8, 2024
1 parent a7eb5e9 commit 10a11ae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
25 changes: 13 additions & 12 deletions packages/arb-token-bridge-ui/src/util/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,26 +394,27 @@ export const localL3NetworkRpcUrl = loadEnvironmentVariableWithFallback({
fallback: 'http://127.0.0.1:3347'
})

export async function registerLocalNetwork() {
export async function registerLocalNetwork(isLocalCustomNativeToken?: boolean) {
try {
rpcURLs[defaultL1Network.chainId] = localL1NetworkRpcUrl
rpcURLs[defaultL2Network.chainId] = localL2NetworkRpcUrl
rpcURLs[defaultL3Network.chainId] = localL3NetworkRpcUrl

registerCustomArbitrumNetwork(defaultL2Network)

let isLocalCustomNativeToken = false
try {
const data = await fetchErc20Data({
address: defaultL3CustomGasTokenNetwork.nativeToken!,
provider: new StaticJsonRpcProvider(localL2NetworkRpcUrl)
})
if (data.symbol === 'TN') {
isLocalCustomNativeToken = true
if (typeof isLocalCustomNativeToken === 'undefined') {
try {
const data = await fetchErc20Data({
address: defaultL3CustomGasTokenNetwork.nativeToken!,
provider: new StaticJsonRpcProvider(localL2NetworkRpcUrl)
})
if (data.symbol === 'TN') {
isLocalCustomNativeToken = true
}
} catch (e) {
// not the native token
isLocalCustomNativeToken = false
}
} catch (e) {
// not the native token
isLocalCustomNativeToken = false
}

registerCustomArbitrumNetwork(
Expand Down
4 changes: 2 additions & 2 deletions packages/arb-token-bridge-ui/synpress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ export default defineConfig({
e2e: {
async setupNodeEvents(on, config) {
logsPrinter(on)
await registerLocalNetwork()
await registerLocalNetwork(process.env.ORBIT_CUSTOM_GAS_TOKEN === 'true')

try {
const data = await fetchErc20Data({
address: defaultL3CustomGasTokenNetwork.nativeToken!,
provider: new StaticJsonRpcProvider(ethRpcUrl)
provider: new StaticJsonRpcProvider(arbRpcUrl)
})
console.log({ data })
} catch (err) {
Expand Down

0 comments on commit 10a11ae

Please sign in to comment.