From 5e4055a4b36667259527985d1ccc1871367a3ba6 Mon Sep 17 00:00:00 2001 From: Jan Nanista Date: Wed, 15 Nov 2023 13:41:51 -0800 Subject: [PATCH] WIP --- packages/ua-utils/src/{ => tasks}/checkWireAllConfig.ts | 6 +++--- packages/ua-utils/src/{ => tasks}/getConfig.ts | 6 +++--- packages/ua-utils/src/{ => tasks}/getDefaultConfig.ts | 2 +- packages/ua-utils/src/{ => tasks}/index.ts | 0 packages/ua-utils/src/{ => tasks}/setConfig.ts | 6 +++--- packages/ua-utils/src/{ => tasks}/wireAll.ts | 6 +++--- packages/ua-utils/tsconfig.json | 5 ++++- 7 files changed, 17 insertions(+), 14 deletions(-) rename packages/ua-utils/src/{ => tasks}/checkWireAllConfig.ts (98%) rename packages/ua-utils/src/{ => tasks}/getConfig.ts (92%) rename packages/ua-utils/src/{ => tasks}/getDefaultConfig.ts (97%) rename packages/ua-utils/src/{ => tasks}/index.ts (100%) rename packages/ua-utils/src/{ => tasks}/setConfig.ts (99%) rename packages/ua-utils/src/{ => tasks}/wireAll.ts (97%) diff --git a/packages/ua-utils/src/checkWireAllConfig.ts b/packages/ua-utils/src/tasks/checkWireAllConfig.ts similarity index 98% rename from packages/ua-utils/src/checkWireAllConfig.ts rename to packages/ua-utils/src/tasks/checkWireAllConfig.ts index 7566e514f..e8d43a4ac 100644 --- a/packages/ua-utils/src/checkWireAllConfig.ts +++ b/packages/ua-utils/src/tasks/checkWireAllConfig.ts @@ -1,6 +1,6 @@ -import { getContract, getContractAt, getLayerZeroChainId } from "./utils/crossChainHelper" -import { logError } from "./utils/helpers" -import { LZ_APP_ABI } from "./constants/abi" +import { getContract, getContractAt, getLayerZeroChainId } from "../utils/crossChainHelper" +import { logError } from "../utils/helpers" +import { LZ_APP_ABI } from "../constants/abi" export default async function (taskArgs: any, hre: any) { const localNetworks = taskArgs.chains.split(",") diff --git a/packages/ua-utils/src/getConfig.ts b/packages/ua-utils/src/tasks/getConfig.ts similarity index 92% rename from packages/ua-utils/src/getConfig.ts rename to packages/ua-utils/src/tasks/getConfig.ts index fb1768e93..0ac78780d 100644 --- a/packages/ua-utils/src/getConfig.ts +++ b/packages/ua-utils/src/tasks/getConfig.ts @@ -1,6 +1,6 @@ -import { getDeploymentAddresses, getApplicationConfig, getEndpointAddress } from "./utils/crossChainHelper" -import { ENDPOINT_ABI, MESSAGING_LIBRARY_ABI } from "./constants/abi" -import { logError } from "./utils/helpers" +import { getDeploymentAddresses, getApplicationConfig, getEndpointAddress } from "../utils/crossChainHelper" +import { ENDPOINT_ABI, MESSAGING_LIBRARY_ABI } from "../constants/abi" +import { logError } from "../utils/helpers" export default async (taskArgs: any, hre: any) => { const network = hre.network.name diff --git a/packages/ua-utils/src/getDefaultConfig.ts b/packages/ua-utils/src/tasks/getDefaultConfig.ts similarity index 97% rename from packages/ua-utils/src/getDefaultConfig.ts rename to packages/ua-utils/src/tasks/getDefaultConfig.ts index f6cf2dee0..a30923f1d 100644 --- a/packages/ua-utils/src/getDefaultConfig.ts +++ b/packages/ua-utils/src/tasks/getDefaultConfig.ts @@ -1,5 +1,5 @@ import { ethers } from "ethers" -import { getProvider, getLayerZeroChainId, getEndpointAddress } from "./utils/crossChainHelper" +import { getProvider, getLayerZeroChainId, getEndpointAddress } from "../utils/crossChainHelper" const { ENDPOINT_ABI, MESSAGING_LIBRARY_ABI } = require("./constants/abi") export default async (taskArgs: any, hre: any) => { diff --git a/packages/ua-utils/src/index.ts b/packages/ua-utils/src/tasks/index.ts similarity index 100% rename from packages/ua-utils/src/index.ts rename to packages/ua-utils/src/tasks/index.ts diff --git a/packages/ua-utils/src/setConfig.ts b/packages/ua-utils/src/tasks/setConfig.ts similarity index 99% rename from packages/ua-utils/src/setConfig.ts rename to packages/ua-utils/src/tasks/setConfig.ts index 9a51d10fb..6bc0d45fc 100644 --- a/packages/ua-utils/src/setConfig.ts +++ b/packages/ua-utils/src/tasks/setConfig.ts @@ -1,4 +1,4 @@ -import { promptToProceed, writeToCsv, logError, logWarning, printTransactions, logSuccess, configExist, getConfig } from "./utils/helpers" +import { promptToProceed, writeToCsv, logError, logWarning, printTransactions, logSuccess, configExist, getConfig } from "../utils/helpers" import { executeTransaction, executeGnosisTransactions, @@ -10,8 +10,8 @@ import { getApplicationConfig, getEndpointAddress, getLayerZeroChainId, -} from "./utils/crossChainHelper" -import { ENDPOINT_ABI, MESSAGING_LIBRARY_ABI, USER_APPLICATION_ABI } from "./constants/abi" +} from "../utils/crossChainHelper" +import { ENDPOINT_ABI, MESSAGING_LIBRARY_ABI, USER_APPLICATION_ABI } from "../constants/abi" import { utils } from "ethers" // Application config types from UltraLightNodeV2 contract diff --git a/packages/ua-utils/src/wireAll.ts b/packages/ua-utils/src/tasks/wireAll.ts similarity index 97% rename from packages/ua-utils/src/wireAll.ts rename to packages/ua-utils/src/tasks/wireAll.ts index 895cf46ee..d6100ba88 100644 --- a/packages/ua-utils/src/wireAll.ts +++ b/packages/ua-utils/src/tasks/wireAll.ts @@ -1,6 +1,6 @@ -import { Transaction, NetworkTransactions, getContractInstance, getLayerZeroChainId, executeTransactions } from "./utils/crossChainHelper" -import { configExist, getConfig, logError, printTransactions } from "./utils/helpers" -import { setUseCustomAdapterParams, setMinDstGas, setTrustedRemote, getContractNameOrAddress } from "./utils/wireAllHelpers" +import { Transaction, NetworkTransactions, getContractInstance, getLayerZeroChainId, executeTransactions } from "../utils/crossChainHelper" +import { configExist, getConfig, logError, printTransactions } from "../utils/helpers" +import { setUseCustomAdapterParams, setMinDstGas, setTrustedRemote, getContractNameOrAddress } from "../utils/wireAllHelpers" export default async function (taskArgs: any, hre: any) { if (!configExist(taskArgs.configPath)) { diff --git a/packages/ua-utils/tsconfig.json b/packages/ua-utils/tsconfig.json index 9a02e76ca..8600addf7 100644 --- a/packages/ua-utils/tsconfig.json +++ b/packages/ua-utils/tsconfig.json @@ -2,6 +2,9 @@ "extends": "../../tsconfig.json", "exclude": ["dist", "node_modules"], "compilerOptions": { - "types": ["node", "mocha"] + "types": ["node", "mocha"], + "paths": { + "@/*": ["./src/*"] + } } }