From 59871281a762df97bb0f34dd374199586e8ef4c7 Mon Sep 17 00:00:00 2001 From: wanwiset25 Date: Mon, 8 Jul 2024 12:31:01 +0400 Subject: [PATCH] update --- cicd/applicationregister.js | 10 ++++------ cicd/endpointandregisterchain.js | 11 +++++------ cicd/subswap.js | 10 ++++------ 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/cicd/applicationregister.js b/cicd/applicationregister.js index b6345c0..73e8eb2 100755 --- a/cicd/applicationregister.js +++ b/cicd/applicationregister.js @@ -60,16 +60,14 @@ function importEndpointJson() { function initApplicationRegister() { if (process.env.PARENTNET_URL) { parentnetURL = process.env.PARENTNET_URL; - } else if (process.env.PARENTNET) { - parentnet = process.env.PARENTNET; - if (parentnet == "devnet") + if (parentnetURL == "devnet") parentnetURL = "https://devnetstats.apothem.network/devnet"; - if (parentnet == "testnet") + if (parentnetURL == "testnet") parentnetURL = "https://devnetstats.apothem.network/testnet"; - if (parentnet == "mainnet") + if (parentnetURL == "mainnet") parentnetURL = "https://devnetstats.apothem.network/mainnet"; } else { - throw Error("PARENTNET or PARENTNET_URL not found"); + throw Error("PARENTNET_URL not found"); } const reqENV = [ diff --git a/cicd/endpointandregisterchain.js b/cicd/endpointandregisterchain.js index 00abd5a..155b149 100644 --- a/cicd/endpointandregisterchain.js +++ b/cicd/endpointandregisterchain.js @@ -25,18 +25,17 @@ async function main() { function initEndpointDeploy() { if (process.env.PARENTNET_URL) { parentnetURL = process.env.PARENTNET_URL; - } else if (process.env.PARENTNET) { - parentnet = process.env.PARENTNET; - if (parentnet == "devnet") + if (parentnetURL == "devnet") parentnetURL = "https://devnetstats.apothem.network/devnet"; - if (parentnet == "testnet") + if (parentnetURL == "testnet") parentnetURL = "https://devnetstats.apothem.network/testnet"; - if (parentnet == "mainnet") + if (parentnetURL == "mainnet") parentnetURL = "https://devnetstats.apothem.network/mainnet"; } else { - throw Error("PARENTNET or PARENTNET_URL not found"); + throw Error("PARENTNET_URL not found"); } + const reqENV = [ "SUBNET_PK", "PARENTNET_PK", diff --git a/cicd/subswap.js b/cicd/subswap.js index 6f5187a..718c048 100644 --- a/cicd/subswap.js +++ b/cicd/subswap.js @@ -49,16 +49,14 @@ function checkEndpointConfig() { function initSubswapDeploy() { if (process.env.PARENTNET_URL) { parentnetURL = process.env.PARENTNET_URL; - } else if (process.env.PARENTNET) { - parentnet = process.env.PARENTNET; - if (parentnet == "devnet") + if (parentnetURL == "devnet") parentnetURL = "https://devnetstats.apothem.network/devnet"; - if (parentnet == "testnet") + if (parentnetURL == "testnet") parentnetURL = "https://devnetstats.apothem.network/testnet"; - if (parentnet == "mainnet") + if (parentnetURL == "mainnet") parentnetURL = "https://devnetstats.apothem.network/mainnet"; } else { - throw Error("PARENTNET or PARENTNET_URL not found"); + throw Error("PARENTNET_URL not found"); } const reqENV = ["SUBNET_PK", "PARENTNET_PK", "SUBNET_URL"];