From 2856a3bae99b480e7284263196eec4fd7b460694 Mon Sep 17 00:00:00 2001 From: Kieran Prasch Date: Wed, 27 Sep 2023 14:51:59 +0200 Subject: [PATCH] Divides pre-deployment plugin and registry checks --- deployment/utils.py | 8 ++++++-- scripts/lynx/deploy_child.py | 11 ++++------- scripts/lynx/deploy_root.py | 11 ++++------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/deployment/utils.py b/deployment/utils.py index 6f1c6225..5696e05e 100644 --- a/deployment/utils.py +++ b/deployment/utils.py @@ -74,7 +74,11 @@ def verify_contracts(contracts: List[ContractInstance]) -> None: explorer.publish_contract(instance.address) -def prepare_deployment(registry_filepath: Path) -> None: - check_registry_filepath(registry_filepath=registry_filepath) +def check_plugins() -> None: check_etherscan_plugin() check_infura_plugin() + + +def check_deployment_ready(registry_filepath: Path) -> None: + check_plugins() + check_registry_filepath(registry_filepath=registry_filepath) diff --git a/scripts/lynx/deploy_child.py b/scripts/lynx/deploy_child.py index 7bb81743..afc29aa8 100644 --- a/scripts/lynx/deploy_child.py +++ b/scripts/lynx/deploy_child.py @@ -9,8 +9,9 @@ LOCAL_BLOCKCHAIN_ENVIRONMENTS, OZ_DEPENDENCY, ) +from deployment.params import Deployer from deployment.registry import registry_from_ape_deployments -from deployment.utils import prepare_deployment, verify_contracts +from deployment.utils import verify_contracts, check_deployment_ready VERIFY = CURRENT_NETWORK not in LOCAL_BLOCKCHAIN_ENVIRONMENTS CONSTRUCTOR_PARAMS_FILEPATH = CONSTRUCTOR_PARAMS_DIR / "lynx" / "lynx-alpha-13-child-params.json" @@ -31,12 +32,8 @@ def main(): eth-ape 0.6.20 """ - prepare_deployment(registry_filepath=REGISTRY_FILEPATH) - deployer = Deployer( - account=get_user_selected_account(), - params_path=CONSTRUCTOR_PARAMS_FILEPATH, - publish=VERIFY, - ) + check_deployment_ready(registry_filepath=REGISTRY_FILEPATH) + deployer = Deployer(params_path=CONSTRUCTOR_PARAMS_FILEPATH, publish=VERIFY) mock_polygon_child = deployer.deploy(project.MockPolygonChild) proxy_admin = deployer.deploy(OZ_DEPENDENCY.ProxyAdmin) diff --git a/scripts/lynx/deploy_root.py b/scripts/lynx/deploy_root.py index 56fed947..fcd4c2ad 100644 --- a/scripts/lynx/deploy_root.py +++ b/scripts/lynx/deploy_root.py @@ -9,8 +9,9 @@ LOCAL_BLOCKCHAIN_ENVIRONMENTS, OZ_DEPENDENCY, ) +from deployment.params import Deployer from deployment.registry import registry_from_ape_deployments -from deployment.utils import prepare_deployment, verify_contracts +from deployment.utils import verify_contracts, check_deployment_ready VERIFY = CURRENT_NETWORK not in LOCAL_BLOCKCHAIN_ENVIRONMENTS CONSTRUCTOR_PARAMS_FILEPATH = CONSTRUCTOR_PARAMS_DIR / "lynx" / "lynx-alpha-13-root-params.json" @@ -30,12 +31,8 @@ def main(): eth-ape 0.6.20 """ - prepare_deployment(registry_filepath=REGISTRY_FILEPATH) - deployer = Deployer( - account=get_user_selected_account(), - params_path=CONSTRUCTOR_PARAMS_FILEPATH, - publish=VERIFY, - ) + check_deployment_ready(registry_filepath=REGISTRY_FILEPATH) + deployer = Deployer(params_path=CONSTRUCTOR_PARAMS_FILEPATH, publish=VERIFY) reward_token = deployer.deploy(project.LynxStakingToken) mock_threshold_staking = deployer.deploy(project.TestnetThresholdStaking)