Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
Co-authored-by: David Núñez <david@nucypher.com>
  • Loading branch information
3 people committed Aug 23, 2024
1 parent b785a75 commit e751891
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions deployment/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,8 @@ def _deploy_proxy(

def upgrade(self, container: ContractContainer, proxy_address, data=b"") -> ContractInstance:
implementation = self.deploy(container)
# TODO: initialize taco app implementation too
return self.upgradeTo(implementation, proxy_address, data)
# upgrade proxy to implementation
return self.upgradeProxyTo(implementation, proxy_address, data)

def upgradeTo(
self, implementation: ContractInstance, proxy_address, data=b""
Expand Down
17 changes: 11 additions & 6 deletions scripts/lynx/upgrade_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ def main():
deployer = Deployer.from_yaml(filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY)
instances = contracts_from_registry(filepath=ARTIFACTS_DIR / "lynx.json", chain_id=80002)

implementation = deployer.deploy(project.Coordinator)
# `initializeNumberOfRituals` was used for the original upgrade, but should NOT be
# used for subsequent upgrades of Coordinator
# implementation = deployer.deploy(project.Coordinator)
# encoded_initializer_function = implementation.initializeNumberOfRituals.encode_input()
encoded_initializer_function = b""
coordinator = deployer.upgradeTo(
implementation,
instances[project.Coordinator.contract_type.name].address,
encoded_initializer_function,
# encoded_initializer_function = b""
# coordinator = deployer.upgradeTo(
# implementation,
# instances[project.Coordinator.contract_type.name].address,
# encoded_initializer_function,
# )
coordinator = deployer.upgrade(
project.Coordinator, instances[project.Coordinator.contract_type.name].address
)

deployments = [
Expand Down

0 comments on commit e751891

Please sign in to comment.