This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added more tests for new oracle fallback feature
- Loading branch information
1 parent
2e02584
commit d2d74c7
Showing
2 changed files
with
73 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >=0.8.0; | ||
|
||
import "../BasePriceOracle.sol"; | ||
|
||
/** | ||
* @title MockRevertPriceOracle | ||
* @notice Mocks a failing price oracle. Used for testing purposes only | ||
* @author Jourdan Dunkley <[email protected]> (https://github.com/jourdanDunkley) | ||
*/ | ||
contract MockRevertPriceOracle is BasePriceOracle { | ||
constructor() {} | ||
|
||
/** | ||
* @dev Returns the price in ETH of `underlying` (implements `BasePriceOracle`). | ||
*/ | ||
function price(address underlying) external view override returns (uint256) { | ||
revert("MockPriceOracle: price function is failing."); | ||
} | ||
|
||
/** | ||
* @notice Returns the price in ETH of the token underlying `cToken`. | ||
* @dev Implements the `PriceOracle` interface for Ionic pools (and Compound v2). | ||
* @return Price in ETH of the token underlying `cToken`, scaled by `10 ** (36 - underlyingDecimals)`. | ||
*/ | ||
function getUnderlyingPrice(ICErc20 cToken) external view override returns (uint256) { | ||
revert("MockPriceOracle: getUnderlyingPrice function is failing."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters