Skip to content

Commit

Permalink
fix: support new nitro-testnode container name (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee authored Jun 8, 2023
1 parent ef76725 commit abfc3ae
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions scripts/testSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ export const config = {
ethKey: process.env['ETH_KEY'] as string,
}

function getDeploymentData(): string {
const dockerNames = [
'nitro_sequencer_1',
'nitro-sequencer-1',
'nitro-testnode-sequencer-1',
'nitro-testnode_sequencer_1',
]
for (const dockerName of dockerNames) {
try {
return execSync(
'docker exec ' + dockerName + ' cat /config/deployment.json'
).toString()
} catch {
// empty on purpose
}
}
throw new Error('nitro-testnode sequencer not found')
}

export const getCustomNetworks = async (
l1Url: string,
l2Url: string
Expand All @@ -56,16 +75,7 @@ export const getCustomNetworks = async (
}> => {
const l1Provider = new JsonRpcProvider(l1Url)
const l2Provider = new JsonRpcProvider(l2Url)
let deploymentData: string
try {
deploymentData = execSync(
'docker exec nitro_sequencer_1 cat /config/deployment.json'
).toString()
} catch (e) {
deploymentData = execSync(
'docker exec nitro-sequencer-1 cat /config/deployment.json'
).toString()
}
const deploymentData = getDeploymentData()
const parsedDeploymentData = JSON.parse(deploymentData) as {
bridge: string
inbox: string
Expand Down

0 comments on commit abfc3ae

Please sign in to comment.