Skip to content

Commit

Permalink
Change get_constructor_params to instead by get_deployment_params and…
Browse files Browse the repository at this point in the history
… use contract container as first entry so that it isn't repeated in the deployment script.
  • Loading branch information
derekpierre committed Sep 19, 2023
1 parent 9eab251 commit 5ebb1ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
12 changes: 4 additions & 8 deletions scripts/deploy_lynx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand All @@ -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,
)

Expand Down
5 changes: 3 additions & 2 deletions scripts/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()]

0 comments on commit 5ebb1ac

Please sign in to comment.