Skip to content

Commit 48e1bb0

Browse files
committed
chore: fmt
1 parent c183a26 commit 48e1bb0

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

test/ChainlinkOracleTest.sol

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ contract ChainlinkOracleTest is Test {
3333
}
3434

3535
function testOracleWbtcUsdc() public {
36-
ChainlinkOracle oracle = new ChainlinkOracle(vaultZero, 1, vaultZero, 1, wBtcBtcFeed, btcUsdFeed, usdcUsdFeed, feedZero, 8, 6);
36+
ChainlinkOracle oracle =
37+
new ChainlinkOracle(vaultZero, 1, vaultZero, 1, wBtcBtcFeed, btcUsdFeed, usdcUsdFeed, feedZero, 8, 6);
3738
(, int256 firstBaseAnswer,,,) = wBtcBtcFeed.latestRoundData();
3839
(, int256 secondBaseAnswer,,,) = btcUsdFeed.latestRoundData();
3940
(, int256 quoteAnswer,,,) = usdcUsdFeed.latestRoundData();
@@ -45,7 +46,8 @@ contract ChainlinkOracleTest is Test {
4546
}
4647

4748
function testOracleUsdcWbtc() public {
48-
ChainlinkOracle oracle = new ChainlinkOracle(vaultZero, 1, vaultZero, 1, usdcUsdFeed, feedZero, wBtcBtcFeed, btcUsdFeed, 6, 8);
49+
ChainlinkOracle oracle =
50+
new ChainlinkOracle(vaultZero, 1, vaultZero, 1, usdcUsdFeed, feedZero, wBtcBtcFeed, btcUsdFeed, 6, 8);
4951
(, int256 baseAnswer,,,) = usdcUsdFeed.latestRoundData();
5052
(, int256 firstQuoteAnswer,,,) = wBtcBtcFeed.latestRoundData();
5153
(, int256 secondQuoteAnswer,,,) = btcUsdFeed.latestRoundData();
@@ -57,48 +59,56 @@ contract ChainlinkOracleTest is Test {
5759
}
5860

5961
function testOracleWbtcEth() public {
60-
ChainlinkOracle oracle = new ChainlinkOracle(vaultZero, 1, vaultZero, 1, wBtcBtcFeed, btcEthFeed, feedZero, feedZero, 8, 18);
62+
ChainlinkOracle oracle =
63+
new ChainlinkOracle(vaultZero, 1, vaultZero, 1, wBtcBtcFeed, btcEthFeed, feedZero, feedZero, 8, 18);
6164
(, int256 firstBaseAnswer,,,) = wBtcBtcFeed.latestRoundData();
6265
(, int256 secondBaseAnswer,,,) = btcEthFeed.latestRoundData();
6366
assertEq(oracle.price(), (uint256(firstBaseAnswer) * uint256(secondBaseAnswer) * 10 ** (36 + 18 - 8 - 8 - 18)));
6467
}
6568

6669
function testOracleStEthUsdc() public {
67-
ChainlinkOracle oracle = new ChainlinkOracle(vaultZero, 1, vaultZero, 1, stEthEthFeed, feedZero, usdcEthFeed, feedZero, 18, 6);
70+
ChainlinkOracle oracle =
71+
new ChainlinkOracle(vaultZero, 1, vaultZero, 1, stEthEthFeed, feedZero, usdcEthFeed, feedZero, 18, 6);
6872
(, int256 baseAnswer,,,) = stEthEthFeed.latestRoundData();
6973
(, int256 quoteAnswer,,,) = usdcEthFeed.latestRoundData();
7074
assertEq(oracle.price(), uint256(baseAnswer) * 10 ** (36 + 18 + 6 - 18 - 18) / uint256(quoteAnswer));
7175
}
7276

7377
function testOracleEthUsd() public {
74-
ChainlinkOracle oracle = new ChainlinkOracle(vaultZero, 1, vaultZero, 1, ethUsdFeed, feedZero, feedZero, feedZero, 18, 0);
78+
ChainlinkOracle oracle =
79+
new ChainlinkOracle(vaultZero, 1, vaultZero, 1, ethUsdFeed, feedZero, feedZero, feedZero, 18, 0);
7580
(, int256 expectedPrice,,,) = ethUsdFeed.latestRoundData();
7681
assertEq(oracle.price(), uint256(expectedPrice) * 10 ** (36 - 18 - 8));
7782
}
7883

7984
function testOracleStEthEth() public {
80-
ChainlinkOracle oracle = new ChainlinkOracle(vaultZero, 1, vaultZero, 1, stEthEthFeed, feedZero, feedZero, feedZero, 18, 18);
85+
ChainlinkOracle oracle =
86+
new ChainlinkOracle(vaultZero, 1, vaultZero, 1, stEthEthFeed, feedZero, feedZero, feedZero, 18, 18);
8187
(, int256 expectedPrice,,,) = stEthEthFeed.latestRoundData();
8288
assertEq(oracle.price(), uint256(expectedPrice) * 10 ** (36 + 18 - 18 - 18));
8389
assertApproxEqRel(oracle.price(), 1e36, 0.01 ether);
8490
}
8591

8692
function testOracleEthStEth() public {
87-
ChainlinkOracle oracle = new ChainlinkOracle(vaultZero, 1, vaultZero, 1, feedZero, feedZero, stEthEthFeed, feedZero, 18, 18);
93+
ChainlinkOracle oracle =
94+
new ChainlinkOracle(vaultZero, 1, vaultZero, 1, feedZero, feedZero, stEthEthFeed, feedZero, 18, 18);
8895
(, int256 expectedPrice,,,) = stEthEthFeed.latestRoundData();
8996
assertEq(oracle.price(), 10 ** (36 + 18 + 18 - 18) / uint256(expectedPrice));
9097
assertApproxEqRel(oracle.price(), 1e36, 0.01 ether);
9198
}
9299

93100
function testOracleUsdcUsd() public {
94-
ChainlinkOracle oracle = new ChainlinkOracle(vaultZero, 1, vaultZero, 1, usdcUsdFeed, feedZero, feedZero, feedZero, 6, 0);
101+
ChainlinkOracle oracle =
102+
new ChainlinkOracle(vaultZero, 1, vaultZero, 1, usdcUsdFeed, feedZero, feedZero, feedZero, 6, 0);
95103
assertApproxEqRel(oracle.price(), 1e36 / 1e6, 0.01 ether);
96104
}
97105

98106
function testNegativeAnswer(int256 price) public {
99107
price = bound(price, type(int256).min, -1);
100108
ChainlinkAggregatorMock aggregator = new ChainlinkAggregatorMock();
101-
ChainlinkOracle oracle = new ChainlinkOracle(vaultZero, 1, vaultZero, 1, AggregatorV3Interface(address(aggregator)), feedZero, feedZero, feedZero, 18, 0);
109+
ChainlinkOracle oracle = new ChainlinkOracle(
110+
vaultZero, 1, vaultZero, 1, AggregatorV3Interface(address(aggregator)), feedZero, feedZero, feedZero, 18, 0
111+
);
102112
aggregator.setAnwser(price);
103113
vm.expectRevert(bytes(ErrorsLib.NEGATIVE_ANSWER));
104114
oracle.price();

0 commit comments

Comments
 (0)