@@ -20,24 +20,28 @@ contract OracleFourFeedsTest is Test {
20
20
}
21
21
22
22
function testOracleWbtcUsdc () public {
23
- OracleFourFeeds oracle = new OracleFourFeeds (wBtcBtcFeed, btcUsdFeed, usdcUsdFeed, AggregatorV3Interface (address (0 )), 8 , 6 );
23
+ OracleFourFeeds oracle =
24
+ new OracleFourFeeds (wBtcBtcFeed, btcUsdFeed, usdcUsdFeed, AggregatorV3Interface (address (0 )), 8 , 6 );
24
25
(, int256 firstBaseAnswer ,,,) = wBtcBtcFeed.latestRoundData ();
25
26
(, int256 secondBaseAnswer ,,,) = btcUsdFeed.latestRoundData ();
26
27
(, int256 quoteAnswer ,,,) = usdcUsdFeed.latestRoundData ();
27
28
assertEq (
28
29
oracle.price (),
29
- (uint256 (firstBaseAnswer) * uint256 (secondBaseAnswer) * 10 ** (36 + 8 + 6 - 8 - 8 - 8 )) / uint256 (quoteAnswer)
30
+ (uint256 (firstBaseAnswer) * uint256 (secondBaseAnswer) * 10 ** (36 + 8 + 6 - 8 - 8 - 8 ))
31
+ / uint256 (quoteAnswer)
30
32
);
31
33
}
32
34
33
35
function testOracleUsdcWbtc () public {
34
- OracleFourFeeds oracle = new OracleFourFeeds (usdcUsdFeed, AggregatorV3Interface (address (0 )), wBtcBtcFeed, btcUsdFeed, 6 , 8 );
36
+ OracleFourFeeds oracle =
37
+ new OracleFourFeeds (usdcUsdFeed, AggregatorV3Interface (address (0 )), wBtcBtcFeed, btcUsdFeed, 6 , 8 );
35
38
(, int256 baseAnswer ,,,) = usdcUsdFeed.latestRoundData ();
36
39
(, int256 firstQuoteAnswer ,,,) = wBtcBtcFeed.latestRoundData ();
37
40
(, int256 secondQuoteAnswer ,,,) = btcUsdFeed.latestRoundData ();
38
41
assertEq (
39
42
oracle.price (),
40
- (uint256 (baseAnswer) * 10 ** (36 + 8 + 8 + 8 - 6 - 8 )) / (uint256 (firstQuoteAnswer) * uint256 (secondQuoteAnswer))
43
+ (uint256 (baseAnswer) * 10 ** (36 + 8 + 8 + 8 - 6 - 8 ))
44
+ / (uint256 (firstQuoteAnswer) * uint256 (secondQuoteAnswer))
41
45
);
42
46
}
43
47
0 commit comments