fix: early strategy detection in warp apply (#4706)

### Description
When using `warp apply`, a user may provide a `strategyUrl`. However,
they won't know if 1) it's valid, and 2) if it even exists until much
later. This adds the detection & validation early.

### Drive-by changes
Remove yaml print

### Backward compatibility
Yes

### Testing
Manual
pull/4711/head
Lee 1 month ago committed by GitHub
parent a54210583e
commit 41035aac8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      .changeset/dry-foxes-battle.md
  2. 4
      typescript/cli/src/commands/warp.ts
  3. 5
      typescript/cli/src/deploy/warp.ts

@ -0,0 +1,6 @@
---
'@hyperlane-xyz/cli': minor
---
Add strategyUrl detect and validation in the beginning of `warp apply`
Remove yaml transactions print from `warp apply`

@ -9,6 +9,7 @@ import {
} from '@hyperlane-xyz/core';
import {
ChainMap,
ChainSubmissionStrategySchema,
EvmERC20WarpRouteReader,
TokenStandard,
WarpCoreConfig,
@ -30,6 +31,7 @@ import { log, logGray, logGreen, logRed, logTable } from '../logger.js';
import { sendTestTransfer } from '../send/transfer.js';
import {
indentYamlOrJson,
readYamlOrJson,
removeEndingSlash,
writeYamlOrJson,
} from '../utils/files.js';
@ -113,6 +115,8 @@ export const apply: CommandModuleWithWriteContext<{
logRed(`Please specify either a symbol or warp config`);
process.exit(0);
}
if (strategyUrl)
ChainSubmissionStrategySchema.parse(readYamlOrJson(strategyUrl));
const warpDeployConfig = await readWarpRouteDeployConfig(config);
await runWarpRouteApply({

@ -848,11 +848,6 @@ async function submitWarpApplyTransactions(
`Transactions receipts successfully written to ${receiptPath}`,
);
}
logGreen(
`✅ Warp route update success with ${submitter.txSubmitterType} on ${chain}:\n\n`,
indentYamlOrJson(yamlStringify(transactionReceipts, null, 2), 0),
);
}),
);
}

Loading…
Cancel
Save