-
Notifications
You must be signed in to change notification settings - Fork 179
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
chore: renames L1ToL2Message to parentChain/Chain #344
Changes from all commits
042f6a2
a64ccb2
42ee74d
34be52b
2441e45
9c4d896
d3e3e59
47b1e2e
99b3d45
a4d3b23
a4e4a3a
02019c6
9fd5309
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,10 @@ import { Wallet } from '@ethersproject/wallet' | |
import dotenv from 'dotenv' | ||
import { EthBridger, InboxTools, Erc20Bridger } from '../src' | ||
import { | ||
ParentChain as L1Network, | ||
ChildChain as L2Network, | ||
getParentChain as getL1Network, | ||
getChildChain as getL2Network, | ||
ParentChain, | ||
ChildChain, | ||
getParentChain, | ||
getChildChain, | ||
addCustomNetwork, | ||
} from '../src/lib/dataEntities/networks' | ||
import { Signer } from 'ethers' | ||
|
@@ -70,8 +70,8 @@ export const getCustomNetworks = async ( | |
l1Url: string, | ||
l2Url: string | ||
): Promise<{ | ||
l1Network: L1Network | ||
l2Network: Omit<L2Network, 'tokenBridge'> | ||
l1Network: ParentChain | ||
l2Network: Omit<ChildChain, 'tokenBridge'> | ||
}> => { | ||
const l1Provider = new JsonRpcProvider(l1Url) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we rename these inner vars too - eg childProvider, childNetworkInfo etc. I guess the general pattern is just get rid of l1/l2 everywhere. So my comments are the same for this throughout. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll change those in a future PR because they're exported out of this function and used in the tests. |
||
const l2Provider = new JsonRpcProvider(l2Url) | ||
|
@@ -98,7 +98,7 @@ export const getCustomNetworks = async ( | |
const l1NetworkInfo = await l1Provider.getNetwork() | ||
const l2NetworkInfo = await l2Provider.getNetwork() | ||
|
||
const l1Network: L1Network = { | ||
const l1Network: ParentChain = { | ||
blockTime: 10, | ||
chainID: l1NetworkInfo.chainId, | ||
explorerUrl: '', | ||
|
@@ -108,7 +108,7 @@ export const getCustomNetworks = async ( | |
isArbitrum: false, | ||
} | ||
|
||
const l2Network: Omit<L2Network, 'tokenBridge'> = { | ||
const l2Network: Omit<ChildChain, 'tokenBridge'> = { | ||
chainID: l2NetworkInfo.chainId, | ||
confirmPeriodBlocks: confirmPeriodBlocks.toNumber(), | ||
ethBridge: { | ||
|
@@ -149,7 +149,7 @@ export const setupNetworks = async ( | |
l2Deployer, | ||
coreL2Network.ethBridge.inbox | ||
) | ||
const l2Network: L2Network = { | ||
const l2Network: ChildChain = { | ||
...coreL2Network, | ||
tokenBridge: { | ||
l1CustomGateway: l1Contracts.customGateway.address, | ||
|
@@ -204,8 +204,8 @@ export const getSigner = (provider: JsonRpcProvider, key?: string) => { | |
} | ||
|
||
export const testSetup = async (): Promise<{ | ||
l1Network: L1Network | ||
l2Network: L2Network | ||
l1Network: ParentChain | ||
l2Network: ChildChain | ||
l1Signer: Signer | ||
l2Signer: Signer | ||
erc20Bridger: Erc20Bridger | ||
|
@@ -225,10 +225,10 @@ export const testSetup = async (): Promise<{ | |
const l1Signer = seed.connect(ethProvider) | ||
const l2Signer = seed.connect(arbProvider) | ||
|
||
let setL1Network: L1Network, setL2Network: L2Network | ||
let setL1Network: ParentChain, setL2Network: ChildChain | ||
try { | ||
const l1Network = await getL1Network(l1Deployer) | ||
const l2Network = await getL2Network(l2Deployer) | ||
const l1Network = await getParentChain(l1Deployer) | ||
const l2Network = await getChildChain(l2Deployer) | ||
setL1Network = l1Network | ||
setL2Network = l2Network | ||
} catch (err) { | ||
|
@@ -240,8 +240,8 @@ export const testSetup = async (): Promise<{ | |
const { l1Network, l2Network } = JSON.parse( | ||
fs.readFileSync(localNetworkFile).toString() | ||
) as { | ||
l1Network: L1Network | ||
l2Network: L2Network | ||
l1Network: ParentChain | ||
l2Network: ChildChain | ||
} | ||
addCustomNetwork({ | ||
customParentChain: l1Network, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,8 @@ import { L2ContractTransaction } from '../message/L2Transaction' | |
|
||
import { | ||
parentChains as l1Networks, | ||
ParentChain as L1Network, | ||
ChildChain as L2Network, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these renamings happening in another PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes sir. All the import |
||
ParentChain, | ||
} from '../dataEntities/networks' | ||
import { | ||
SignerOrProvider, | ||
|
@@ -34,7 +34,7 @@ import { | |
* Base for bridging assets from l1 to l2 and back | ||
*/ | ||
export abstract class AssetBridger<DepositParams, WithdrawParams> { | ||
public readonly l1Network: L1Network | ||
public readonly l1Network: ParentChain | ||
|
||
public constructor(public readonly l2Network: L2Network) { | ||
this.l1Network = l1Networks[l2Network.parentChainId] | ||
|
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.
should we rename the vars too -
parentChain
andchildChain
?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 should. I think we should do that in a separate PR because that will change ~200 uses in the test files.