Skip to content

Commit

Permalink
✨ (upgrade-rewards-manager) Update and add upgrade tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MerlinEgalite authored and MathisGD committed Jun 7, 2022
1 parent cab22e7 commit dc0e500
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test-foundry/compound/TestUpgradeable.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ contract TestUpgradeable is TestSetup {
supplier1.supply(cDai, amount);

Morpho morphoImplV2 = new Morpho();

hevm.record();
proxyAdmin.upgrade(morphoProxy, address(morphoImplV2));
(, bytes32[] memory writes) = hevm.accesses(address(morpho));

// 1 write for the implemention.
assertEq(writes.length, 1);
Expand Down Expand Up @@ -42,7 +45,6 @@ contract TestUpgradeable is TestSetup {
hevm.expectRevert("Ownable: caller is not the owner");
proxyAdmin.upgradeAndCall(morphoProxy, payable(address(morphoImplV2)), "");

// Revert for wrong data not wrong caller
proxyAdmin.upgradeAndCall(morphoProxy, payable(address(morphoImplV2)), "");
}

Expand Down Expand Up @@ -91,7 +93,7 @@ contract TestUpgradeable is TestSetup {
}

function testRewardsManagerImplementationsShouldBeInitialized() public {
// Test for Morpho Implementation.
// Test for RewardsManager Implementation.
hevm.expectRevert("Initializable: contract is already initialized");
rewardsManagerImplV1.initialize(address(morpho));
}
Expand Down

0 comments on commit dc0e500

Please sign in to comment.