From e6d8631099e9dbc533e7a82261804cf5daf2f2e7 Mon Sep 17 00:00:00 2001 From: rymnc <43716372+rymnc@users.noreply.github.com> Date: Thu, 30 May 2024 13:56:09 +0530 Subject: [PATCH] fix: remove upgrade from Deploy.s.sol --- script/Deploy.s.sol | 7 ------- test/WakuRlnV2.t.sol | 8 +++----- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index e54315b..3c1f37f 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -17,13 +17,6 @@ contract Deploy is BaseScript { address proxy = address(new ERC1967Proxy(impl, data)); w = WakuRlnV2(proxy); } - - function upgrade(address proxy, address newImpl) public { - vm.startBroadcast(msg.sender); - bytes memory data; - UUPSUpgradeable(proxy).upgradeToAndCall(newImpl, data); - vm.stopBroadcast(); - } } contract DeployLibs is BaseScript { diff --git a/test/WakuRlnV2.t.sol b/test/WakuRlnV2.t.sol index af93a1a..bb67431 100644 --- a/test/WakuRlnV2.t.sol +++ b/test/WakuRlnV2.t.sol @@ -2,15 +2,13 @@ pragma solidity >=0.8.19 <0.9.0; import { Test } from "forge-std/Test.sol"; -import { stdStorage, StdStorage } from "forge-std/Test.sol"; import { Deploy } from "../script/Deploy.s.sol"; import { DeploymentConfig } from "../script/DeploymentConfig.s.sol"; import "../src/WakuRlnV2.sol"; // solhint-disable-line import { PoseidonT3 } from "poseidon-solidity/PoseidonT3.sol"; +import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; contract WakuRlnV2Test is Test { - using stdStorage for StdStorage; - WakuRlnV2 internal w; address internal impl; DeploymentConfig internal deploymentConfig; @@ -192,8 +190,8 @@ contract WakuRlnV2Test is Test { function test__Upgrade() external { address newImplementation = address(new WakuRlnV2()); - Deploy deployment = new Deploy(); - deployment.upgrade(address(w), newImplementation); + bytes memory data; + UUPSUpgradeable(address(w)).upgradeToAndCall(newImplementation, data); // ensure that the implementation is set correctly // ref: // solhint-disable-next-line