From 5ebb1acfbb54fced92229ceaeed8e15e5a8e88fb Mon Sep 17 00:00:00 2001 From: derekpierre Date: Tue, 19 Sep 2023 16:52:57 -0400 Subject: [PATCH] Change get_constructor_params to instead by get_deployment_params and use contract container as first entry so that it isn't repeated in the deployment script. --- scripts/deploy_lynx.py | 12 ++++-------- scripts/deployment.py | 5 +++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/deploy_lynx.py b/scripts/deploy_lynx.py index 743335a9..dcc92329 100644 --- a/scripts/deploy_lynx.py +++ b/scripts/deploy_lynx.py @@ -37,14 +37,12 @@ def main(): config = DeploymentConfig.from_file(DEPLOYMENT_CONFIG_FILEPATH) LynxRootApplication = deployer.deploy( - project.LynxRootApplication, # TODO should the container be returned by call below? - *config.get_constructor_params(project.LynxRootApplication, locals()), + *config.get_deployment_params(project.LynxRootApplication, locals()), publish=PUBLISH, ) LynxTACoChildApplication = deployer.deploy( - project.LynxTACoChildApplication, - *config.get_constructor_params(project.LynxTACoChildApplication, locals()), + *config.get_deployment_params(project.LynxTACoChildApplication, locals()), publish=PUBLISH, ) @@ -55,15 +53,13 @@ def main(): ) LynxRitualToken = deployer.deploy( - project.LynxRitualToken, - *config.get_constructor_params(project.LynxRitualToken, locals()), + *config.get_deployment_params(project.LynxRitualToken, locals()), publish=PUBLISH, ) # Lynx Coordinator Coordinator = deployer.deploy( - project.Coordinator, - *config.get_constructor_params(project.Coordinator, locals()), + *config.get_deployment_params(project.Coordinator, locals()), publish=PUBLISH, ) diff --git a/scripts/deployment.py b/scripts/deployment.py index 272a0ad8..f1c9e940 100644 --- a/scripts/deployment.py +++ b/scripts/deployment.py @@ -84,7 +84,7 @@ def from_file(cls, config_filepath: Path) -> "DeploymentConfig": config = OrderedDict(json.load(config_file)) return cls(config) - def get_constructor_params( + def get_deployment_params( self, container: ContractContainer, context: typing.Dict[str, Any], interactive: bool = True ) -> List[Any]: contract_name = container.contract_type.name @@ -95,4 +95,5 @@ def get_constructor_params( ) if interactive: _confirm_resolution(resolved_params, contract_name) - return list(resolved_params.values()) + + return [container, *resolved_params.values()]