diff --git a/packages/ua-utils-evm-hardhat-test/test/task/getDefaultConfig.test.ts b/packages/ua-utils-evm-hardhat-test/test/task/getDefaultConfig.test.ts index c27ecdd65..59ae0006d 100644 --- a/packages/ua-utils-evm-hardhat-test/test/task/getDefaultConfig.test.ts +++ b/packages/ua-utils-evm-hardhat-test/test/task/getDefaultConfig.test.ts @@ -1,6 +1,7 @@ import { defaultExecutorConfig, defaultUlnConfig, setupDefaultEndpoint } from '../__utils__/endpoint' import { createContractFactory, getEidForNetworkName } from '@layerzerolabs/utils-evm-hardhat' import hre from 'hardhat' +import { TASK_LZ_GET_DEFAULT_CONFIG } from '@layerzerolabs/ua-utils-evm-hardhat' describe('task: getDefaultConfig', () => { beforeEach(async () => { @@ -9,7 +10,7 @@ describe('task: getDefaultConfig', () => { it('should return default configurations', async () => { const networks = Object.keys(hre.userConfig.networks ?? {}) - const getDefaultConfigTask = await hre.run('getDefaultConfig', { networks: networks.toString() }) + const getDefaultConfigTask = await hre.run(TASK_LZ_GET_DEFAULT_CONFIG, { networks: networks.toString() }) const contractFactory = createContractFactory() for (const localNetwork of networks) { const localEid = getEidForNetworkName(localNetwork) diff --git a/packages/ua-utils-evm-hardhat-test/test/task/getOAppConfig.test.ts b/packages/ua-utils-evm-hardhat-test/test/task/getOAppConfig.test.ts index e8c5556a4..5b2e9256f 100644 --- a/packages/ua-utils-evm-hardhat-test/test/task/getOAppConfig.test.ts +++ b/packages/ua-utils-evm-hardhat-test/test/task/getOAppConfig.test.ts @@ -2,6 +2,7 @@ import { defaultExecutorConfig, defaultUlnConfig, setupDefaultEndpoint } from '. import { createContractFactory, getEidForNetworkName } from '@layerzerolabs/utils-evm-hardhat' import hre from 'hardhat' import { AddressZero } from '@ethersproject/constants' +import { TASK_LZ_GET_OAPP_CONFIG } from '@layerzerolabs/ua-utils-evm-hardhat' describe('task: getOAppConfig', () => { beforeEach(async () => { @@ -11,7 +12,7 @@ describe('task: getOAppConfig', () => { it('should return app default configurations when addresses are not oapps', async () => { const networks = Object.keys(hre.userConfig.networks ?? {}) const addresses = new Array(networks.length).fill(AddressZero).toString() - const getDefaultConfigTask = await hre.run('getOAppConfig', { + const getDefaultConfigTask = await hre.run(TASK_LZ_GET_OAPP_CONFIG, { networks: networks.toString(), addresses: addresses.toString(), }) diff --git a/packages/ua-utils-evm-hardhat/src/constants/tasks.ts b/packages/ua-utils-evm-hardhat/src/constants/tasks.ts index 459873c6c..b42de0672 100644 --- a/packages/ua-utils-evm-hardhat/src/constants/tasks.ts +++ b/packages/ua-utils-evm-hardhat/src/constants/tasks.ts @@ -1 +1,3 @@ export const TASK_LZ_WIRE_OAPP = 'lz:oapp:wire' +export const TASK_LZ_GET_DEFAULT_CONFIG = 'lz:oapp:getDefaultConfig' +export const TASK_LZ_GET_OAPP_CONFIG = 'lz:oapp:getOAppConfig' diff --git a/packages/ua-utils-evm-hardhat/src/tasks/index.ts b/packages/ua-utils-evm-hardhat/src/tasks/index.ts index 497f148f5..2ea670c16 100644 --- a/packages/ua-utils-evm-hardhat/src/tasks/index.ts +++ b/packages/ua-utils-evm-hardhat/src/tasks/index.ts @@ -1,3 +1 @@ import './oapp' -import './getDefaultConfig' -import './getOAppConfig' diff --git a/packages/ua-utils-evm-hardhat/src/tasks/getDefaultConfig.ts b/packages/ua-utils-evm-hardhat/src/tasks/oapp/getDefaultConfig.ts similarity index 95% rename from packages/ua-utils-evm-hardhat/src/tasks/getDefaultConfig.ts rename to packages/ua-utils-evm-hardhat/src/tasks/oapp/getDefaultConfig.ts index 88cd0ca1a..6ba413bd1 100644 --- a/packages/ua-utils-evm-hardhat/src/tasks/getDefaultConfig.ts +++ b/packages/ua-utils-evm-hardhat/src/tasks/oapp/getDefaultConfig.ts @@ -1,6 +1,7 @@ import { ActionType } from 'hardhat/types' import { task } from 'hardhat/config' import { getReceiveConfig, getSendConfig, printConsoleTable } from '@/utils/taskHelpers' +import { TASK_LZ_GET_DEFAULT_CONFIG } from '@/constants' interface TaskArgs { networks: string @@ -42,7 +43,7 @@ export const getDefaultConfig: ActionType = async (taskArgs) => { } task( - 'getDefaultConfig', + TASK_LZ_GET_DEFAULT_CONFIG, 'outputs the default Send and Receive Messaging Library versions and the default application config' ) .addParam('networks', 'comma separated list of networks') diff --git a/packages/ua-utils-evm-hardhat/src/tasks/getOAppConfig.ts b/packages/ua-utils-evm-hardhat/src/tasks/oapp/getOAppConfig.ts similarity index 95% rename from packages/ua-utils-evm-hardhat/src/tasks/getOAppConfig.ts rename to packages/ua-utils-evm-hardhat/src/tasks/oapp/getOAppConfig.ts index a8a9e7dbf..40cf8db19 100644 --- a/packages/ua-utils-evm-hardhat/src/tasks/getOAppConfig.ts +++ b/packages/ua-utils-evm-hardhat/src/tasks/oapp/getOAppConfig.ts @@ -1,6 +1,7 @@ import { ActionType } from 'hardhat/types' import { task } from 'hardhat/config' import { getReceiveConfig, getSendConfig, printConsoleTable } from '@/utils/taskHelpers' +import { TASK_LZ_GET_OAPP_CONFIG } from '@/constants/tasks' import assert from 'assert' interface TaskArgs { @@ -52,7 +53,7 @@ export const getOAppConfig: ActionType = async (taskArgs, ...args) => } task( - 'getOAppConfig', + TASK_LZ_GET_OAPP_CONFIG, 'outputs the default Send and Receive Messaging Library versions and the default application config' ) .addParam('networks', 'comma separated list of networks') diff --git a/packages/ua-utils-evm-hardhat/src/tasks/oapp/index.ts b/packages/ua-utils-evm-hardhat/src/tasks/oapp/index.ts index 8010ab13b..d3758fdad 100644 --- a/packages/ua-utils-evm-hardhat/src/tasks/oapp/index.ts +++ b/packages/ua-utils-evm-hardhat/src/tasks/oapp/index.ts @@ -1 +1,3 @@ import './wire' +import './getDefaultConfig' +import './getOAppConfig'