Skip to content

Commit

Permalink
test: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Grimal committed Apr 9, 2024
1 parent 22bebcc commit 14c4d58
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion test/MorphoChainlinkOracleV2FactoryTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "../src/morpho-chainlink/MorphoChainlinkOracleV2Factory.sol";
import {ChainlinkDataFeedLib} from "../src/morpho-chainlink/libraries/ChainlinkDataFeedLib.sol";

contract ChainlinkOracleFactoryTest is Test {
using ChainlinkDataFeedLib for AggregatorV3Interface;
using ChainlinkDataFeedLib for MinimalAggregatorV3Interface;

MorphoChainlinkOracleV2Factory factory;

Expand Down
2 changes: 1 addition & 1 deletion test/MorphoChainlinkOracleV2Test.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ contract MorphoChainlinkOracleV2Test is Test {
price = bound(price, type(int256).min, -1);
ChainlinkAggregatorMock aggregator = new ChainlinkAggregatorMock();
MorphoChainlinkOracleV2 oracle = new MorphoChainlinkOracleV2(
vaultZero, 1, AggregatorV3Interface(address(aggregator)), feedZero, 18, vaultZero, 1, feedZero, feedZero, 0
vaultZero, 1, MinimalAggregatorV3Interface(address(aggregator)), feedZero, 18, vaultZero, 1, feedZero, feedZero, 0
);
aggregator.setAnwser(price);
vm.expectRevert(bytes(ErrorsLib.NEGATIVE_ANSWER));
Expand Down
2 changes: 1 addition & 1 deletion test/WstEthStEthExchangeRateChainlinkAdapterTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract WstEthStEthExchangeRateChainlinkAdapterTest is Test {
require(block.chainid == 1, "chain isn't Ethereum");
adapter = new WstEthStEthExchangeRateChainlinkAdapter();
morphoOracle = new MorphoChainlinkOracleV2(
vaultZero, 1, AggregatorV3Interface(address(adapter)), feedZero, 18, vaultZero, 1, feedZero, feedZero, 18
vaultZero, 1, MinimalAggregatorV3Interface(address(adapter)), feedZero, 18, vaultZero, 1, feedZero, feedZero, 18
);
}

Expand Down
20 changes: 10 additions & 10 deletions test/helpers/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
pragma solidity ^0.8.0;

import {IERC4626} from "../../src/morpho-chainlink/interfaces/IERC4626.sol";
import {AggregatorV3Interface} from "../../src/morpho-chainlink/interfaces/AggregatorV3Interface.sol";
import {MinimalAggregatorV3Interface} from "../../src/interfaces/MinimalAggregatorV3Interface.sol";

AggregatorV3Interface constant feedZero = AggregatorV3Interface(address(0));
MinimalAggregatorV3Interface constant feedZero = MinimalAggregatorV3Interface(address(0));
// 8 decimals of precision
AggregatorV3Interface constant btcUsdFeed = AggregatorV3Interface(0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c);
MinimalAggregatorV3Interface constant btcUsdFeed = MinimalAggregatorV3Interface(0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c);
// 8 decimals of precision
AggregatorV3Interface constant usdcUsdFeed = AggregatorV3Interface(0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6);
MinimalAggregatorV3Interface constant usdcUsdFeed = MinimalAggregatorV3Interface(0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6);
// 18 decimals of precision
AggregatorV3Interface constant btcEthFeed = AggregatorV3Interface(0xdeb288F737066589598e9214E782fa5A8eD689e8);
MinimalAggregatorV3Interface constant btcEthFeed = MinimalAggregatorV3Interface(0xdeb288F737066589598e9214E782fa5A8eD689e8);
// 8 decimals of precision
AggregatorV3Interface constant wBtcBtcFeed = AggregatorV3Interface(0xfdFD9C85aD200c506Cf9e21F1FD8dd01932FBB23);
MinimalAggregatorV3Interface constant wBtcBtcFeed = MinimalAggregatorV3Interface(0xfdFD9C85aD200c506Cf9e21F1FD8dd01932FBB23);
// 18 decimals of precision
AggregatorV3Interface constant stEthEthFeed = AggregatorV3Interface(0x86392dC19c0b719886221c78AB11eb8Cf5c52812);
MinimalAggregatorV3Interface constant stEthEthFeed = MinimalAggregatorV3Interface(0x86392dC19c0b719886221c78AB11eb8Cf5c52812);
// 18 decimals of precision
AggregatorV3Interface constant usdcEthFeed = AggregatorV3Interface(0x986b5E1e1755e3C2440e960477f25201B0a8bbD4);
MinimalAggregatorV3Interface constant usdcEthFeed = MinimalAggregatorV3Interface(0x986b5E1e1755e3C2440e960477f25201B0a8bbD4);
// 8 decimals of precision
AggregatorV3Interface constant ethUsdFeed = AggregatorV3Interface(0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419);
MinimalAggregatorV3Interface constant ethUsdFeed = MinimalAggregatorV3Interface(0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419);
// 18 decimals of precision
AggregatorV3Interface constant daiEthFeed = AggregatorV3Interface(0x773616E4d11A78F511299002da57A0a94577F1f4);
MinimalAggregatorV3Interface constant daiEthFeed = MinimalAggregatorV3Interface(0x773616E4d11A78F511299002da57A0a94577F1f4);

IERC4626 constant vaultZero = IERC4626(address(0));
IERC4626 constant sDaiVault = IERC4626(0x83F20F44975D03b1b09e64809B757c47f942BEeA);
Expand Down

0 comments on commit 14c4d58

Please sign in to comment.