@@ -7,6 +7,7 @@ const instance = axios.create({
77} ) ;
88const fs = require ( "fs" ) ;
99const path = require ( "path" ) ;
10+ const { env } = require ( "process" ) ;
1011const mountPath = path . join ( __dirname , "../../mount/generated/" ) ;
1112
1213module . exports = {
@@ -412,18 +413,20 @@ function readConfig() {
412413function isContractDeployComplete ( req ) {
413414 const filepath = path . join ( mountPath , "common.env" ) ;
414415 if ( "relayer" in req ) {
415- const relayer = findENVInFile ( "CHECKPOINT_CONTRACT" , filepath ) ; //check name
416+ const relayer = findENVInFile ( "CHECKPOINT_CONTRACT" , filepath ) ;
416417 if ( relayer . length == 0 ) return false ;
417418 }
418419
419420 if ( "zero" in req ) {
420- const zero = findENVInFile ( "ZERO_CONTRACT" , filepath ) ; //check name
421- if ( zero . length == 0 ) return false ;
421+ const parentZero = findENVInFile ( "PARENTNET_ZERO_CONTRACT" , filepath ) ;
422+ const subnetZero = findENVInFile ( "SUBNET_ZERO_CONTRACT" , filepath ) ;
423+ if ( parentZero . length == 0 && subnetZero . length == 0 ) return false ;
422424 }
423425
424426 if ( "subswap" in req ) {
425- const subswap = findENVInFile ( "_APP" , filepath ) ; //check name
426- if ( subswap . length == 0 ) return false ;
427+ const parentSubswap = findENVInFile ( "PARENTNET_APP" , filepath ) ;
428+ const subnetSubswap = findENVInFile ( "SUBNET_APP" , filepath ) ;
429+ if ( parentSubswap . length == 0 && subnetSubswap . length == 0 ) return false ;
427430 }
428431
429432 return true ;
0 commit comments