From be778acf11692b7e8f0c41634889ab11a4d6540f Mon Sep 17 00:00:00 2001 From: kelemeno Date: Mon, 8 Apr 2024 23:27:32 +0200 Subject: [PATCH] config change back --- l1-contracts/src.ts/deploy-token.ts | 11 +++++++++-- l1-contracts/src.ts/utils.ts | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/l1-contracts/src.ts/deploy-token.ts b/l1-contracts/src.ts/deploy-token.ts index 0eea41cd3..eeda4cdf2 100644 --- a/l1-contracts/src.ts/deploy-token.ts +++ b/l1-contracts/src.ts/deploy-token.ts @@ -78,8 +78,15 @@ export async function mintTokens( export function getTokens(): L1Token[] { const network = process.env.CHAIN_ETH_NETWORK || "localhost"; - const configPath = `./test/test_config/constant/${network}.json`; - return JSON.parse(fs.readFileSync(configPath, { encoding: "utf-8", })); + const configPath = + network == "hardhat" + ? `./test/test_config/constant/${network}.json` + : `${process.env.ZKSYNC_HOME}/etc/tokens/${network}.json`; + return JSON.parse( + fs.readFileSync(configPath, { + encoding: "utf-8", + }) + ); } export async function deployTokens( diff --git a/l1-contracts/src.ts/utils.ts b/l1-contracts/src.ts/utils.ts index 6fe41b20c..191ca915c 100644 --- a/l1-contracts/src.ts/utils.ts +++ b/l1-contracts/src.ts/utils.ts @@ -7,7 +7,9 @@ import { ethers } from "ethers"; import * as fs from "fs"; import * as path from "path"; -export const testConfigPath = "./test/test_config/constant"; +export const testConfigPath = process.env.ZKSYNC_ENV + ? path.join(process.env.ZKSYNC_HOME as string, "etc/test_config/constant") + : "./test/test_config/constant"; export const ethTestConfig = JSON.parse(fs.readFileSync(`${testConfigPath}/eth.json`, { encoding: "utf-8" })); // eslint-disable-next-line @typescript-eslint/no-var-requires