Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(test): update test layout #15

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion contracts/core/aggregator/AaveYieldAggregator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}

modifier onlyFactory() {
require(msg.sender == MEST_FACTORY, "Only factory");

Check warning on line 41 in contracts/core/aggregator/AaveYieldAggregator.sol

View workflow job for this annotation

GitHub Actions / lint (18)

GC: Use Custom Errors instead of require statements
_;
}

Expand All @@ -59,7 +59,7 @@
* Only callable by the factory contract.
*/
function yieldDeposit() external onlyFactory {
require(_checkAavePoolState(), "Aave paused");

Check warning on line 62 in contracts/core/aggregator/AaveYieldAggregator.sol

View workflow job for this annotation

GitHub Actions / lint (18)

GC: Use Custom Errors instead of require statements
uint256 ethAmount = address(this).balance;
if (ethAmount > 0) {
AAVE_WETH_GATEWAY.depositETH{ value: ethAmount }(address(AAVE_POOL), MEST_FACTORY, 0);
Expand All @@ -71,7 +71,7 @@
* Only callable by the factory contract.
*/
function yieldWithdraw(uint256 amount) external onlyFactory {
require(_checkAavePoolState(), "Aave paused");

Check warning on line 74 in contracts/core/aggregator/AaveYieldAggregator.sol

View workflow job for this annotation

GitHub Actions / lint (18)

GC: Use Custom Errors instead of require statements
if (amount > 0) {
aWETH.safeTransferFrom(MEST_FACTORY, address(this), amount);
AAVE_WETH_GATEWAY.withdrawETH(address(AAVE_POOL), amount, MEST_FACTORY);
Expand Down Expand Up @@ -100,7 +100,8 @@
/**
* @notice Check Aave pool state
* @return bool true if Aave pool is active, false otherwise
* @dev For more information, see: https://github.com/aave/aave-v3-core/blob/master/contracts/protocol/libraries/configuration/ReserveConfiguration.sol
* @dev For more information, see:
* https://github.com/aave/aave-v3-core/blob/master/contracts/protocol/libraries/configuration/ReserveConfiguration.sol
*/
function _checkAavePoolState() internal view returns (bool) {
uint256 configData = AAVE_POOL.getReserveData(WETH).configuration.data;
Expand Down
4 changes: 2 additions & 2 deletions test/TestContext.t.sol → test/BaseTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { MestERC1155 } from "contracts/core/MestERC1155.sol";
import { IAavePool } from "contracts/interface/IAave.sol";

contract TestContext is Test {
contract BaseTest is Test {
MestSharesFactoryV1 public sharesFactory;
MestERC1155 public sharesNFT;

Expand Down Expand Up @@ -48,7 +48,7 @@ contract TestContext is Test {
sharesNFT = new MestERC1155(BASE_URI);

sharesFactory = new MestSharesFactoryV1(
address(sharesNFT), BASE_PRICE, INFLECTION_POINT, INFLECTION_PRICE, LINEAR_PRICE_SLOPE, true
address(sharesNFT), BASE_PRICE, INFLECTION_POINT, INFLECTION_PRICE, LINEAR_PRICE_SLOPE
);

aaveYieldAggregator = new AaveYieldAggregator(address(sharesFactory), WETH, AAVE_POOL, AAVE_WETH_GATEWAY);
Expand Down
125 changes: 0 additions & 125 deletions test/TestPlus.sol

This file was deleted.

97 changes: 0 additions & 97 deletions test/core/YieldAggregator.t.sol

This file was deleted.

Loading
Loading