Skip to content

Commit

Permalink
fix most.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmckelvy1 committed Dec 12, 2023
1 parent 52bb0f7 commit a57b077
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useEnv } from '#/utils/env'
import { forkRpcs, Network } from '#/utils/fork'
import { HardhatUserConfig } from 'hardhat/types'
import forkBlockNumber from '#/test/integration/fork-block-numbers'
import { fp } from './common/numbers'

// eslint-disable-next-line node/no-missing-require
require('#/tasks')
Expand Down Expand Up @@ -45,6 +46,11 @@ const config: HardhatUserConfig = {
gas: 0x1ffffffff,
blockGasLimit: 0x1fffffffffffff,
allowUnlimitedContractSize: true,
accounts: [
{ privateKey: new Array(65).join('1'), balance: fp(1e6).toString() },
{ privateKey: new Array(65).join('2'), balance: fp(1e6).toString() },
{ privateKey: new Array(65).join('3'), balance: fp(1e6).toString() },
]
},
localhost: {
// network for long-lived mainnet forks
Expand Down
2 changes: 2 additions & 0 deletions test/plugins/individual-collateral/collateralTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ export default function fn<X extends CollateralFixtureContext>(
})

describe('status', () => {
before(resetFork)

it('maintains status in normal situations', async () => {
// Check initial state
expect(await collateral.status()).to.equal(CollateralStatus.SOUND)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ export const deployCollateral = async (opts: SfrxEthCollateralOpts = {}): Promis

// Push forward chainlink fee
await pushOracleForward(opts.chainlinkFeed!)
await pushOracleForward(opts.targetPerTokChainlinkFeed!)
// opts.targetPerTokChainlinkFeed?.toLocaleLowerCase() == SFRXETH_ETH_PRICE_FEED.toLocaleLowerCase() ?
// await pushFraxOracleForward(opts.targetPerTokChainlinkFeed ?? SFRXETH_ETH_PRICE_FEED) :
// await pushOracleForward(opts.targetPerTokChainlinkFeed!)
// await pushOracleForward(opts.targetPerTokChainlinkFeed!)
opts.targetPerTokChainlinkFeed?.toLocaleLowerCase() == SFRXETH_ETH_PRICE_FEED.toLocaleLowerCase() ?
await pushFraxOracleForward(opts.targetPerTokChainlinkFeed ?? SFRXETH_ETH_PRICE_FEED) :
await pushOracleForward(opts.targetPerTokChainlinkFeed!)
// sometimes we are trying to test a negative test case and we want this to fail silently
// fortunately this syntax fails silently because our tools are terrible
await expect(collateral.refresh())
Expand Down
1 change: 0 additions & 1 deletion test/utils/oracles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ export const pushFraxOracleForward = async (chainlinkAddr: string) => {
const chainlinkFeed = await ethers.getContractAt('FraxAggregatorV3Interface', chainlinkAddr)
let initPrice = (await chainlinkFeed.latestRoundData()).answer
await whileImpersonating(await chainlinkFeed.priceSource(), async (owner) => {
// await user.sendTransaction({ to: owner.address, value: ethers.utils.parseEther('1') })
await chainlinkFeed.connect(owner).addRoundData(false, initPrice, initPrice, await getLatestBlockTimestamp() + 1)
})
}

0 comments on commit a57b077

Please sign in to comment.