From 3a79539886b22cd388a4dcc6417dd19001ffe754 Mon Sep 17 00:00:00 2001 From: MoonBoi9001 <67825802+MoonBoi9001@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:37:38 +0100 Subject: [PATCH] fix: restore migrate function to require from if revert. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tomás Migone --- .../subgraph-service/contracts/libraries/LegacyAllocation.sol | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/subgraph-service/contracts/libraries/LegacyAllocation.sol b/packages/subgraph-service/contracts/libraries/LegacyAllocation.sol index 6ce99f22c..c885058a1 100644 --- a/packages/subgraph-service/contracts/libraries/LegacyAllocation.sol +++ b/packages/subgraph-service/contracts/libraries/LegacyAllocation.sol @@ -52,9 +52,7 @@ library LegacyAllocation { address allocationId, bytes32 subgraphDeploymentId ) internal { - if (self[allocationId].exists()) { - revert LegacyAllocationAlreadyMigrated(allocationId); - } + require(!self[allocationId].exists(), LegacyAllocationAlreadyMigrated(allocationId); State memory allocation = State({ indexer: indexer, subgraphDeploymentId: subgraphDeploymentId }); self[allocationId] = allocation;