Skip to content

Commit

Permalink
ChainLinkPriceOracle tests with smock for mocking contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
ayobuenavista committed Mar 22, 2021
1 parent 0bed128 commit 3044c2e
Show file tree
Hide file tree
Showing 6 changed files with 3,939 additions and 377 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;


contract MockChainLinkAggregatorProxy {
function decimals() external view returns (uint8) {}

function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer, // rate in PRECISION of 10^18
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin
import {Utils} from '@kyber.network/utils-sc/contracts/Utils.sol';
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';


// solhint-disable-next-line max-line-length
// Refer to https://github.com/smartcontractkit/chainlink/blob/develop/evm-contracts/src/v0.6/interfaces/AggregatorV3Interface.sol
interface IChainLinkAggregatorProxy {
Expand Down
10 changes: 5 additions & 5 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require("@nomiclabs/hardhat-truffle5");
require("@nomiclabs/hardhat-web3");
require("@nomiclabs/hardhat-etherscan");
require("hardhat-gas-reporter");
// require("hardhat-gas-reporter");
require('solidity-coverage');

require('dotenv').config();
Expand All @@ -12,10 +12,10 @@ const {accounts} = require('./test-wallets.js');
module.exports = {
defaultNetwork: 'hardhat',

gasReporter: {
currency: 'USD',
gasPrice: 100
},
// gasReporter: {
// currency: 'USD',
// gasPrice: 100
// },

networks: {
develop: {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
"yargs": "16.0.3"
},
"devDependencies": {
"@eth-optimism/smock": "0.2.1-alpha.0",
"@kyber.network/utils-sc": "2.2.1",
"@nomiclabs/hardhat-ethers": "2.0.0",
"@nomiclabs/hardhat-ethers": "2.0.2",
"@nomiclabs/hardhat-etherscan": "2.1.1",
"@nomiclabs/hardhat-truffle5": "2.0.0",
"@nomiclabs/hardhat-web3": "2.0.0",
"@openzeppelin/test-helpers": "0.5.6",
"@openzeppelin/test-helpers": "0.5.10",
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
"chai-bn": "0.2.1",
Expand Down
Loading

0 comments on commit 3044c2e

Please sign in to comment.