Skip to content

Commit 72f51a4

Browse files
committed
formating fix
1 parent cceb340 commit 72f51a4

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

contract_manager/scripts/batchDeployReceivers.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Web3 from "web3";
1515
import { CHAINS } from "@pythnetwork/xc-admin-common";
1616
import * as fs from "fs";
1717

18-
const { getDefaultConfig } = require("../../target_chains/ethereum/contracts/scripts/contractManagerConfig");
18+
import { getDefaultConfig } from "../../target_chains/ethereum/contracts/scripts/contractManagerConfig";
1919

2020
const parser = yargs(hideBin(process.argv))
2121
.usage(
@@ -45,10 +45,13 @@ const parser = yargs(hideBin(process.argv))
4545
},
4646
});
4747

48-
async function memoize(key: string, fn: () => Promise<any>) {
49-
const cacheDir = '../../target_chains/ethereum/contracts/cache';
48+
async function memoize(
49+
key: string,
50+
fn: () => Promise<string>,
51+
): Promise<string> {
52+
const cacheDir = "../../target_chains/ethereum/contracts/cache";
5053
const path = `${cacheDir}/${key}.json`;
51-
54+
5255
if (fs.existsSync(path)) {
5356
return JSON.parse(fs.readFileSync(path).toString());
5457
}
@@ -61,11 +64,14 @@ async function main() {
6164
const argv = await parser.argv;
6265
const privateKey = argv["private-key"];
6366
const network = argv["network"];
64-
const setupInfo = require(argv["contract"] + "/ReceiverSetup.json");
65-
const implementationInfo = require(
66-
argv["contract"] + "/ReceiverImplementation.json",
67+
68+
const setupInfo = await import(argv["contract"] + "/ReceiverSetup.json");
69+
const implementationInfo = await import(
70+
argv["contract"] + "/ReceiverImplementation.json"
71+
);
72+
const receiverInfo = await import(
73+
argv["contract"] + "/WormholeReceiver.json"
6774
);
68-
const receiverInfo = require(argv["contract"] + "/WormholeReceiver.json");
6975

7076
const payloads: Buffer[] = [];
7177
for (const chain of Object.values(DefaultStore.chains)) {

0 commit comments

Comments
 (0)