Skip to content

Commit 31ec914

Browse files
committed
style: make code more readable
1 parent 69b6ebd commit 31ec914

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libraries/ChainlinkDataFeedLib.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ library ChainlinkDataFeedLib {
1414
/// @dev When `feed` is the address zero, returns 1.
1515
function getPrice(AggregatorV3Interface feed) internal view returns (uint256) {
1616
if (address(feed) == address(0)) return 1;
17+
1718
(, int256 answer,,,) = feed.latestRoundData();
1819
require(answer >= 0, ErrorsLib.NEGATIVE_ANSWER);
20+
1921
return uint256(answer);
2022
}
2123

2224
/// @dev Returns the number of decimals of a feed.
2325
/// @dev When `feed` is the address zero, returns 0.
2426
function getDecimals(AggregatorV3Interface feed) internal view returns (uint256) {
2527
if (address(feed) == address(0)) return 0;
28+
2629
return feed.decimals();
2730
}
2831
}

0 commit comments

Comments
 (0)