Skip to content

Commit af1a0d3

Browse files
committed
test: naming
1 parent abe7117 commit af1a0d3

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/WstEthEthExchangeRateChainlinkAdapterTest.sol

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ import "../src/wsteth-exchange-rate-adapter/WstEthEthExchangeRateChainlinkAdapte
99
contract WstEthEthExchangeRateChainlinkAdapterTest is Test {
1010
IWstEth internal constant WST_ETH = IWstEth(0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0);
1111

12-
WstEthEthExchangeRateChainlinkAdapter internal oracle;
13-
MorphoChainlinkOracleV2 internal chainlinkOracle;
12+
WstEthEthExchangeRateChainlinkAdapter internal adapter;
13+
MorphoChainlinkOracleV2 internal morphoOracle;
1414

1515
function setUp() public {
1616
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
2020
);
2121
}
2222

2323
function testDecimals() public {
24-
assertEq(oracle.decimals(), uint8(18));
24+
assertEq(adapter.decimals(), uint8(18));
2525
}
2626

2727
function testDescription() public {
28-
assertEq(oracle.description(), "wstETH/ETH exchange rate");
28+
assertEq(adapter.description(), "wstETH/ETH exchange rate");
2929
}
3030

3131
function testDeployZeroAddress() public {
@@ -35,7 +35,7 @@ contract WstEthEthExchangeRateChainlinkAdapterTest is Test {
3535

3636
function testLatestRoundData() public {
3737
(uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) =
38-
oracle.latestRoundData();
38+
adapter.latestRoundData();
3939
assertEq(roundId, 0);
4040
assertEq(uint256(answer), WST_ETH.stEthPerToken());
4141
assertEq(startedAt, 0);
@@ -44,13 +44,13 @@ contract WstEthEthExchangeRateChainlinkAdapterTest is Test {
4444
}
4545

4646
function testLatestRoundDataBounds() public {
47-
(, int256 answer,,,) = oracle.latestRoundData();
47+
(, int256 answer,,,) = adapter.latestRoundData();
4848
assertGe(uint256(answer), 1154690031824824994); // Exchange rate queried at block 19070943
4949
assertLe(uint256(answer), 1.5e18); // Max bounds of the exchange rate. Should work for a long enough time.
5050
}
5151

5252
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));
5555
}
5656
}

0 commit comments

Comments
 (0)