From 1e1c5ae4debb43f8b64a0c5fd5ffa7527a5c360b Mon Sep 17 00:00:00 2001 From: Matthew Bunday Date: Tue, 20 Feb 2024 08:32:33 -0500 Subject: [PATCH] Delete unnecessary OpConfig code --- src/_test/config.ts | 5 ++--- src/constants/chains/base.ts | 15 --------------- src/constants/chains/optimism.ts | 15 --------------- src/constants/chains/zora.ts | 15 --------------- src/types/OpConfig.ts | 28 ---------------------------- 5 files changed, 2 insertions(+), 76 deletions(-) delete mode 100644 src/constants/chains/base.ts delete mode 100644 src/constants/chains/optimism.ts delete mode 100644 src/constants/chains/zora.ts delete mode 100644 src/types/OpConfig.ts diff --git a/src/_test/config.ts b/src/_test/config.ts index 853bcb7..1fded91 100644 --- a/src/_test/config.ts +++ b/src/_test/config.ts @@ -1,7 +1,6 @@ import { mock } from '@wagmi/connectors' -import { mainnet as viem_mainnet } from 'viem/chains' +import { base as viem_base, mainnet as viem_mainnet } from 'viem/chains' import { type Config, createConfig, http } from 'wagmi' -import { base as opWagmiBase } from '../constants/chains/base.js' import { accounts } from './constants.js' import { getRpcUrls } from './utils.js' @@ -17,7 +16,7 @@ const mainnet = { } const base = { - ...opWagmiBase, + ...viem_base, ...getRpcUrls({ port: 8546 }), // fork: { // blockNumber: process.env.VITE_OPTIMISM_FORK_BLOCK_NUMBER diff --git a/src/constants/chains/base.ts b/src/constants/chains/base.ts deleted file mode 100644 index 82f5349..0000000 --- a/src/constants/chains/base.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { baseAddresses } from 'op-viem/chains' -import { base as viem_base, type Chain, mainnet } from 'viem/chains' - -export const base: Chain = { - ...viem_base, - contracts: { - ...viem_base.contracts, - l1StandardBridge: { - [mainnet.id]: { - address: baseAddresses.l1StandardBridge.address, - blockCreated: baseAddresses.l1StandardBridge.blockCreated, - }, - }, - }, -} diff --git a/src/constants/chains/optimism.ts b/src/constants/chains/optimism.ts deleted file mode 100644 index 1af639e..0000000 --- a/src/constants/chains/optimism.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { optimismAddresses } from 'op-viem/chains' -import { type Chain, mainnet, optimism as viem_optimism } from 'viem/chains' - -export const optimism: Chain = { - ...viem_optimism, - contracts: { - ...viem_optimism.contracts, - l1StandardBridge: { - [mainnet.id]: { - address: optimismAddresses.l1StandardBridge.address, - blockCreated: optimismAddresses.l1StandardBridge.blockCreated, - }, - }, - }, -} diff --git a/src/constants/chains/zora.ts b/src/constants/chains/zora.ts deleted file mode 100644 index 9e94213..0000000 --- a/src/constants/chains/zora.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { zoraAddresses } from 'op-viem/chains' -import { type Chain, mainnet, zora as viem_zora } from 'viem/chains' - -export const zora: Chain = { - ...viem_zora, - contracts: { - ...viem_zora.contracts, - l1StandardBridge: { - [mainnet.id]: { - address: zoraAddresses.l1StandardBridge.address, - blockCreated: zoraAddresses.l1StandardBridge.blockCreated, - }, - }, - }, -} diff --git a/src/types/OpConfig.ts b/src/types/OpConfig.ts deleted file mode 100644 index bb5238b..0000000 --- a/src/types/OpConfig.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Address } from 'viem' -import { type Config } from 'wagmi' - -// TODO: export these from op-viem and import here -export type ContractAddress = { address: Address; chainId: chainId; blockCreated?: number } -export type L1Addresses = { - portal: ContractAddress - l2OutputOracle: ContractAddress - l1StandardBridge: ContractAddress - l1CrossDomainMessenger: ContractAddress - l1Erc721Bridge: ContractAddress -} - -export type L2Addresses = { - l2L1MessagePasserAddress: ContractAddress - l2StandardBridge: ContractAddress -} - -export type L2Chain = { - chainId: l2ChainId - l1ChainId: l1ChainId - l1Addresses: L1Addresses - l2Addresses: L2Addresses -} - -export type OpConfig = Config & { - readonly l2chains: Record> -}