Skip to content

Commit

Permalink
♻️ (#1076) Renaming setP2PDisable -> setP2PDisabled
Browse files Browse the repository at this point in the history
Signed-off-by: MerlinEgalite <[email protected]>
  • Loading branch information
MerlinEgalite committed Jul 11, 2022
1 parent 125c654 commit b9b8c22
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion contracts/compound/MorphoGovernance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ abstract contract MorphoGovernance is MorphoUtils {
/// @notice Sets the peer-to-peer disable status.
/// @param _poolTokenAddress The address of the market to able/disable P2P.
/// @param _newStatus The new status to set.
function setP2PDisable(address _poolTokenAddress, bool _newStatus)
function setP2PDisabled(address _poolTokenAddress, bool _newStatus)
external
onlyOwner
isMarketCreated(_poolTokenAddress)
Expand Down
2 changes: 1 addition & 1 deletion contracts/compound/interfaces/IMorpho.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ interface IMorpho {
function setInterestRatesManager(IInterestRatesManager _interestRatesManager) external;
function setTreasuryVault(address _treasuryVault) external;
function setDustThreshold(uint256 _dustThreshold) external;
function setP2PDisable(address _poolTokenAddress, bool _p2pDisabled) external;
function setP2PDisabled(address _poolTokenAddress, bool _p2pDisabled) external;
function setReserveFactor(address _poolTokenAddress, uint256 _newReserveFactor) external;
function setP2PIndexCursor(address _poolTokenAddress, uint16 _p2pIndexCursor) external;
function setPauseStatusForAllMarkets(bool _newStatus) external;
Expand Down
6 changes: 3 additions & 3 deletions test-foundry/compound/TestGovernance.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ contract TestGovernance is TestSetup {

function testOnlyOwnerShouldFlipMarketStrategy() public {
hevm.expectRevert("Ownable: caller is not the owner");
supplier1.setP2PDisable(cDai, true);
supplier1.setP2PDisabled(cDai, true);

hevm.expectRevert("Ownable: caller is not the owner");
supplier2.setP2PDisable(cDai, true);
supplier2.setP2PDisabled(cDai, true);

morpho.setP2PDisable(cDai, true);
morpho.setP2PDisabled(cDai, true);
assertTrue(morpho.p2pDisabled(cDai));
}

Expand Down
8 changes: 4 additions & 4 deletions test-foundry/compound/TestMarketStrategy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contract TestMarketStrategy is TestSetup {
uint256 toBorrow = 500 ether;

// Flip strategy
morpho.setP2PDisable(cDai, true);
morpho.setP2PDisabled(cDai, true);

borrower1.approve(usdc, to6Decimals(amount));
borrower1.supply(cUsdc, to6Decimals(amount));
Expand Down Expand Up @@ -40,7 +40,7 @@ contract TestMarketStrategy is TestSetup {
uint256 toBorrow = 500 ether;

// Flip strategy
morpho.setP2PDisable(cDai, true);
morpho.setP2PDisabled(cDai, true);

supplier1.approve(dai, toBorrow);
supplier1.supply(cDai, toBorrow);
Expand Down Expand Up @@ -71,7 +71,7 @@ contract TestMarketStrategy is TestSetup {
uint256 toBorrow = 100 ether;

// Flip strategy
morpho.setP2PDisable(cDai, true);
morpho.setP2PDisabled(cDai, true);

for (uint256 i = 0; i < 3; i++) {
borrowers[i].approve(usdc, to6Decimals(amount));
Expand Down Expand Up @@ -106,7 +106,7 @@ contract TestMarketStrategy is TestSetup {
uint256 toSupply = 100 ether;

// Flip strategy
morpho.setP2PDisable(cDai, true);
morpho.setP2PDisabled(cDai, true);

for (uint256 i = 0; i < 3; i++) {
suppliers[i].approve(dai, toSupply);
Expand Down
4 changes: 2 additions & 2 deletions test-foundry/compound/TestP2PDisable.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract TestP2PDisable is TestSetup {
assertGt(p2pSupplyDelta, 0);

// Disable peer-to-peer.
morpho.setP2PDisable(cDai, true);
morpho.setP2PDisabled(cDai, true);

// Delta must be reduce to 0.
borrower1.borrow(cDai, borrowedAmount);
Expand Down Expand Up @@ -64,7 +64,7 @@ contract TestP2PDisable is TestSetup {
assertGt(p2pBorrowDelta, 0);

// Disable peer-to-peer.
morpho.setP2PDisable(cUsdc, true);
morpho.setP2PDisabled(cUsdc, true);

// Delta must be reduce to 0.
supplier1.supply(cUsdc, to6Decimals(supplyAmount * 2));
Expand Down
4 changes: 2 additions & 2 deletions test-foundry/compound/TestRatesLens.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ contract TestRatesLens is TestSetup {

hevm.roll(block.number + 1000);

morpho.setP2PDisable(cDai, true);
morpho.setP2PDisabled(cDai, true);

(
uint256 supplyRatePerBlock,
Expand Down Expand Up @@ -521,7 +521,7 @@ contract TestRatesLens is TestSetup {

hevm.roll(block.number + 1000);

morpho.setP2PDisable(cDai, true);
morpho.setP2PDisabled(cDai, true);

(
uint256 borrowRatePerBlock,
Expand Down
2 changes: 1 addition & 1 deletion test-foundry/compound/TestWithdraw.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ contract TestWithdraw is TestSetup {
borrower1.supply(cEth, 10 * amount);
borrower1.borrow(cDai, 10 * amount);

morpho.setP2PDisable(cDai, true);
morpho.setP2PDisabled(cDai, true);

supplier1.withdraw(cDai, amount);
supplier1.withdraw(cDai, amount);
Expand Down
4 changes: 2 additions & 2 deletions test-foundry/compound/helpers/User.sol
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ contract User {
return morpho.claimRewards(_assets, _toSwap);
}

function setP2PDisable(address _marketAddress, bool _newStatus) external {
morpho.setP2PDisable(_marketAddress, _newStatus);
function setP2PDisabled(address _marketAddress, bool _newStatus) external {
morpho.setP2PDisabled(_marketAddress, _newStatus);
}

function setTreasuryVault(address _newTreasuryVault) external {
Expand Down

0 comments on commit b9b8c22

Please sign in to comment.