From b9b8c229ac34e965f51b7491b86963adb7af7007 Mon Sep 17 00:00:00 2001 From: MerlinEgalite Date: Mon, 11 Jul 2022 16:20:51 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20(#1076)=20Renaming=20setP2?= =?UTF-8?q?PDisable=20->=20setP2PDisabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MerlinEgalite --- contracts/compound/MorphoGovernance.sol | 2 +- contracts/compound/interfaces/IMorpho.sol | 2 +- test-foundry/compound/TestGovernance.t.sol | 6 +++--- test-foundry/compound/TestMarketStrategy.t.sol | 8 ++++---- test-foundry/compound/TestP2PDisable.t.sol | 4 ++-- test-foundry/compound/TestRatesLens.t.sol | 4 ++-- test-foundry/compound/TestWithdraw.t.sol | 2 +- test-foundry/compound/helpers/User.sol | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/contracts/compound/MorphoGovernance.sol b/contracts/compound/MorphoGovernance.sol index a48d5ce4a..d3ce27c09 100644 --- a/contracts/compound/MorphoGovernance.sol +++ b/contracts/compound/MorphoGovernance.sol @@ -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) diff --git a/contracts/compound/interfaces/IMorpho.sol b/contracts/compound/interfaces/IMorpho.sol index da1cc5d6b..772465d31 100644 --- a/contracts/compound/interfaces/IMorpho.sol +++ b/contracts/compound/interfaces/IMorpho.sol @@ -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; diff --git a/test-foundry/compound/TestGovernance.t.sol b/test-foundry/compound/TestGovernance.t.sol index 82a3605b2..ea8e52b9f 100644 --- a/test-foundry/compound/TestGovernance.t.sol +++ b/test-foundry/compound/TestGovernance.t.sol @@ -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)); } diff --git a/test-foundry/compound/TestMarketStrategy.t.sol b/test-foundry/compound/TestMarketStrategy.t.sol index 1c34733c4..daaed6979 100644 --- a/test-foundry/compound/TestMarketStrategy.t.sol +++ b/test-foundry/compound/TestMarketStrategy.t.sol @@ -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)); @@ -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); @@ -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)); @@ -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); diff --git a/test-foundry/compound/TestP2PDisable.t.sol b/test-foundry/compound/TestP2PDisable.t.sol index 94ef40131..50792dfd3 100644 --- a/test-foundry/compound/TestP2PDisable.t.sol +++ b/test-foundry/compound/TestP2PDisable.t.sol @@ -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); @@ -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)); diff --git a/test-foundry/compound/TestRatesLens.t.sol b/test-foundry/compound/TestRatesLens.t.sol index 5f870df4a..a9c365198 100644 --- a/test-foundry/compound/TestRatesLens.t.sol +++ b/test-foundry/compound/TestRatesLens.t.sol @@ -482,7 +482,7 @@ contract TestRatesLens is TestSetup { hevm.roll(block.number + 1000); - morpho.setP2PDisable(cDai, true); + morpho.setP2PDisabled(cDai, true); ( uint256 supplyRatePerBlock, @@ -521,7 +521,7 @@ contract TestRatesLens is TestSetup { hevm.roll(block.number + 1000); - morpho.setP2PDisable(cDai, true); + morpho.setP2PDisabled(cDai, true); ( uint256 borrowRatePerBlock, diff --git a/test-foundry/compound/TestWithdraw.t.sol b/test-foundry/compound/TestWithdraw.t.sol index 3af42b5c9..58d020dee 100644 --- a/test-foundry/compound/TestWithdraw.t.sol +++ b/test-foundry/compound/TestWithdraw.t.sol @@ -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); diff --git a/test-foundry/compound/helpers/User.sol b/test-foundry/compound/helpers/User.sol index 953f409fd..3d1f723a1 100644 --- a/test-foundry/compound/helpers/User.sol +++ b/test-foundry/compound/helpers/User.sol @@ -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 {