@@ -9,23 +9,23 @@ import "../src/wsteth-exchange-rate-adapter/WstEthEthExchangeRateChainlinkAdapte
9
9
contract WstEthEthExchangeRateChainlinkAdapterTest is Test {
10
10
IWstEth internal constant WST_ETH = IWstEth (0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 );
11
11
12
- WstEthEthExchangeRateChainlinkAdapter internal oracle ;
13
- MorphoChainlinkOracleV2 internal chainlinkOracle ;
12
+ WstEthEthExchangeRateChainlinkAdapter internal adapter ;
13
+ MorphoChainlinkOracleV2 internal morphoOracle ;
14
14
15
15
function setUp () public {
16
16
vm.createSelectFork (vm.envString ("ETH_RPC_URL " ));
17
- oracle = new WstEthEthExchangeRateChainlinkAdapter (address (WST_ETH));
18
- chainlinkOracle = new MorphoChainlinkOracleV2 (
19
- vaultZero, 1 , AggregatorV3Interface (address (oracle )), feedZero, 18 , vaultZero, 1 , feedZero, feedZero, 18
17
+ adapter = new WstEthEthExchangeRateChainlinkAdapter (address (WST_ETH));
18
+ morphoOracle = new MorphoChainlinkOracleV2 (
19
+ vaultZero, 1 , AggregatorV3Interface (address (adapter )), feedZero, 18 , vaultZero, 1 , feedZero, feedZero, 18
20
20
);
21
21
}
22
22
23
23
function testDecimals () public {
24
- assertEq (oracle .decimals (), uint8 (18 ));
24
+ assertEq (adapter .decimals (), uint8 (18 ));
25
25
}
26
26
27
27
function testDescription () public {
28
- assertEq (oracle .description (), "wstETH/ETH exchange rate " );
28
+ assertEq (adapter .description (), "wstETH/ETH exchange rate " );
29
29
}
30
30
31
31
function testDeployZeroAddress () public {
@@ -35,7 +35,7 @@ contract WstEthEthExchangeRateChainlinkAdapterTest is Test {
35
35
36
36
function testLatestRoundData () public {
37
37
(uint80 roundId , int256 answer , uint256 startedAt , uint256 updatedAt , uint80 answeredInRound ) =
38
- oracle .latestRoundData ();
38
+ adapter .latestRoundData ();
39
39
assertEq (roundId, 0 );
40
40
assertEq (uint256 (answer), WST_ETH.stEthPerToken ());
41
41
assertEq (startedAt, 0 );
@@ -44,13 +44,13 @@ contract WstEthEthExchangeRateChainlinkAdapterTest is Test {
44
44
}
45
45
46
46
function testLatestRoundDataBounds () public {
47
- (, int256 answer ,,,) = oracle .latestRoundData ();
47
+ (, int256 answer ,,,) = adapter .latestRoundData ();
48
48
assertGe (uint256 (answer), 1154690031824824994 ); // Exchange rate queried at block 19070943
49
49
assertLe (uint256 (answer), 1.5e18 ); // Max bounds of the exchange rate. Should work for a long enough time.
50
50
}
51
51
52
52
function testOracleWstEthEthExchangeRate () public {
53
- (, int256 expectedPrice ,,,) = oracle .latestRoundData ();
54
- assertEq (chainlinkOracle .price (), uint256 (expectedPrice) * 10 ** (36 + 18 - 18 - 18 ));
53
+ (, int256 expectedPrice ,,,) = adapter .latestRoundData ();
54
+ assertEq (morphoOracle .price (), uint256 (expectedPrice) * 10 ** (36 + 18 - 18 - 18 ));
55
55
}
56
56
}
0 commit comments