Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Web3 from "web3";
import { CHAINS } from "@pythnetwork/xc-admin-common";
import * as fs from "fs";

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

const parser = yargs(hideBin(process.argv))
.usage(
Expand Down Expand Up @@ -45,8 +45,13 @@ const parser = yargs(hideBin(process.argv))
},
});

async function memoize(key: string, fn: () => Promise<any>) {
const path = `./cache/${key}.json`;
async function memoize(
key: string,
fn: () => Promise<string>,
): Promise<string> {
const cacheDir = "../../target_chains/ethereum/contracts/cache";
const path = `${cacheDir}/${key}.json`;

Comment on lines +48 to +54
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to fix the formating issue.

if (fs.existsSync(path)) {
return JSON.parse(fs.readFileSync(path).toString());
}
Expand All @@ -59,11 +64,14 @@ async function main() {
const argv = await parser.argv;
const privateKey = argv["private-key"];
const network = argv["network"];
const setupInfo = require(argv["contract"] + "/ReceiverSetup.json");
const implementationInfo = require(
argv["contract"] + "/ReceiverImplementation.json",

const setupInfo = await import(argv["contract"] + "/ReceiverSetup.json");
const implementationInfo = await import(
argv["contract"] + "/ReceiverImplementation.json"
);
const receiverInfo = await import(
argv["contract"] + "/WormholeReceiver.json"
Comment on lines +68 to +73
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formating fix

);
const receiverInfo = require(argv["contract"] + "/WormholeReceiver.json");

const payloads: Buffer[] = [];
for (const chain of Object.values(DefaultStore.chains)) {
Expand Down
Loading