Skip to content

Commit 8aa550f

Browse files
committed
update contract deploy state check logic
1 parent d7c561d commit 8aa550f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

container-manager/src/libs/state.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const instance = axios.create({
77
});
88
const fs = require("fs");
99
const path = require("path");
10+
const { env } = require("process");
1011
const mountPath = path.join(__dirname, "../../mount/generated/");
1112

1213
module.exports = {
@@ -412,18 +413,20 @@ function readConfig() {
412413
function 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

Comments
 (0)