diff --git a/src/test/Vault.t.sol b/src/test/Vault.t.sol index f9fe8c2..7082610 100644 --- a/src/test/Vault.t.sol +++ b/src/test/Vault.t.sol @@ -21,6 +21,7 @@ contract VaultsTest is DSTestPlus { function setUp() public { underlying = new MockERC20("Mock Token", "TKN", 18); + vault = new VaultFactory().deployVault(underlying); vault.setFeePercent(0.1e18); @@ -35,7 +36,7 @@ contract VaultsTest is DSTestPlus { } /*/////////////////////////////////////////////////////////////// - BASIC DEPOSIT/WITHDRAWAL TESTS + DEPOSIT/WITHDRAWAL TESTS //////////////////////////////////////////////////////////////*/ function testAtomicDepositWithdraw() public { @@ -146,7 +147,7 @@ contract VaultsTest is DSTestPlus { } /*/////////////////////////////////////////////////////////////// - BASIC STRATEGY DEPOSIT/WITHDRAWAL TESTS + STRATEGY DEPOSIT/WITHDRAWAL TESTS //////////////////////////////////////////////////////////////*/ function testAtomicEnterExitSinglePool() public { @@ -294,7 +295,7 @@ contract VaultsTest is DSTestPlus { } /*/////////////////////////////////////////////////////////////// - BASIC HARVEST TESTS + HARVEST TESTS //////////////////////////////////////////////////////////////*/ function testProfitableHarvest() public { diff --git a/src/test/VaultFactory.t.sol b/src/test/VaultFactory.t.sol index e32eb7f..9d151c3 100644 --- a/src/test/VaultFactory.t.sol +++ b/src/test/VaultFactory.t.sol @@ -13,8 +13,9 @@ contract VaultFactoryTest is DSTestPlus { MockERC20 underlying; function setUp() public { - vaultFactory = new VaultFactory(); underlying = new MockERC20("Mock Token", "TKN", 18); + + vaultFactory = new VaultFactory(); } function testDeployVault() public { diff --git a/src/test/mocks/MockETHStrategy.sol b/src/test/mocks/MockETHStrategy.sol index 0edb32b..a29b34c 100644 --- a/src/test/mocks/MockETHStrategy.sol +++ b/src/test/mocks/MockETHStrategy.sol @@ -12,7 +12,7 @@ contract MockETHStrategy is ERC20("Mock cEther Strategy", "cEther", 18), ETHStra using FixedPointMathLib for uint256; /*/////////////////////////////////////////////////////////////// - STRATEGY FUNCTIONS + STRATEGY LOGIC //////////////////////////////////////////////////////////////*/ function isCEther() external pure override returns (bool) { @@ -36,7 +36,7 @@ contract MockETHStrategy is ERC20("Mock cEther Strategy", "cEther", 18), ETHStra } /*/////////////////////////////////////////////////////////////// - INTERNAL LOGIC + INTERNAL LOGIC //////////////////////////////////////////////////////////////*/ function exchangeRate() internal view returns (uint256) { @@ -48,7 +48,7 @@ contract MockETHStrategy is ERC20("Mock cEther Strategy", "cEther", 18), ETHStra } /*/////////////////////////////////////////////////////////////// - MOCK FUNCTIONS + MOCK LOGIC //////////////////////////////////////////////////////////////*/ function simulateLoss(uint256 underlyingAmount) external { diff --git a/src/test/mocks/MockStrategy.sol b/src/test/mocks/MockStrategy.sol index df91e1b..936d143 100644 --- a/src/test/mocks/MockStrategy.sol +++ b/src/test/mocks/MockStrategy.sol @@ -11,16 +11,16 @@ contract MockStrategy is ERC20("Mock cToken Strategy", "cMOCK", 18), ERC20Strate using SafeTransferLib for ERC20; using FixedPointMathLib for uint256; - /*/////////////////////////////////////////////////////////////// - STRATEGY FUNCTIONS - //////////////////////////////////////////////////////////////*/ - constructor(ERC20 _UNDERLYING) { UNDERLYING = _UNDERLYING; BASE_UNIT = 10**_UNDERLYING.decimals(); } + /*/////////////////////////////////////////////////////////////// + STRATEGY LOGIC + //////////////////////////////////////////////////////////////*/ + function isCEther() external pure override returns (bool) { return false; } @@ -50,7 +50,7 @@ contract MockStrategy is ERC20("Mock cToken Strategy", "cMOCK", 18), ERC20Strate } /*/////////////////////////////////////////////////////////////// - INTERNAL LOGIC + INTERNAL LOGIC //////////////////////////////////////////////////////////////*/ ERC20 internal immutable UNDERLYING; @@ -66,7 +66,7 @@ contract MockStrategy is ERC20("Mock cToken Strategy", "cMOCK", 18), ERC20Strate } /*/////////////////////////////////////////////////////////////// - MOCK FUNCTIONS + MOCK LOGIC //////////////////////////////////////////////////////////////*/ function simulateLoss(uint256 underlyingAmount) external {