From 2b9f8126c65a27a7ca4f89c4f6c62b8e39d69b0b Mon Sep 17 00:00:00 2001 From: Victoria Zotova Date: Wed, 4 Sep 2024 13:20:05 -0400 Subject: [PATCH 1/2] Upgrade tapir Coordinator --- deployment/artifacts/tapir.json | 9 ++++++++- scripts/tapir/upgrade_coordinator.py | 9 +++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/deployment/artifacts/tapir.json b/deployment/artifacts/tapir.json index a61fa5de..340150e5 100644 --- a/deployment/artifacts/tapir.json +++ b/deployment/artifacts/tapir.json @@ -4350,6 +4350,13 @@ ], "outputs": [] }, + { + "type": "function", + "name": "initializeNumberOfRituals", + "stateMutability": "nonpayable", + "inputs": [], + "outputs": [] + }, { "type": "function", "name": "initiateRitual", @@ -4655,7 +4662,7 @@ "stateMutability": "view", "inputs": [ { - "name": "", + "name": "ritualId", "type": "uint256", "internalType": "uint256" } diff --git a/scripts/tapir/upgrade_coordinator.py b/scripts/tapir/upgrade_coordinator.py index cca6f80d..2315936c 100644 --- a/scripts/tapir/upgrade_coordinator.py +++ b/scripts/tapir/upgrade_coordinator.py @@ -19,8 +19,13 @@ def main(): deployer = Deployer.from_yaml(filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY) instances = contracts_from_registry(filepath=ARTIFACTS_DIR / "tapir.json", chain_id=80002) - coordinator = deployer.upgrade( - project.Coordinator, instances[project.Coordinator.contract_type.name].address + 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, ) deployments = [ From b619df8e762bea836c04a716bad7149e34f326a4 Mon Sep 17 00:00:00 2001 From: Viktoriia Date: Thu, 5 Sep 2024 16:03:38 +0200 Subject: [PATCH 2/2] Update scripts/tapir/upgrade_coordinator.py Co-authored-by: Derek Pierre --- scripts/tapir/upgrade_coordinator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/tapir/upgrade_coordinator.py b/scripts/tapir/upgrade_coordinator.py index 2315936c..1a7f094c 100644 --- a/scripts/tapir/upgrade_coordinator.py +++ b/scripts/tapir/upgrade_coordinator.py @@ -20,7 +20,8 @@ def main(): instances = contracts_from_registry(filepath=ARTIFACTS_DIR / "tapir.json", chain_id=80002) implementation = deployer.deploy(project.Coordinator) - encoded_initializer_function = implementation.initializeNumberOfRituals.encode_input() + # latest reinitializer function used for most recent upgrade - reinitializer(2) + # encoded_initializer_function = implementation.initializeNumberOfRituals.encode_input() encoded_initializer_function = b"" coordinator = deployer.upgradeTo( implementation,