Skip to content

Commit

Permalink
config change back
Browse files Browse the repository at this point in the history
  • Loading branch information
kelemeno committed Apr 8, 2024
1 parent 3b7d231 commit be778ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 9 additions & 2 deletions l1-contracts/src.ts/deploy-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion l1-contracts/src.ts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit be778ac

Please sign in to comment.