From 0da8a4fcf8ad5c0ccccfcf6f301739ec8ae5cdb0 Mon Sep 17 00:00:00 2001 From: abhiyana Date: Thu, 28 Sep 2023 11:55:30 +0530 Subject: [PATCH] refactor: change remote package path to relative path inside import_module() in starlark packages --- main.star | 22 +++++++++---------- services/bridges/ibc/src/bridge.star | 2 +- services/cosmvm/archway/archway.star | 4 ++-- .../archway/src/node-setup/start_node.star | 2 +- .../relay-setup/contract-configuration.star | 5 ++--- services/cosmvm/cosmvm.star | 7 +++--- services/cosmvm/neutron/neutron.star | 4 ++-- .../neutron/src/node-setup/start_node.star | 2 +- services/evm/eth/eth.star | 4 ++-- .../eth/src/node-setup/contract-deployer.star | 2 +- .../eth/src/node-setup/contract-service.star | 3 +-- .../relay-setup/contract_configuration.star | 2 +- services/jvm/icon/icon.star | 8 +++---- .../icon/src/node-setup/setup_icon_node.star | 2 +- .../icon/src/node-setup/start_icon_node.star | 2 +- .../relay-setup/contract_configuration.star | 4 ++-- 16 files changed, 36 insertions(+), 39 deletions(-) diff --git a/main.star b/main.star index 05aa17a0..87af3fb3 100644 --- a/main.star +++ b/main.star @@ -1,14 +1,14 @@ -icon_setup_node = import_module("github.com/hugobyte/dive/services/jvm/icon/src/node-setup/setup_icon_node.star") -eth_contract_service = import_module("github.com/hugobyte/dive/services/evm/eth/src/node-setup/contract-service.star") -eth_relay_setup = import_module("github.com/hugobyte/dive/services/evm/eth/src/relay-setup/contract_configuration.star") -eth_node = import_module("github.com/hugobyte/dive/services/evm/eth/eth.star") -icon_relay_setup = import_module("github.com/hugobyte/dive/services/jvm/icon/src/relay-setup/contract_configuration.star") -icon_service = import_module("github.com/hugobyte/dive/services/jvm/icon/icon.star") -btp_bridge = import_module("github.com/hugobyte/dive/services/bridges/btp/src/bridge.star") -input_parser = import_module("github.com/hugobyte/dive/package_io/input_parser.star") -cosmvm_node = import_module("github.com/hugobyte/dive/services/cosmvm/cosmvm.star") -cosmvm_relay = import_module("github.com/hugobyte/dive/services/bridges/ibc/src/bridge.star") -cosmvm_relay_setup = import_module("github.com/hugobyte/dive/services/cosmvm/archway/src/relay-setup/contract-configuration.star") +icon_setup_node = import_module("./services/jvm/icon/src/node-setup/setup_icon_node.star") +eth_contract_service = import_module("./services/evm/eth/src/node-setup/contract-service.star") +eth_relay_setup = import_module("./services/evm/eth/src/relay-setup/contract_configuration.star") +eth_node = import_module("./services/evm/eth/eth.star") +icon_relay_setup = import_module("./services/jvm/icon/src/relay-setup/contract_configuration.star") +icon_service = import_module("./services/jvm/icon/icon.star") +btp_bridge = import_module("./services/bridges/btp/src/bridge.star") +input_parser = import_module("./package_io/input_parser.star") +cosmvm_node = import_module("./services/cosmvm/cosmvm.star") +cosmvm_relay = import_module("./services/bridges/ibc/src/bridge.star") +cosmvm_relay_setup = import_module("./services/cosmvm/archway/src/relay-setup/contract-configuration.star") def run(plan, args): return parse_input(plan, args) diff --git a/services/bridges/ibc/src/bridge.star b/services/bridges/ibc/src/bridge.star index d40bf77a..2a4982e6 100644 --- a/services/bridges/ibc/src/bridge.star +++ b/services/bridges/ibc/src/bridge.star @@ -1,5 +1,5 @@ # Import required modules and constants -constants = import_module("github.com/hugobyte/dive/package_io/constants.star") +constants = import_module("../../../../package_io/constants.star") ibc_relay_config = constants.IBC_RELAYER_SERVICE def start_cosmos_relay(plan, src_key, src_chain_id, dst_key, dst_chain_id, src_config, dst_config, links): diff --git a/services/cosmvm/archway/archway.star b/services/cosmvm/archway/archway.star index 11cd3b0f..46122d87 100644 --- a/services/cosmvm/archway/archway.star +++ b/services/cosmvm/archway/archway.star @@ -1,5 +1,5 @@ -archway_node_service = import_module("github.com/hugobyte/dive/services/cosmvm/archway/src/node-setup/start_node.star") -constants = import_module("github.com/hugobyte/dive/package_io/constants.star") +archway_node_service = import_module("./src/node-setup/start_node.star") +constants = import_module("../../../package_io/constants.star") archway_node_0_constant_config = constants.ARCHAY_NODE0_CONFIG archway_node_1_constant_config = constants.ARCHAY_NODE1_CONFIG archway_service_config = constants.ARCHWAY_SERVICE_CONFIG diff --git a/services/cosmvm/archway/src/node-setup/start_node.star b/services/cosmvm/archway/src/node-setup/start_node.star index 36866a09..0cb09f67 100644 --- a/services/cosmvm/archway/src/node-setup/start_node.star +++ b/services/cosmvm/archway/src/node-setup/start_node.star @@ -1,4 +1,4 @@ -constants = import_module("github.com/hugobyte/dive/package_io/constants.star") +constants = import_module("../../../../../package_io/constants.star") cosmos_node_constants = constants.ARCHWAY_SERVICE_CONFIG network_port_keys_and_ip = constants.NETWORK_PORT_KEYS_AND_IP_ADDRESS diff --git a/services/cosmvm/archway/src/relay-setup/contract-configuration.star b/services/cosmvm/archway/src/relay-setup/contract-configuration.star index 14fab99e..4e2880c7 100644 --- a/services/cosmvm/archway/src/relay-setup/contract-configuration.star +++ b/services/cosmvm/archway/src/relay-setup/contract-configuration.star @@ -1,7 +1,6 @@ -cosmvm_deploy = import_module("github.com/hugobyte/dive/services/cosmvm/archway/src/node-setup/deploy.star") +cosmvm_deploy = import_module("../node-setup/deploy.star") PASSCODE="password" - -node_constants = import_module("github.com/hugobyte/dive/package_io/constants.star") +node_constants = import_module("../../../../../package_io/constants.star") password = node_constants.ARCHWAY_SERVICE_CONFIG.password def deploy_core(plan,service_name,chain_id,chain_key): diff --git a/services/cosmvm/cosmvm.star b/services/cosmvm/cosmvm.star index bac6b8d9..a28d3b13 100644 --- a/services/cosmvm/cosmvm.star +++ b/services/cosmvm/cosmvm.star @@ -1,7 +1,6 @@ -archway_node_service = import_module("github.com/hugobyte/dive/services/cosmvm/archway/archway.star") -neutron_node_service = import_module("github.com/hugobyte/dive/services/cosmvm/neutron/neutron.star") -parser = import_module("github.com/hugobyte/dive/package_io/input_parser.star") - +archway_node_service = import_module("./archway/archway.star") +neutron_node_service = import_module("./neutron/neutron.star") +parser = import_module("../../package_io/input_parser.star") def start_cosmvm_chains(plan,node_name,args): if node_name == "archway": diff --git a/services/cosmvm/neutron/neutron.star b/services/cosmvm/neutron/neutron.star index 8663c628..bfa43931 100644 --- a/services/cosmvm/neutron/neutron.star +++ b/services/cosmvm/neutron/neutron.star @@ -1,6 +1,6 @@ # Import required modules and constants -neutron_node_service = import_module("github.com/hugobyte/dive/services/cosmvm/neutron/src/node-setup/start_node.star") -constants = import_module("github.com/hugobyte/dive/package_io/constants.star") +neutron_node_service = import_module("./src/node-setup/start_node.star") +constants = import_module("../../../package_io/constants.star") neutron_private_ports = constants.NEUTRON_PRIVATE_PORTS neutron_node1_config = constants.NEUTRON_NODE1_CONFIG neutron_node2_config = constants.NEUTRON_NODE2_CONFIG diff --git a/services/cosmvm/neutron/src/node-setup/start_node.star b/services/cosmvm/neutron/src/node-setup/start_node.star index adb65f62..a87e4a17 100644 --- a/services/cosmvm/neutron/src/node-setup/start_node.star +++ b/services/cosmvm/neutron/src/node-setup/start_node.star @@ -1,5 +1,5 @@ # Import constants from an external module -constants = import_module("github.com/hugobyte/dive/package_io/constants.star") +constants = import_module("../../../../../package_io/constants.star") neutron_node_constants = constants.NEUTRON_SERVICE_CONFIG network_port_keys_and_ip = constants.NETWORK_PORT_KEYS_AND_IP_ADDRESS diff --git a/services/evm/eth/eth.star b/services/evm/eth/eth.star index 8b65c3af..a6887b19 100644 --- a/services/evm/eth/eth.star +++ b/services/evm/eth/eth.star @@ -1,5 +1,5 @@ -eth_node = import_module("github.com/hugobyte/dive/services/evm/eth/src/node-setup/start-eth-node.star") -eth_relay_setup = import_module("github.com/hugobyte/dive/services/evm/eth/src/relay-setup/contract_configuration.star") +eth_node = import_module("./src/node-setup/start-eth-node.star") +eth_relay_setup = import_module("./src/relay-setup/contract_configuration.star") def start_eth_node_serivce(plan,args,node_type): diff --git a/services/evm/eth/src/node-setup/contract-deployer.star b/services/evm/eth/src/node-setup/contract-deployer.star index fbd839fb..1ce6e1ca 100644 --- a/services/evm/eth/src/node-setup/contract-deployer.star +++ b/services/evm/eth/src/node-setup/contract-deployer.star @@ -1,4 +1,4 @@ -constants = import_module("github.com/hugobyte/dive/package_io/constants.star") +constants = import_module("../../../../../package_io/constants.star") # Deploy Contract to Eth Network def deploy_contract(plan,contract_name,params,network_name): diff --git a/services/evm/eth/src/node-setup/contract-service.star b/services/evm/eth/src/node-setup/contract-service.star index 6a793b49..8bcc4e3c 100644 --- a/services/evm/eth/src/node-setup/contract-service.star +++ b/services/evm/eth/src/node-setup/contract-service.star @@ -1,5 +1,4 @@ -constants = import_module("github.com/hugobyte/dive/package_io/constants.star") - +constants = import_module("../../../../../package_io/constants.star") # Starts the eth deploy service def start_deploy_service(plan,args): diff --git a/services/evm/eth/src/relay-setup/contract_configuration.star b/services/evm/eth/src/relay-setup/contract_configuration.star index 1e79e07f..fbe0b48c 100644 --- a/services/evm/eth/src/relay-setup/contract_configuration.star +++ b/services/evm/eth/src/relay-setup/contract_configuration.star @@ -1,4 +1,4 @@ -eth_contract_deployer_service = import_module("github.com/hugobyte/dive/services/evm/eth/src/node-setup/contract-deployer.star") +eth_contract_deployer_service = import_module("../node-setup/contract-deployer.star") # Deploy Bmc contract on ETH and Returns it's address def deploy_bmc(plan,args,chain_name,service_name): diff --git a/services/jvm/icon/icon.star b/services/jvm/icon/icon.star index e23c7164..830c1585 100644 --- a/services/jvm/icon/icon.star +++ b/services/jvm/icon/icon.star @@ -1,7 +1,7 @@ -wallet = import_module("github.com/hugobyte/dive/services/jvm/icon/src/node-setup/wallet.star") -setup_node = import_module("github.com/hugobyte/dive/services/jvm/icon/src/node-setup/setup_icon_node.star") -icon_node_launcher = import_module("github.com/hugobyte/dive/services/jvm/icon/src/node-setup/start_icon_node.star") -icon_relay_setup = import_module("github.com/hugobyte/dive/services/jvm/icon/src/relay-setup/contract_configuration.star") +wallet = import_module("./src/node-setup/wallet.star") +setup_node = import_module("./src/node-setup/setup_icon_node.star") +icon_node_launcher = import_module("./src/node-setup/start_icon_node.star") +icon_relay_setup = import_module("./src/relay-setup/contract_configuration.star") START_FILE_FOR_ICON0 = "start-icon.sh" START_FILE_FOR_ICON1 = "start-icon.sh" diff --git a/services/jvm/icon/src/node-setup/setup_icon_node.star b/services/jvm/icon/src/node-setup/setup_icon_node.star index 3bee2df3..fe4eb601 100644 --- a/services/jvm/icon/src/node-setup/setup_icon_node.star +++ b/services/jvm/icon/src/node-setup/setup_icon_node.star @@ -1,4 +1,4 @@ -wallet_config = import_module("github.com/hugobyte/dive/services/jvm/icon/src/node-setup/wallet.star") +wallet_config = import_module("./wallet.star") BTP_VERSION = "21" # REV Version diff --git a/services/jvm/icon/src/node-setup/start_icon_node.star b/services/jvm/icon/src/node-setup/start_icon_node.star index 43bfaffc..e60bbf88 100644 --- a/services/jvm/icon/src/node-setup/start_icon_node.star +++ b/services/jvm/icon/src/node-setup/start_icon_node.star @@ -1,4 +1,4 @@ -constants = import_module("github.com/hugobyte/dive/package_io/constants.star") +constants = import_module("../../../../../package_io/constants.star") network_keys_and_public_address = constants.NETWORK_PORT_KEYS_AND_IP_ADDRESS # Starts The Icon Node diff --git a/services/jvm/icon/src/relay-setup/contract_configuration.star b/services/jvm/icon/src/relay-setup/contract_configuration.star index ebd1def7..aee5072d 100644 --- a/services/jvm/icon/src/relay-setup/contract_configuration.star +++ b/services/jvm/icon/src/relay-setup/contract_configuration.star @@ -1,5 +1,5 @@ -contract_deployment_service = import_module("github.com/hugobyte/dive/services/jvm/icon/src/node-setup/contract_deploy.star") -node_service = import_module("github.com/hugobyte/dive/services/jvm/icon/src/node-setup/setup_icon_node.star") +contract_deployment_service = import_module("../node-setup/contract_deploy.star") +node_service = import_module("../node-setup/setup_icon_node.star") # Deploys BMC contract on ICON def deploy_bmc(plan,args):