Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: warp init simplified config #4504

Merged
merged 11 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
5 changes: 5 additions & 0 deletions .changeset/long-swans-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---

Add prompt in `warp init` command to choose if a trusted relayer should be used instead of making the choice by default for the user adn enable the `--yes` flag to default to a trusted ISM
19 changes: 15 additions & 4 deletions typescript/cli/src/config/warp.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { input, select } from '@inquirer/prompts';
import { confirm, input, select } from '@inquirer/prompts';
import { stringify as yamlStringify } from 'yaml';

import {
Expand Down Expand Up @@ -144,9 +144,20 @@ export async function createWarpRouteDeployConfig({
'hyperlane-registry',
);

const interchainSecurityModule = advanced
? await createAdvancedIsmConfig(context)
: createDefaultWarpIsmConfig(owner);
let createDefaultIsm: boolean;
if (advanced) {
createDefaultIsm = false;
} else if (context.skipConfirmation) {
createDefaultIsm = true;
} else {
createDefaultIsm = await confirm({
message: 'Use a trusted ISM for warp route',
});
}

const interchainSecurityModule = createDefaultIsm
? createDefaultWarpIsmConfig(owner)
: await createAdvancedIsmConfig(context);

switch (type) {
case TokenType.collateral:
Expand Down
Loading