From 2b5c0075e85e2e311b2750c9076adf9c95ab3e00 Mon Sep 17 00:00:00 2001 From: Simon Dosch Date: Wed, 5 Jun 2024 19:00:04 +0200 Subject: [PATCH] use upgradeAndCall --- test/upgrade/DefaultEmissionManager.1.2.0.t.sol | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/upgrade/DefaultEmissionManager.1.2.0.t.sol b/test/upgrade/DefaultEmissionManager.1.2.0.t.sol index a8be54f..f8aa573 100644 --- a/test/upgrade/DefaultEmissionManager.1.2.0.t.sol +++ b/test/upgrade/DefaultEmissionManager.1.2.0.t.sol @@ -50,15 +50,16 @@ contract DefaultEmissionManagerTest is Test { vm.prank(POLYGON_PROTOCOL_COUNCIL); - admin.upgrade(ITransparentUpgradeableProxy(address(emProxy)), address(newEmImpl)); + admin.upgradeAndCall( + ITransparentUpgradeableProxy(address(emProxy)), + address(newEmImpl), + abi.encodeWithSelector(DefaultEmissionManager.reinitialize.selector) + ); // initialize can still not be called vm.expectRevert("Initializable: contract is already initialized"); emProxy.initialize(makeAddr("token"), msg.sender); - // reinitialize to reset startTimestamp and start supply - emProxy.reinitialize(); - assertEq(pol.totalSupply(), emProxy.START_SUPPLY_1_2_0()); assertEq(block.timestamp, emProxy.startTimestamp());