Skip to content

Commit

Permalink
give option in the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
aroralanuk committed Dec 1, 2023
1 parent 340bc5d commit 03fce88
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .changeset/large-guests-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@hyperlane-xyz/infra': patch
'@hyperlane-xyz/cli': patch
'@hyperlane-xyz/sdk': patch
'@hyperlane-xyz/core': patch
---

Supporting DefaultFallbackRoutingIsm through non-factory deployments
16 changes: 13 additions & 3 deletions typescript/cli/src/config/ism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ export async function createIsmConfig(
description:
'Each origin chain can be verified by the specified ISM type via RoutingISM',
},
{
value: IsmType.FALLBACK_ROUTING,
name: IsmType.FALLBACK_ROUTING,
description:
"You can specify ISM type for specific chains you like and fallback to mailbox's default ISM for other chains via DefaultFallbackRoutingISM",
},
{
value: IsmType.AGGREGATION,
name: IsmType.AGGREGATION,
Expand All @@ -179,8 +185,11 @@ export async function createIsmConfig(
moduleType === IsmType.MERKLE_ROOT_MULTISIG
) {
lastConfig = await createMultisigConfig(moduleType);
} else if (moduleType === IsmType.ROUTING) {
lastConfig = await createRoutingConfig(chain, chainConfigPath);
} else if (
moduleType === IsmType.ROUTING ||
moduleType === IsmType.FALLBACK_ROUTING
) {
lastConfig = await createRoutingConfig(moduleType, chain, chainConfigPath);
} else if (moduleType === IsmType.AGGREGATION) {
lastConfig = await createAggregationConfig(chain, chainConfigPath);
} else if (moduleType === IsmType.TEST_ISM) {
Expand Down Expand Up @@ -240,6 +249,7 @@ export async function createAggregationConfig(
}

export async function createRoutingConfig(
type: IsmType.ROUTING | IsmType.FALLBACK_ROUTING,
chain: ChainName,
chainConfigPath: string,
): Promise<ZodIsmConfig> {
Expand All @@ -264,7 +274,7 @@ export async function createRoutingConfig(
domainsMap[chain] = config;
}
return {
type: IsmType.ROUTING,
type,
owner: ownerAddress,
domains: domainsMap,
};
Expand Down

0 comments on commit 03fce88

Please sign in to comment.