Skip to content

Commit

Permalink
Resolve final todos in test script
Browse files Browse the repository at this point in the history
  • Loading branch information
alsco77 committed Mar 19, 2021
1 parent e76178f commit e08dbeb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test-fork/mUSD/mUSD-migrate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ const validateUnchangedMassetStorage = async (mUsd: MusdV3 | Masset | Contract,
expect(await mUsd.redemptionFee(), "redemption fee").to.eq(simpleToExactAmount(3, 14))
expect(await mUsd.cacheSize(), "cache size").to.eq(simpleToExactAmount(3, 16))
expect(await mUsd.surplus(), `surplus at block ${forkBlockNumber}`).to.eq(overrideSurplus)
expect(await mUsd.nexus(), `nexus at block ${forkBlockNumber}`).to.eq(nexusAddress)
}

// Check that the bAsset data is what we expect
Expand Down Expand Up @@ -320,7 +321,6 @@ const balanceBasset = async (
const tx = mUsdV2.connect(signer).swap(inputToken.address, outputToken.address, bAssetAmount, whaleAddress)

await expect(tx).to.emit(mUsdV2, "Swapped")
// TODO - consider what this is used for and whether to rely on cached settings
scaledVaultBalances[inputToken.index] = scaledVaultBalances[inputToken.index].add(minBassetAmount)
// this is not 100% accurate as the outputs are less fees but it's close enough for testing
scaledVaultBalances[outputToken.index] = scaledVaultBalances[outputToken.index].sub(minBassetAmount)
Expand Down Expand Up @@ -379,6 +379,7 @@ describe("mUSD V2.0 to V3.0", () => {
let governor: Signer
const balancedVaultBalances: BN[] = []
let aaveV2: AaveV2Integration
let basketManager: Contract
before("Set-up globals", async () => {
accounts = await impersonateAccounts()
deployer = accounts.deployer
Expand Down Expand Up @@ -448,7 +449,6 @@ describe("mUSD V2.0 to V3.0", () => {
* iii) Final state pre-upgrade (everything in place & paused)
*/
describe("STEP 2 - Achieve equilibrium weights & prep", () => {
let basketManager: Contract
const scaledVaultBalances: BN[] = []
let scaledTargetBalance: BN
before(async () => {
Expand All @@ -464,6 +464,7 @@ describe("mUSD V2.0 to V3.0", () => {
)
await aaveV2.deployTransaction.wait()
await aaveV2.connect(governor).setPTokenAddress(sUSD.address, "0x6c5024cd4f8a59110119c56f8933403a539555eb")
await aaveV2.connect(governor).setPTokenAddress(USDT.address, "0x3ed3b47dd13ec9a98b44e6204a523e766b225811")
await basketManager.migrateBassets([sUSD.address], aaveV2.address)
})
it("adds DAI to the basket", async () => {
Expand Down Expand Up @@ -624,6 +625,9 @@ describe("mUSD V2.0 to V3.0", () => {
expect(basketState.failed, "undergoingRecol").to.be.false
expect(basketState[1], "basketState[1]").to.be.false
})
// it("moves USDT to V2", async () => {
// await basketManager.migrateBassets([USDT.address], aaveV2.address)
// })
it("Should mint after upgrade", async () => {
const token = finalBassets[0]
const signer = await impersonate(token.whaleAddress)
Expand Down

0 comments on commit e08dbeb

Please sign in to comment.