Skip to content

Commit

Permalink
use upgradeAndCall
Browse files Browse the repository at this point in the history
  • Loading branch information
simonDos committed Jun 5, 2024
1 parent f01ef80 commit 2b5c007
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/upgrade/DefaultEmissionManager.1.2.0.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit 2b5c007

Please sign in to comment.