Commit 3af9c7a9 authored by smartcontracts's avatar smartcontracts Committed by GitHub

feat(sdk): remove ICrossChainMessenger (#3244)

Removes the ICrossChainMessenger interface. We don't have a strong
reason to maintain this interface and it introduces complexity to the
process of developing the SDK. With the interface, we are required to
make changes to multiple files when we simply want to change the
CrossChainMessenger class. We are also not maintaing multiple
implementations of the CrossChainMessenger that would make the interface
useful.
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 9f784756
---
'@eth-optimism/sdk': minor
---
Removes the ICrossChainMessenger interface to speed up SDK development.
/* eslint-disable @typescript-eslint/no-unused-vars */
import { ethers, Contract, Overrides, BigNumber } from 'ethers'
import { ethers, Overrides, BigNumber } from 'ethers'
import { TransactionRequest, BlockTag } from '@ethersproject/abstract-provider'
import { predeploys, getContractInterface } from '@eth-optimism/contracts'
import { predeploys } from '@eth-optimism/contracts'
import { hexStringEquals } from '@eth-optimism/core-utils'
import {
......
......@@ -16,9 +16,9 @@ import { predeploys } from '@eth-optimism/contracts'
import { getContractInterface } from '@eth-optimism/contracts-bedrock'
import { hexStringEquals } from '@eth-optimism/core-utils'
import { CrossChainMessenger } from '../cross-chain-messenger'
import {
IBridgeAdapter,
ICrossChainMessenger,
NumberLike,
AddressLike,
TokenBridgeMessage,
......@@ -30,7 +30,7 @@ import { toAddress } from '../utils'
* Bridge adapter for any token bridge that uses the standard token bridge interface.
*/
export class StandardBridgeAdapter implements IBridgeAdapter {
public messenger: ICrossChainMessenger
public messenger: CrossChainMessenger
public l1Bridge: Contract
public l2Bridge: Contract
......@@ -43,7 +43,7 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
* @param opts.l2Bridge L2 bridge contract.
*/
constructor(opts: {
messenger: ICrossChainMessenger
messenger: CrossChainMessenger
l1Bridge: AddressLike
l2Bridge: AddressLike
}) {
......
This diff is collapsed.
......@@ -13,7 +13,7 @@ import {
} from '@ethersproject/abstract-provider'
import { NumberLike, AddressLike, TokenBridgeMessage } from './types'
import { ICrossChainMessenger } from './cross-chain-messenger'
import { CrossChainMessenger } from '../cross-chain-messenger'
/**
* Represents an adapter for an L1<>L2 token bridge. Each custom bridge currently needs its own
......@@ -23,7 +23,7 @@ export interface IBridgeAdapter {
/**
* Provider used to make queries related to cross-chain interactions.
*/
messenger: ICrossChainMessenger
messenger: CrossChainMessenger
/**
* L1 bridge contract.
......
This diff is collapsed.
export * from './bridge-adapter'
export * from './cross-chain-messenger'
export * from './l2-provider'
export * from './types'
......@@ -6,7 +6,7 @@ import {
import { Signer } from '@ethersproject/abstract-signer'
import { Contract, BigNumber } from 'ethers'
import { ICrossChainMessenger } from './cross-chain-messenger'
import { CrossChainMessenger } from '../cross-chain-messenger'
import { IBridgeAdapter } from './bridge-adapter'
/**
......@@ -103,7 +103,7 @@ export interface OEContractsLike {
export interface BridgeAdapterData {
[name: string]: {
Adapter: new (opts: {
messenger: ICrossChainMessenger
messenger: CrossChainMessenger
l1Bridge: AddressLike
l2Bridge: AddressLike
}) => IBridgeAdapter
......
......@@ -4,6 +4,7 @@ import { ethers, Contract } from 'ethers'
import { toAddress } from './coercion'
import { DeepPartial } from './type-utils'
import { CrossChainMessenger } from '../cross-chain-messenger'
import {
OEContracts,
OEL1Contracts,
......@@ -13,7 +14,6 @@ import {
AddressLike,
BridgeAdapters,
BridgeAdapterData,
ICrossChainMessenger,
L2ChainID,
} from '../interfaces'
import {
......@@ -323,7 +323,7 @@ export const getAllOEContracts = (
*/
export const getBridgeAdapters = (
l2ChainId: number,
messenger: ICrossChainMessenger,
messenger: CrossChainMessenger,
opts?: {
overrides?: BridgeAdapterData
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment