Skip to content

Commit

Permalink
test: fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rackstar committed Oct 25, 2024
1 parent 1e6f29a commit b9c529e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/unit/MCR/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ const { getAccounts } = require('../../utils/accounts');
const { Role } = require('../utils').constants;
const { hex } = require('../utils').helpers;

const AggregatorTypes = {
ETH: 0,
USD: 1,
};

async function setup() {
const accounts = await getAccounts();
const MasterMock = await ethers.getContractFactory('MasterMock');
Expand All @@ -29,9 +34,10 @@ async function setup() {
await chainlinkSteth.setLatestAnswer(parseEther('1'));

const priceFeedOracle = await PriceFeedOracle.deploy(
[dai.address, stETH.address],
[chainlinkDAI.address, chainlinkSteth.address],
[18, 18],
[dai.address, stETH.address], // assetAddresses
[chainlinkDAI.address, chainlinkSteth.address], // assetAggregators
[AggregatorTypes.ETH, AggregatorTypes.ETH], // aggregatorTypes
[18, 18], // assetDecimals
st.address,
);

Expand Down
6 changes: 6 additions & 0 deletions test/unit/Pool/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const { BigNumber } = ethers;
const { parseEther } = ethers.utils;
const { AddressZero, WeiPerEther } = ethers.constants;

const AggregatorTypes = {
ETH: 0,
USD: 1,
};

async function setup() {
const accounts = await getAccounts();
// rewrite above artifact imports using ethers.js
Expand Down Expand Up @@ -52,6 +57,7 @@ async function setup() {
const priceFeedOracle = await PriceFeedOracle.deploy(
[dai, stETH, enzymeVault, otherAsset].map(c => c.address),
[chainlinkDAI, chainlinkSteth, chainlinkEnzymeVault, chainlinkOtherAsset].map(c => c.address),
[AggregatorTypes.ETH, AggregatorTypes.ETH, AggregatorTypes.ETH, AggregatorTypes.ETH],
[18, 18, 18, 18],
st.address,
);
Expand Down
6 changes: 6 additions & 0 deletions test/unit/SwapOperator/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ const {
utils: { parseEther },
} = ethers;

const AggregatorTypes = {
ETH: 0,
USD: 1,
};

async function setup() {
const accounts = await getAccounts();
const [owner, governance] = await ethers.getSigners();
Expand Down Expand Up @@ -87,6 +92,7 @@ async function setup() {
const priceFeedOracle = await PriceFeedOracle.deploy(
[dai.address, stEth.address, usdc.address, enzymeV4Vault.address],
[daiAggregator.address, stethAggregator.address, usdcAggregator.address, enzymeV4VaultAggregator.address],
[AggregatorTypes.ETH, AggregatorTypes.ETH, AggregatorTypes.ETH, AggregatorTypes.ETH],
[18, 18, 6, 18],
st.address,
);
Expand Down

0 comments on commit b9c529e

Please sign in to comment.