Skip to content

Commit

Permalink
add progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalgek committed Dec 18, 2024
1 parent 498bedc commit 2834cf3
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 115 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"dependencies": {
"chalk": "^4.1.2",
"cli-progress": "^3.12.0",
"commander": "^12.1.0",
"dotenv": "^16.4.5",
"ethers": "^6.13.4",
Expand All @@ -36,6 +37,7 @@
"@commitlint/config-conventional": "^19.5.0",
"@eslint/compat": "^1.1.1",
"@eslint/js": "^9.11.1",
"@types/cli-progress": "^3",
"@types/node": "^22.9.1",
"eslint": "^9.11.1",
"eslint-config-prettier": "^9.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/command-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function runCommand({
console.debug(
chalk.bold(
chalk.yellowBright(
`\nRun command in ${workingDirectory}: ${command} ${args.join(" ")} (try ${tryNumber} of ${maxTries})\n`
`Run command in ${workingDirectory}: ${command} ${args.join(" ")} (try ${tryNumber} of ${maxTries})\n`
)
)
);
Expand Down
6 changes: 2 additions & 4 deletions src/deploy-all-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function burnL2DeployerNonces(l2RpcUrl: string, numNonces: number)
const tx = await l2Deployer.sendTransaction({ to: l2DeployerAddress, value: 0 });
await tx.wait();
break;
} catch(error) {
} catch (error) {
if (--numTries == 0) throw error;
}
}
Expand Down Expand Up @@ -62,7 +62,6 @@ export function runDeployScript({
});
}


export function populateDeployScriptEnvs(deploymentConfig: DeployParameters, govBridgeExecutor: string, networkType: NetworkType) {
function formattedArray(configArray: Array<string>) {
return `[${configArray.map((ts: string) => `"${ts.toString()}"`)}]`;
Expand All @@ -72,7 +71,6 @@ export function populateDeployScriptEnvs(deploymentConfig: DeployParameters, gov

dotenv.populate(
process.env as { [key: string]: string },

{
L1_BLOCK_EXPLORER_API_KEY: env.string("L1_EXPLORER_TOKEN"),
L2_BLOCK_EXPLORER_API_KEY: env.string("L2_EXPLORER_TOKEN"),
Expand Down Expand Up @@ -165,7 +163,7 @@ function copyDeploymentArtifacts(originalDeployFileName: string, deployResultFil
cpSync(originalDeployFilePath, `./artifacts/${deployResultFileName}`);
}

export function copyArtifacts({deploymentResult, l1DeploymentArgs, l2DeploymentArgs} : {deploymentResult: string, l1DeploymentArgs: string, l2DeploymentArgs: string}) {
export function copyArtifacts({ deploymentResult, l1DeploymentArgs, l2DeploymentArgs }: { deploymentResult: string, l1DeploymentArgs: string, l2DeploymentArgs: string }) {
copyDeploymentArtifacts("deployResult.json", deploymentResult);
copyDeploymentArtifacts("l1DeployArgs.json", l1DeploymentArgs);
copyDeploymentArtifacts("l2DeployArgs.json", l2DeploymentArgs);
Expand Down
20 changes: 10 additions & 10 deletions src/diffyscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function setupDiffyscan(
l1Config.opStackTokenRatePusher.wstETH,
l1Config.opStackTokenRatePusher.accountingOracle,
newContractsCfg["optimism"]["tokenRateOracleProxyAddress"],
l1Config.opStackTokenRatePusher.l2GasLimitForPushingTokenRate,
Number(l1Config.opStackTokenRatePusher.l2GasLimitForPushingTokenRate),
],
};
writeFileSync(
Expand All @@ -83,10 +83,10 @@ export function setupDiffyscan(
[govBridgeExecutor]: [
l2Config.govBridgeExecutor.ovmL2Messenger,
l2Config.govBridgeExecutor.ethereumGovExecutor,
l2Config.govBridgeExecutor.delay,
l2Config.govBridgeExecutor.gracePeriod,
l2Config.govBridgeExecutor.minDelay,
l2Config.govBridgeExecutor.maxDelay,
Number(l2Config.govBridgeExecutor.delay),
Number(l2Config.govBridgeExecutor.gracePeriod),
Number(l2Config.govBridgeExecutor.minDelay),
Number(l2Config.govBridgeExecutor.maxDelay),
l2Config.govBridgeExecutor.ovmGuiardian,
],
};
Expand Down Expand Up @@ -118,11 +118,11 @@ export function setupDiffyscan(
l2Config.tokenRateOracle.l2Messenger,
newContractsCfg["optimism"]["tokenBridgeProxyAddress"],
newContractsCfg["ethereum"]["opStackTokenRatePusherImplAddress"],
l2Config.tokenRateOracle.tokenRateOutdatedDelay,
l2Config.tokenRateOracle.maxAllowedL2ToL1ClockLag,
l2Config.tokenRateOracle.maxAllowedTokenRateDeviationPerDayBp,
l2Config.tokenRateOracle.oldestRateAllowedInPauseTimeSpan,
l2Config.tokenRateOracle.minTimeBetweenTokenRateUpdates,
Number(l2Config.tokenRateOracle.tokenRateOutdatedDelay),
Number(l2Config.tokenRateOracle.maxAllowedL2ToL1ClockLag),
Number(l2Config.tokenRateOracle.maxAllowedTokenRateDeviationPerDayBp),
Number(l2Config.tokenRateOracle.oldestRateAllowedInPauseTimeSpan),
Number(l2Config.tokenRateOracle.minTimeBetweenTokenRateUpdates),
],
[newContractsCfg["optimism"]["tokenProxyAddress"]]: [
newContractsCfg["optimism"]["tokenImplAddress"],
Expand Down
Loading

0 comments on commit 2834cf3

Please sign in to comment.