-
Notifications
You must be signed in to change notification settings - Fork 167
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
feat: remove all references to L1Network #453
Conversation
await SignerProviderUtils.checkNetworkMatches(sop, this.parentChain.chainID) | ||
await SignerProviderUtils.checkNetworkMatches( | ||
sop, | ||
this.childChain.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.
Removed the parent chain reference, but we only need the chain id anyway
@@ -443,10 +443,10 @@ export const skipIfMainnet = (() => { | |||
let chainId: number | |||
return async (testContext: Mocha.Context) => { | |||
if (!chainId) { | |||
const { parentChain } = await testSetup() | |||
chainId = parentChain.chainID | |||
const { childChain } = await testSetup() |
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.
The only usage of parentChain
from testSetup
was to detect if it was mainnet, so we check the child
if (!l1Network) { | ||
throw new Error(`Unrecognised parent chain id: ${l2Network.parentChainId}`) | ||
} | ||
const l2Network = await getL2Network(l2NetworkID) |
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.
Got rid of l1Network
, and validate the l2Network
by calling getL2Network
@@ -36,17 +40,18 @@ function getLocalNetworksFromContainer(which: 'l1l2' | 'l2l3'): any { | |||
* we can remove this patchwork | |||
*/ | |||
async function patchNetworks( |
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.
Adjusted this function so instead of mutating in-place it returns new objects
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.
amazing.
I checked the teleporter PR and we should be good with these changes when we merge that one up into v4.
only change I'd suggest is moving the Prettify
type into utls since it could be used elsewhere.
src/lib/dataEntities/networks.ts
Outdated
isArbitrum: false | ||
} | ||
// https://twitter.com/mattpocockuk/status/1622730173446557697 | ||
export type Prettify<T> = { |
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.
niiice matt's awesome. I think there might be a better spot for this in /utils?
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.
Moved in 2f080da
/** | ||
* Id of the chain. | ||
*/ | ||
chainID: number |
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'd be nice to standardize capitalization of ID before publishing v4
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.
Yes ser, it's part of #458
} | ||
if (chainId === 1) { | ||
if (chainId === 42161 || chainId === 42170) { |
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.
this list won't be exhaustive when we start testing L2 orbit chains
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.
I think we're good for now, those are the only 2 Arbitrum chains on mainnet (assuming no custom networks registered)
Closes FS-451.
This PR:
Network
andL1Network
types, leaving onlyArbitrumNetwork
(also removes all references toL1Network
)isArbitrum
fromArbitrumNetwork
addCustomNetwork
so only theArbitrumNetwork
is necessary