@@ -14,6 +14,7 @@ import {
1414 type ChainMetadata ,
1515 InterchainAccount ,
1616 TokenType ,
17+ type WarpCoreConfig ,
1718 type WarpRouteDeployConfig ,
1819} from '@hyperlane-xyz/sdk' ;
1920import {
@@ -374,4 +375,48 @@ describe('hyperlane warp check --ica e2e tests', async function () {
374375 expect ( output . text ( ) ) . to . include ( 'EXPECTED' ) ;
375376 expect ( output . text ( ) ) . to . include ( normalizeAddressEvm ( nonConfigOwnerIca ) ) ;
376377 } ) ;
378+
379+ it ( 'should work with non-deployed chains using deploy config and empty warpCoreConfig' , async function ( ) {
380+ // Create a warp deploy config WITHOUT deploying it
381+ // This tests that --ica works before warp apply/extension
382+ const nonDeployedConfig : WarpRouteDeployConfig = {
383+ [ CHAIN_NAME_2 ] : {
384+ type : TokenType . collateral ,
385+ token : token . address ,
386+ mailbox : chain2Addresses . mailbox ,
387+ owner : icaOwnerAddress ,
388+ } ,
389+ [ CHAIN_NAME_3 ] : {
390+ type : TokenType . synthetic ,
391+ mailbox : chain3Addresses . mailbox ,
392+ owner : expectedIcaAddress ,
393+ } ,
394+ } ;
395+
396+ const warpDeployPath = combinedWarpCoreConfigPath . replace (
397+ '-config.yaml' ,
398+ '-ica-non-deployed-deploy.yaml' ,
399+ ) ;
400+ writeYamlOrJson ( warpDeployPath , nonDeployedConfig ) ;
401+
402+ // Create an empty warpCoreConfig (no deployed tokens yet)
403+ const emptyWarpCoreConfig : WarpCoreConfig = { tokens : [ ] } ;
404+ const warpCorePath = combinedWarpCoreConfigPath . replace (
405+ '-config.yaml' ,
406+ '-ica-non-deployed-core.yaml' ,
407+ ) ;
408+ writeYamlOrJson ( warpCorePath , emptyWarpCoreConfig ) ;
409+
410+ // Run ICA check with both configs - the deploy config has chains, warpCoreConfig is empty
411+ // This simulates checking ICA ownership before warp apply/extension
412+ const output = await hyperlaneWarpCheckRaw ( {
413+ warpDeployPath,
414+ warpCoreConfigPath : warpCorePath ,
415+ ica : true ,
416+ origin : CHAIN_NAME_2 ,
417+ } ) . nothrow ( ) ;
418+
419+ expect ( output . exitCode ) . to . equal ( 0 ) ;
420+ expect ( output . text ( ) ) . to . include ( 'No violations found' ) ;
421+ } ) ;
377422} ) ;
0 commit comments