Skip to content

Commit

Permalink
Divides pre-deployment plugin and registry checks
Browse files Browse the repository at this point in the history
  • Loading branch information
KPrasch committed Sep 27, 2023
1 parent 92541a7 commit 2856a3b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
8 changes: 6 additions & 2 deletions deployment/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 4 additions & 7 deletions scripts/lynx/deploy_child.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down
11 changes: 4 additions & 7 deletions scripts/lynx/deploy_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down

0 comments on commit 2856a3b

Please sign in to comment.