From 328191a34a633d4d46eb893bd9ccfe2e966e3cb2 Mon Sep 17 00:00:00 2001 From: Uxio Fuentefria <6909403+Uxio0@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:30:26 +0100 Subject: [PATCH] Fix L2 migration --- src/safe_cli/operators/safe_operator.py | 5 +++-- tests/test_safe_operator.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/safe_cli/operators/safe_operator.py b/src/safe_cli/operators/safe_operator.py index 5765a1e..f7beb5e 100644 --- a/src/safe_cli/operators/safe_operator.py +++ b/src/safe_cli/operators/safe_operator.py @@ -726,9 +726,10 @@ def update_version_to_l2( fallback_handler = safe_deployments["1.3.0"][ "CompatibilityFallbackHandler" ][str(chain_id)] + # Assuming first element of the array is the `canonical` address data = HexBytes( l2_migration_contract.functions.migrateFromV111( - safe_l2_singleton, fallback_handler + safe_l2_singleton[0], fallback_handler[0] ).build_transaction(get_empty_tx_params())["data"] ) elif safe_version in ("1.3.0", "1.4.1"): @@ -738,7 +739,7 @@ def update_version_to_l2( fallback_handler = self.safe_cli_info.fallback_handler data = HexBytes( l2_migration_contract.functions.migrateToL2( - safe_l2_singleton + safe_l2_singleton[0] ).build_transaction(get_empty_tx_params())["data"] ) else: diff --git a/tests/test_safe_operator.py b/tests/test_safe_operator.py index 71c47be..b68070b 100644 --- a/tests/test_safe_operator.py +++ b/tests/test_safe_operator.py @@ -371,9 +371,9 @@ def test_update_to_l2_v111(self): "safe_cli.operators.safe_operator.safe_deployments", { "1.3.0": { - "GnosisSafeL2": {"1337": self.safe_contract_V1_3_0.address}, + "GnosisSafeL2": {"1337": [self.safe_contract_V1_3_0.address]}, "CompatibilityFallbackHandler": { - "1337": self.compatibility_fallback_handler.address + "1337": [self.compatibility_fallback_handler.address] }, } }, @@ -404,7 +404,7 @@ def test_update_to_l2_v130(self): "safe_cli.operators.safe_operator.safe_deployments", { "1.3.0": { - "GnosisSafeL2": {"1337": safe_contract_l2_130_address}, + "GnosisSafeL2": {"1337": [safe_contract_l2_130_address]}, } }, ):