@hyperlane-xyz/cli 5.1.2 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/src/commands/options.d.ts +1 -0
- package/dist/src/commands/options.d.ts.map +1 -1
- package/dist/src/commands/options.js +5 -0
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/registry.d.ts.map +1 -1
- package/dist/src/commands/registry.js +40 -1
- package/dist/src/commands/registry.js.map +1 -1
- package/dist/src/commands/submit.d.ts +7 -0
- package/dist/src/commands/submit.d.ts.map +1 -1
- package/dist/src/commands/submit.js +14 -1
- package/dist/src/commands/submit.js.map +1 -1
- package/dist/src/commands/warp.d.ts +1 -0
- package/dist/src/commands/warp.d.ts.map +1 -1
- package/dist/src/commands/warp.js +4 -2
- package/dist/src/commands/warp.js.map +1 -1
- package/dist/src/config/core.d.ts +48 -0
- package/dist/src/config/core.d.ts.map +1 -1
- package/dist/src/config/ism.d.ts +40 -0
- package/dist/src/config/ism.d.ts.map +1 -1
- package/dist/src/config/submit.d.ts +3 -1
- package/dist/src/config/submit.d.ts.map +1 -1
- package/dist/src/config/submit.js +18 -4
- package/dist/src/config/submit.js.map +1 -1
- package/dist/src/consts.d.ts +1 -0
- package/dist/src/consts.d.ts.map +1 -1
- package/dist/src/consts.js +1 -0
- package/dist/src/consts.js.map +1 -1
- package/dist/src/context/context.d.ts +2 -2
- package/dist/src/context/context.d.ts.map +1 -1
- package/dist/src/context/context.js +21 -31
- package/dist/src/context/context.js.map +1 -1
- package/dist/src/context/types.d.ts +2 -3
- package/dist/src/context/types.d.ts.map +1 -1
- package/dist/src/deploy/warp.d.ts +10 -3
- package/dist/src/deploy/warp.d.ts.map +1 -1
- package/dist/src/deploy/warp.js +87 -34
- package/dist/src/deploy/warp.js.map +1 -1
- package/dist/src/submit/submit.js +1 -1
- package/dist/src/submit/submit.js.map +1 -1
- package/dist/src/submit/types.d.ts +2 -3
- package/dist/src/submit/types.d.ts.map +1 -1
- package/dist/src/tests/commands/core.d.ts +5 -0
- package/dist/src/tests/commands/core.d.ts.map +1 -0
- package/dist/src/tests/commands/core.js +15 -0
- package/dist/src/tests/commands/core.js.map +1 -0
- package/dist/src/tests/commands/helpers.d.ts +34 -0
- package/dist/src/tests/commands/helpers.d.ts.map +1 -0
- package/dist/src/tests/commands/helpers.js +70 -0
- package/dist/src/tests/commands/helpers.js.map +1 -0
- package/dist/src/tests/commands/warp.d.ts +18 -0
- package/dist/src/tests/commands/warp.d.ts.map +1 -0
- package/dist/src/tests/commands/warp.js +49 -0
- package/dist/src/tests/commands/warp.js.map +1 -0
- package/dist/src/tests/warp-apply.e2e-test.d.ts +2 -0
- package/dist/src/tests/warp-apply.e2e-test.d.ts.map +1 -0
- package/dist/src/tests/warp-apply.e2e-test.js +111 -0
- package/dist/src/tests/warp-apply.e2e-test.js.map +1 -0
- package/dist/src/tests/warp-read.e2e-test.d.ts +2 -0
- package/dist/src/tests/warp-read.e2e-test.d.ts.map +1 -0
- package/dist/src/tests/warp-read.e2e-test.js +32 -0
- package/dist/src/tests/warp-read.e2e-test.js.map +1 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/examples/submit/strategy/gnosis-chain-strategy.yaml +10 -0
- package/examples/submit/strategy/gnosis-ica-strategy.yaml +0 -1
- package/examples/submit/strategy/{gnosis-strategy.yaml → gnosis-strategy-avalanche.yaml} +0 -1
- package/examples/submit/strategy/impersonated-account-strategy.yaml +0 -1
- package/examples/submit/strategy/json-rpc-chain-strategy.yaml +6 -0
- package/examples/submit/strategy/json-rpc-strategy.yaml +0 -1
- package/examples/submit/transactions/anvil-transactions.yaml +10 -0
- package/examples/warp-route-deployment.yaml +0 -11
- package/package.json +10 -10
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TokenRouterConfig } from '@hyperlane-xyz/sdk';
|
|
2
|
+
import { Address } from '@hyperlane-xyz/utils';
|
|
3
|
+
export declare const TEST_CONFIGS_PATH = "./test-configs";
|
|
4
|
+
export declare const REGISTRY_PATH = "./test-configs/anvil";
|
|
5
|
+
export declare const ANVIL_KEY = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves the deployed Warp address from the Warp core config.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getDeployedWarpAddress(chain: string, warpCorePath: string): string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Updates the owner of the Warp route deployment config, and then output to a file
|
|
12
|
+
*/
|
|
13
|
+
export declare function updateWarpOwnerConfig(chain: string, owner: Address, warpCorePath: string, warpDeployPath: string): Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Updates the Warp route deployment configuration with a new owner, and then applies the changes.
|
|
16
|
+
*/
|
|
17
|
+
export declare function updateOwner(owner: Address, chain: string, warpConfigPath: string, warpCoreConfigPath: string): Promise<import("zx").ProcessOutput>;
|
|
18
|
+
/**
|
|
19
|
+
* Extends the Warp route deployment with a new warp config
|
|
20
|
+
*/
|
|
21
|
+
export declare function extendWarpConfig(params: {
|
|
22
|
+
chain: string;
|
|
23
|
+
chainToExtend: string;
|
|
24
|
+
extendedConfig: TokenRouterConfig;
|
|
25
|
+
warpCorePath: string;
|
|
26
|
+
warpDeployPath: string;
|
|
27
|
+
strategyUrl?: string;
|
|
28
|
+
}): Promise<string>;
|
|
29
|
+
/**
|
|
30
|
+
* Deploys new core contracts on the specified chain if it doesn't already exist, and returns the chain addresses.
|
|
31
|
+
*/
|
|
32
|
+
export declare function deployOrUseExistingCore(chain: string, coreInputPath: string, key: string): Promise<Record<string, string>>;
|
|
33
|
+
export declare function getChainId(chainName: string, key: string): Promise<string>;
|
|
34
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/tests/commands/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EAGlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAQ/C,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAClD,eAAO,MAAM,aAAa,yBAA+B,CAAC;AAE1D,eAAO,MAAM,SAAS,uEACgD,CAAC;AAEvE;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,iBAKzE;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,OAAO,EACd,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,MAAM,uCAI3B;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,iBAAiB,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBlB;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,mCAeZ;AACD,wBAAsB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,mBAQ9D"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { WarpCoreConfigSchema, } from '@hyperlane-xyz/sdk';
|
|
2
|
+
import { getContext } from '../../context/context.js';
|
|
3
|
+
import { readYamlOrJson, writeYamlOrJson } from '../../utils/files.js';
|
|
4
|
+
import { hyperlaneCoreDeploy } from './core.js';
|
|
5
|
+
import { hyperlaneWarpApply, readWarpConfig } from './warp.js';
|
|
6
|
+
export const TEST_CONFIGS_PATH = './test-configs';
|
|
7
|
+
export const REGISTRY_PATH = `${TEST_CONFIGS_PATH}/anvil`;
|
|
8
|
+
export const ANVIL_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80';
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves the deployed Warp address from the Warp core config.
|
|
11
|
+
*/
|
|
12
|
+
export function getDeployedWarpAddress(chain, warpCorePath) {
|
|
13
|
+
const warpCoreConfig = readYamlOrJson(warpCorePath);
|
|
14
|
+
WarpCoreConfigSchema.parse(warpCoreConfig);
|
|
15
|
+
return warpCoreConfig.tokens.find((t) => t.chainName === chain)
|
|
16
|
+
.addressOrDenom;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Updates the owner of the Warp route deployment config, and then output to a file
|
|
20
|
+
*/
|
|
21
|
+
export async function updateWarpOwnerConfig(chain, owner, warpCorePath, warpDeployPath) {
|
|
22
|
+
const warpDeployConfig = await readWarpConfig(chain, warpCorePath, warpDeployPath);
|
|
23
|
+
warpDeployConfig[chain].owner = owner;
|
|
24
|
+
writeYamlOrJson(warpDeployPath, warpDeployConfig);
|
|
25
|
+
return warpDeployPath;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Updates the Warp route deployment configuration with a new owner, and then applies the changes.
|
|
29
|
+
*/
|
|
30
|
+
export async function updateOwner(owner, chain, warpConfigPath, warpCoreConfigPath) {
|
|
31
|
+
await updateWarpOwnerConfig(chain, owner, warpCoreConfigPath, warpConfigPath);
|
|
32
|
+
return hyperlaneWarpApply(warpConfigPath, warpCoreConfigPath);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Extends the Warp route deployment with a new warp config
|
|
36
|
+
*/
|
|
37
|
+
export async function extendWarpConfig(params) {
|
|
38
|
+
const { chain, chainToExtend, extendedConfig, warpCorePath, warpDeployPath, strategyUrl, } = params;
|
|
39
|
+
const warpDeployConfig = await readWarpConfig(chain, warpCorePath, warpDeployPath);
|
|
40
|
+
warpDeployConfig[chainToExtend] = extendedConfig;
|
|
41
|
+
writeYamlOrJson(warpDeployPath, warpDeployConfig);
|
|
42
|
+
await hyperlaneWarpApply(warpDeployPath, warpCorePath, strategyUrl);
|
|
43
|
+
return warpDeployPath;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Deploys new core contracts on the specified chain if it doesn't already exist, and returns the chain addresses.
|
|
47
|
+
*/
|
|
48
|
+
export async function deployOrUseExistingCore(chain, coreInputPath, key) {
|
|
49
|
+
const { registry } = await getContext({
|
|
50
|
+
registryUri: REGISTRY_PATH,
|
|
51
|
+
registryOverrideUri: '',
|
|
52
|
+
key,
|
|
53
|
+
});
|
|
54
|
+
const addresses = (await registry.getChainAddresses(chain));
|
|
55
|
+
if (!addresses) {
|
|
56
|
+
await hyperlaneCoreDeploy(chain, coreInputPath);
|
|
57
|
+
return deployOrUseExistingCore(chain, coreInputPath, key);
|
|
58
|
+
}
|
|
59
|
+
return addresses;
|
|
60
|
+
}
|
|
61
|
+
export async function getChainId(chainName, key) {
|
|
62
|
+
const { registry } = await getContext({
|
|
63
|
+
registryUri: REGISTRY_PATH,
|
|
64
|
+
registryOverrideUri: '',
|
|
65
|
+
key,
|
|
66
|
+
});
|
|
67
|
+
const chainMetadata = await registry.getChainMetadata(chainName);
|
|
68
|
+
return String(chainMetadata?.chainId);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/tests/commands/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AA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AC,CAAC;IACH,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACjE,OAAO,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WarpRouteDeployConfig } from '@hyperlane-xyz/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Deploys the Warp route to the specified chain using the provided config.
|
|
4
|
+
*/
|
|
5
|
+
export declare function hyperlaneWarpDeploy(warpCorePath: string): Promise<import("zx").ProcessOutput>;
|
|
6
|
+
/**
|
|
7
|
+
* Applies updates to the Warp route config.
|
|
8
|
+
*/
|
|
9
|
+
export declare function hyperlaneWarpApply(warpDeployPath: string, warpCorePath: string, strategyUrl?: string): Promise<import("zx").ProcessOutput>;
|
|
10
|
+
export declare function hyperlaneWarpRead(chain: string, warpAddress: string, warpDeployPath: string): Promise<import("zx").ProcessOutput>;
|
|
11
|
+
/**
|
|
12
|
+
* Reads the Warp route deployment config to specified output path.
|
|
13
|
+
* @param warpCorePath path to warp core
|
|
14
|
+
* @param warpDeployPath path to output the resulting read
|
|
15
|
+
* @returns The Warp route deployment config.
|
|
16
|
+
*/
|
|
17
|
+
export declare function readWarpConfig(chain: string, warpCorePath: string, warpDeployPath: string): Promise<WarpRouteDeployConfig>;
|
|
18
|
+
//# sourceMappingURL=warp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warp.d.ts","sourceRoot":"","sources":["../../../../src/tests/commands/warp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAQ3D;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,YAAY,EAAE,MAAM,uCAO7D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EACpB,WAAW,SAAK,uCAUjB;AAED,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,uCASvB;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,qBAAqB,CAAC,CAIhC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { $ } from 'zx';
|
|
2
|
+
import { readYamlOrJson } from '../../utils/files.js';
|
|
3
|
+
import { ANVIL_KEY, REGISTRY_PATH, getDeployedWarpAddress } from './helpers.js';
|
|
4
|
+
$.verbose = true;
|
|
5
|
+
/**
|
|
6
|
+
* Deploys the Warp route to the specified chain using the provided config.
|
|
7
|
+
*/
|
|
8
|
+
export async function hyperlaneWarpDeploy(warpCorePath) {
|
|
9
|
+
return $ `yarn workspace @hyperlane-xyz/cli run hyperlane warp deploy \
|
|
10
|
+
--registry ${REGISTRY_PATH} \
|
|
11
|
+
--config ${warpCorePath} \
|
|
12
|
+
--key ${ANVIL_KEY} \
|
|
13
|
+
--verbosity debug \
|
|
14
|
+
--yes`;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Applies updates to the Warp route config.
|
|
18
|
+
*/
|
|
19
|
+
export async function hyperlaneWarpApply(warpDeployPath, warpCorePath, strategyUrl = '') {
|
|
20
|
+
return $ `yarn workspace @hyperlane-xyz/cli run hyperlane warp apply \
|
|
21
|
+
--registry ${REGISTRY_PATH} \
|
|
22
|
+
--config ${warpDeployPath} \
|
|
23
|
+
--warp ${warpCorePath} \
|
|
24
|
+
--key ${ANVIL_KEY} \
|
|
25
|
+
--verbosity debug \
|
|
26
|
+
--strategy ${strategyUrl} \
|
|
27
|
+
--yes`;
|
|
28
|
+
}
|
|
29
|
+
export async function hyperlaneWarpRead(chain, warpAddress, warpDeployPath) {
|
|
30
|
+
return $ `yarn workspace @hyperlane-xyz/cli run hyperlane warp read \
|
|
31
|
+
--registry ${REGISTRY_PATH} \
|
|
32
|
+
--address ${warpAddress} \
|
|
33
|
+
--chain ${chain} \
|
|
34
|
+
--key ${ANVIL_KEY} \
|
|
35
|
+
--verbosity debug \
|
|
36
|
+
--config ${warpDeployPath}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Reads the Warp route deployment config to specified output path.
|
|
40
|
+
* @param warpCorePath path to warp core
|
|
41
|
+
* @param warpDeployPath path to output the resulting read
|
|
42
|
+
* @returns The Warp route deployment config.
|
|
43
|
+
*/
|
|
44
|
+
export async function readWarpConfig(chain, warpCorePath, warpDeployPath) {
|
|
45
|
+
const warpAddress = getDeployedWarpAddress(chain, warpCorePath);
|
|
46
|
+
await hyperlaneWarpRead(chain, warpAddress, warpDeployPath);
|
|
47
|
+
return readYamlOrJson(warpDeployPath);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=warp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warp.js","sourceRoot":"","sources":["../../../../src/tests/commands/warp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC;AAIvB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEhF,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC;AAEjB;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,YAAoB;IAC5D,OAAO,CAAC,CAAA;qBACW,aAAa;mBACf,YAAY;gBACf,SAAS;;cAEX,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,cAAsB,EACtB,YAAoB,EACpB,WAAW,GAAG,EAAE;IAEhB,OAAO,CAAC,CAAA;qBACW,aAAa;mBACf,cAAc;iBAChB,YAAY;gBACb,SAAS;;qBAEJ,WAAW;cAClB,CAAC;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAAa,EACb,WAAmB,EACnB,cAAsB;IAEtB,OAAO,CAAC,CAAA;qBACW,aAAa;oBACd,WAAW;kBACb,KAAK;gBACP,SAAS;;mBAEN,cAAc,EAAE,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,KAAa,EACb,YAAoB,EACpB,cAAsB;IAEtB,MAAM,WAAW,GAAG,sBAAsB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAChE,MAAM,iBAAiB,CAAC,KAAK,EAAE,WAAY,EAAE,cAAc,CAAC,CAAC;IAC7D,OAAO,cAAc,CAAC,cAAc,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warp-apply.e2e-test.d.ts","sourceRoot":"","sources":["../../../src/tests/warp-apply.e2e-test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { Wallet } from 'ethers';
|
|
3
|
+
import { TokenType, } from '@hyperlane-xyz/sdk';
|
|
4
|
+
import { readYamlOrJson, writeYamlOrJson } from '../utils/files.js';
|
|
5
|
+
import { ANVIL_KEY, REGISTRY_PATH, deployOrUseExistingCore, extendWarpConfig, getChainId, updateOwner, } from './commands/helpers.js';
|
|
6
|
+
import { hyperlaneWarpDeploy, readWarpConfig } from './commands/warp.js';
|
|
7
|
+
const CHAIN_NAME_2 = 'anvil2';
|
|
8
|
+
const CHAIN_NAME_3 = 'anvil3';
|
|
9
|
+
const BURN_ADDRESS = '0x0000000000000000000000000000000000000001';
|
|
10
|
+
const EXAMPLES_PATH = './examples';
|
|
11
|
+
const CORE_CONFIG_PATH = `${EXAMPLES_PATH}/core-config.yaml`;
|
|
12
|
+
const WARP_CONFIG_PATH_EXAMPLE = `${EXAMPLES_PATH}/warp-route-deployment.yaml`;
|
|
13
|
+
const TEMP_PATH = '/tmp'; // /temp gets removed at the end of all-test.sh
|
|
14
|
+
const WARP_CONFIG_PATH_2 = `${TEMP_PATH}/anvil2/warp-route-deployment-anvil2.yaml`;
|
|
15
|
+
const WARP_CORE_CONFIG_PATH_2 = `${REGISTRY_PATH}/deployments/warp_routes/ETH/anvil2-config.yaml`;
|
|
16
|
+
const TEST_TIMEOUT = 60000; // Long timeout since these tests can take a while
|
|
17
|
+
describe('WarpApply e2e tests', async function () {
|
|
18
|
+
let chain2Addresses = {};
|
|
19
|
+
this.timeout(TEST_TIMEOUT);
|
|
20
|
+
before(async function () {
|
|
21
|
+
await deployOrUseExistingCore(CHAIN_NAME_2, CORE_CONFIG_PATH, ANVIL_KEY);
|
|
22
|
+
chain2Addresses = await deployOrUseExistingCore(CHAIN_NAME_3, CORE_CONFIG_PATH, ANVIL_KEY);
|
|
23
|
+
// Create a new warp config using the example
|
|
24
|
+
const warpConfig = readYamlOrJson(WARP_CONFIG_PATH_EXAMPLE);
|
|
25
|
+
const anvil2Config = { anvil2: { ...warpConfig.anvil1 } };
|
|
26
|
+
writeYamlOrJson(WARP_CONFIG_PATH_2, anvil2Config);
|
|
27
|
+
});
|
|
28
|
+
beforeEach(async function () {
|
|
29
|
+
await hyperlaneWarpDeploy(WARP_CONFIG_PATH_2);
|
|
30
|
+
});
|
|
31
|
+
it('should burn owner address', async function () {
|
|
32
|
+
const warpConfigPath = `${TEMP_PATH}/warp-route-deployment-2.yaml`;
|
|
33
|
+
await updateOwner(BURN_ADDRESS, CHAIN_NAME_2, warpConfigPath, WARP_CORE_CONFIG_PATH_2);
|
|
34
|
+
const updatedWarpDeployConfig = await readWarpConfig(CHAIN_NAME_2, WARP_CORE_CONFIG_PATH_2, warpConfigPath);
|
|
35
|
+
expect(updatedWarpDeployConfig.anvil2.owner).to.equal(BURN_ADDRESS);
|
|
36
|
+
});
|
|
37
|
+
it('should not update the same owner', async () => {
|
|
38
|
+
const warpConfigPath = `${TEMP_PATH}/warp-route-deployment-2.yaml`;
|
|
39
|
+
await updateOwner(BURN_ADDRESS, CHAIN_NAME_2, warpConfigPath, WARP_CORE_CONFIG_PATH_2);
|
|
40
|
+
const { stdout } = await updateOwner(BURN_ADDRESS, CHAIN_NAME_2, warpConfigPath, WARP_CORE_CONFIG_PATH_2);
|
|
41
|
+
expect(stdout).to.include('Warp config on anvil2 is the same as target. No updates needed.');
|
|
42
|
+
});
|
|
43
|
+
it('should extend an existing warp route', async () => {
|
|
44
|
+
// Read existing config into a file
|
|
45
|
+
const warpConfigPath = `${TEMP_PATH}/warp-route-deployment-2.yaml`;
|
|
46
|
+
await readWarpConfig(CHAIN_NAME_2, WARP_CORE_CONFIG_PATH_2, warpConfigPath);
|
|
47
|
+
// Extend with new config
|
|
48
|
+
const config = {
|
|
49
|
+
decimals: 18,
|
|
50
|
+
mailbox: chain2Addresses.mailbox,
|
|
51
|
+
name: 'Ether',
|
|
52
|
+
owner: new Wallet(ANVIL_KEY).address,
|
|
53
|
+
symbol: 'ETH',
|
|
54
|
+
totalSupply: 0,
|
|
55
|
+
type: TokenType.native,
|
|
56
|
+
};
|
|
57
|
+
await extendWarpConfig({
|
|
58
|
+
chain: CHAIN_NAME_2,
|
|
59
|
+
chainToExtend: CHAIN_NAME_3,
|
|
60
|
+
extendedConfig: config,
|
|
61
|
+
warpCorePath: WARP_CORE_CONFIG_PATH_2,
|
|
62
|
+
warpDeployPath: warpConfigPath,
|
|
63
|
+
});
|
|
64
|
+
const COMBINED_WARP_CORE_CONFIG_PATH = `${REGISTRY_PATH}/deployments/warp_routes/ETH/anvil2-anvil3-config.yaml`;
|
|
65
|
+
// Check that chain2 is enrolled in chain1
|
|
66
|
+
const updatedWarpDeployConfig1 = await readWarpConfig(CHAIN_NAME_2, COMBINED_WARP_CORE_CONFIG_PATH, warpConfigPath);
|
|
67
|
+
const chain2Id = await getChainId(CHAIN_NAME_3, ANVIL_KEY);
|
|
68
|
+
const remoteRouterKeys1 = Object.keys(updatedWarpDeployConfig1[CHAIN_NAME_2].remoteRouters);
|
|
69
|
+
expect(remoteRouterKeys1).to.include(chain2Id);
|
|
70
|
+
// Check that chain1 is enrolled in chain2
|
|
71
|
+
const updatedWarpDeployConfig2 = await readWarpConfig(CHAIN_NAME_3, COMBINED_WARP_CORE_CONFIG_PATH, warpConfigPath);
|
|
72
|
+
const chain1Id = await getChainId(CHAIN_NAME_2, ANVIL_KEY);
|
|
73
|
+
const remoteRouterKeys2 = Object.keys(updatedWarpDeployConfig2[CHAIN_NAME_3].remoteRouters);
|
|
74
|
+
expect(remoteRouterKeys2).to.include(chain1Id);
|
|
75
|
+
});
|
|
76
|
+
it('should extend an existing warp route with json strategy', async () => {
|
|
77
|
+
// Read existing config into a file
|
|
78
|
+
const warpConfigPath = `${TEMP_PATH}/warp-route-deployment-2.yaml`;
|
|
79
|
+
await readWarpConfig(CHAIN_NAME_2, WARP_CORE_CONFIG_PATH_2, warpConfigPath);
|
|
80
|
+
// Extend with new config
|
|
81
|
+
const config = {
|
|
82
|
+
decimals: 18,
|
|
83
|
+
mailbox: chain2Addresses.mailbox,
|
|
84
|
+
name: 'Ether',
|
|
85
|
+
owner: new Wallet(ANVIL_KEY).address,
|
|
86
|
+
symbol: 'ETH',
|
|
87
|
+
totalSupply: 0,
|
|
88
|
+
type: TokenType.native,
|
|
89
|
+
};
|
|
90
|
+
await extendWarpConfig({
|
|
91
|
+
chain: CHAIN_NAME_2,
|
|
92
|
+
chainToExtend: CHAIN_NAME_3,
|
|
93
|
+
extendedConfig: config,
|
|
94
|
+
warpCorePath: WARP_CORE_CONFIG_PATH_2,
|
|
95
|
+
warpDeployPath: warpConfigPath,
|
|
96
|
+
strategyUrl: `${EXAMPLES_PATH}/submit/strategy/json-rpc-chain-strategy.yaml`,
|
|
97
|
+
});
|
|
98
|
+
const COMBINED_WARP_CORE_CONFIG_PATH = `${REGISTRY_PATH}/deployments/warp_routes/ETH/anvil2-anvil3-config.yaml`;
|
|
99
|
+
// Check that chain2 is enrolled in chain1
|
|
100
|
+
const updatedWarpDeployConfig1 = await readWarpConfig(CHAIN_NAME_2, COMBINED_WARP_CORE_CONFIG_PATH, warpConfigPath);
|
|
101
|
+
const chain2Id = await getChainId(CHAIN_NAME_3, ANVIL_KEY);
|
|
102
|
+
const remoteRouterKeys1 = Object.keys(updatedWarpDeployConfig1[CHAIN_NAME_2].remoteRouters);
|
|
103
|
+
expect(remoteRouterKeys1).to.include(chain2Id);
|
|
104
|
+
// Check that chain1 is enrolled in chain2
|
|
105
|
+
const updatedWarpDeployConfig2 = await readWarpConfig(CHAIN_NAME_3, COMBINED_WARP_CORE_CONFIG_PATH, warpConfigPath);
|
|
106
|
+
const chain1Id = await getChainId(CHAIN_NAME_2, ANVIL_KEY);
|
|
107
|
+
const remoteRouterKeys2 = Object.keys(updatedWarpDeployConfig2[CHAIN_NAME_3].remoteRouters);
|
|
108
|
+
expect(remoteRouterKeys2).to.include(chain1Id);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=warp-apply.e2e-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warp-apply.e2e-test.js","sourceRoot":"","sources":["../../../src/tests/warp-apply.e2e-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAEL,SAAS,GAEV,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EACL,SAAS,EACT,aAAa,EACb,uBAAuB,EACvB,gBAAgB,EAChB,UAAU,EACV,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,YAAY,GAAG,QAAQ,CAAC;AAC9B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
|
+
import { expect } from 'chai';
|
|
2
|
+
import { readYamlOrJson, writeYamlOrJson } from '../utils/files.js';
|
|
3
|
+
import { ANVIL_KEY, REGISTRY_PATH, deployOrUseExistingCore, } from './commands/helpers.js';
|
|
4
|
+
import { hyperlaneWarpDeploy, readWarpConfig } from './commands/warp.js';
|
|
5
|
+
const CHAIN_NAME_2 = 'anvil2';
|
|
6
|
+
const EXAMPLES_PATH = './examples';
|
|
7
|
+
const CORE_CONFIG_PATH = `${EXAMPLES_PATH}/core-config.yaml`;
|
|
8
|
+
const WARP_CONFIG_PATH_EXAMPLE = `${EXAMPLES_PATH}/warp-route-deployment.yaml`;
|
|
9
|
+
const TEMP_PATH = '/tmp'; // /temp gets removed at the end of all-test.sh
|
|
10
|
+
const WARP_CONFIG_PATH_2 = `${TEMP_PATH}/anvil2/warp-route-deployment-anvil2.yaml`;
|
|
11
|
+
const WARP_CORE_CONFIG_PATH_2 = `${REGISTRY_PATH}/deployments/warp_routes/ETH/anvil2-config.yaml`;
|
|
12
|
+
const TEST_TIMEOUT = 60000; // Long timeout since these tests can take a while
|
|
13
|
+
describe('WarpRead e2e tests', async function () {
|
|
14
|
+
let anvil2Config;
|
|
15
|
+
this.timeout(TEST_TIMEOUT);
|
|
16
|
+
before(async function () {
|
|
17
|
+
await deployOrUseExistingCore(CHAIN_NAME_2, CORE_CONFIG_PATH, ANVIL_KEY);
|
|
18
|
+
// Create a new warp config using the example
|
|
19
|
+
const exampleWarpConfig = readYamlOrJson(WARP_CONFIG_PATH_EXAMPLE);
|
|
20
|
+
anvil2Config = { anvil2: { ...exampleWarpConfig.anvil1 } };
|
|
21
|
+
writeYamlOrJson(WARP_CONFIG_PATH_2, anvil2Config);
|
|
22
|
+
});
|
|
23
|
+
beforeEach(async function () {
|
|
24
|
+
await hyperlaneWarpDeploy(WARP_CONFIG_PATH_2);
|
|
25
|
+
});
|
|
26
|
+
it('should be able to read a warp route', async function () {
|
|
27
|
+
const warpConfigPath = `${TEMP_PATH}/warp-route-deployment-2.yaml`;
|
|
28
|
+
const warpConfig = await readWarpConfig(CHAIN_NAME_2, WARP_CORE_CONFIG_PATH_2, warpConfigPath);
|
|
29
|
+
expect(warpConfig[CHAIN_NAME_2].type).to.be.equal(anvil2Config[CHAIN_NAME_2].type);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=warp-read.e2e-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warp-read.e2e-test.js","sourceRoot":"","sources":["../../../src/tests/warp-read.e2e-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAI9B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EACL,SAAS,EACT,aAAa,EACb,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,YAAY,GAAG,QAAQ,CAAC;AAE9B,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,MAAM,gBAAgB,GAAG,GAAG,aAAa,mBAAmB,CAAC;AAC7D,MAAM,wBAAwB,GAAG,GAAG,aAAa,6BAA6B,CAAC;AAE/E,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,+CAA+C;AACzE,MAAM,kBAAkB,GAAG,GAAG,SAAS,2CAA2C,CAAC;AACnF,MAAM,uBAAuB,GAAG,GAAG,aAAa,iDAAiD,CAAC;AAElG,MAAM,YAAY,GAAG,KAAM,CAAC,CAAC,kDAAkD;AAC/E,QAAQ,CAAC,oBAAoB,EAAE,KAAK;IAClC,IAAI,YAAmC,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3B,MAAM,CAAC,KAAK;QACV,MAAM,uBAAuB,CAAC,YAAY,EAAE,gBAAgB,EAAE,SAAS,CAAC,CAAC;QAEzE,6CAA6C;QAC7C,MAAM,iBAAiB,GAA0B,cAAc,CAC7D,wBAAwB,CACzB,CAAC;QACF,YAAY,GAAG,EAAE,MAAM,EAAE,EAAE,GAAG,iBAAiB,CAAC,MAAM,EAAE,EAAE,CAAC;QAC3D,eAAe,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,UAAU,CAAC,KAAK;QACd,MAAM,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,KAAK;QAC7C,MAAM,cAAc,GAAG,GAAG,SAAS,+BAA+B,CAAC;QACnE,MAAM,UAAU,GAAG,MAAM,cAAc,CACrC,YAAY,EACZ,uBAAuB,EACvB,cAAc,CACf,CAAC;QACF,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAC/C,YAAY,CAAC,YAAY,CAAC,CAAC,IAAI,CAChC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "5.
|
|
1
|
+
export declare const VERSION = "5.2.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '5.
|
|
1
|
+
export const VERSION = '5.2.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -19,14 +19,3 @@ anvil1:
|
|
|
19
19
|
# name: "MyCollateralToken"
|
|
20
20
|
# symbol: "MCT"
|
|
21
21
|
# totalSupply: 10000000
|
|
22
|
-
|
|
23
|
-
anvil2:
|
|
24
|
-
type: synthetic
|
|
25
|
-
# token: "0x123" # Collateral/vault address. Required for collateral types
|
|
26
|
-
# owner: "0x123" # Optional owner address for synthetic token
|
|
27
|
-
# mailbox: "0x123" # mailbox address route
|
|
28
|
-
# interchainGasPaymaster: "0x123" # Optional interchainGasPaymaster address
|
|
29
|
-
# You can optionally set the token metadata
|
|
30
|
-
# name: "MySyntheticToken"
|
|
31
|
-
# symbol: "MST"
|
|
32
|
-
# totalSupply: 10000000
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperlane-xyz/cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "A command-line utility for common Hyperlane operations",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-kms": "^3.577.0",
|
|
7
7
|
"@aws-sdk/client-s3": "^3.577.0",
|
|
8
|
-
"@hyperlane-xyz/registry": "
|
|
9
|
-
"@hyperlane-xyz/sdk": "5.
|
|
10
|
-
"@hyperlane-xyz/utils": "5.
|
|
8
|
+
"@hyperlane-xyz/registry": "4.1.0",
|
|
9
|
+
"@hyperlane-xyz/sdk": "5.2.0",
|
|
10
|
+
"@hyperlane-xyz/utils": "5.2.0",
|
|
11
11
|
"@inquirer/prompts": "^3.0.0",
|
|
12
12
|
"asn1.js": "^5.4.1",
|
|
13
13
|
"bignumber.js": "^9.1.1",
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
"latest-version": "^8.0.0",
|
|
17
17
|
"terminal-link": "^3.0.0",
|
|
18
18
|
"tsx": "^4.7.1",
|
|
19
|
-
"yaml": "
|
|
19
|
+
"yaml": "2.4.5",
|
|
20
20
|
"yargs": "^17.7.2",
|
|
21
21
|
"zod": "^3.21.2",
|
|
22
|
-
"zod-validation-error": "^3.3.0"
|
|
22
|
+
"zod-validation-error": "^3.3.0",
|
|
23
|
+
"zx": "^8.1.4"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@ethersproject/abi": "*",
|
|
@@ -29,12 +30,12 @@
|
|
|
29
30
|
"@types/yargs": "^17.0.24",
|
|
30
31
|
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
31
32
|
"@typescript-eslint/parser": "^7.4.0",
|
|
32
|
-
"chai": "
|
|
33
|
+
"chai": "4.5.0",
|
|
33
34
|
"eslint": "^8.57.0",
|
|
34
35
|
"eslint-config-prettier": "^9.1.0",
|
|
35
36
|
"mocha": "^10.2.0",
|
|
36
37
|
"prettier": "^2.8.8",
|
|
37
|
-
"typescript": "
|
|
38
|
+
"typescript": "5.3.3"
|
|
38
39
|
},
|
|
39
40
|
"scripts": {
|
|
40
41
|
"hyperlane": "node ./dist/cli.js",
|
|
@@ -43,8 +44,7 @@
|
|
|
43
44
|
"clean": "rm -rf ./dist",
|
|
44
45
|
"lint": "eslint . --ext .ts",
|
|
45
46
|
"prettier": "prettier --write ./src ./examples",
|
|
46
|
-
"test": "
|
|
47
|
-
"test:ci": "yarn test",
|
|
47
|
+
"test:ci": "./scripts/all-test.sh",
|
|
48
48
|
"version:update": "echo \"export const VERSION = '$npm_package_version';\" > src/version.ts"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|