Skip to content

Commit

Permalink
add second regression test for revenue auctions
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrent committed Oct 10, 2023
1 parent 233eec6 commit 6107963
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions test/scenario/BadERC20.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,17 +407,28 @@ describe(`Bad ERC20 - P${IMPLEMENTATION}`, () => {
await rToken.connect(addr1).issue(issueAmt)
})

it('Regression test wcUSDCv3 10/10/2023 -- should not revert during recollateralization', async () => {
await basketHandler.setPrimeBasket(
[token0.address, backupToken.address],
[fp('0.5'), fp('0.5')]
)
await basketHandler.refreshBasket()

// Should launch recollateralization auction successfully
await expect(backingManager.rebalance(TradeKind.BATCH_AUCTION))
.to.emit(backingManager, 'TradeStarted')
.withArgs(anyValue, token0.address, backupToken.address, anyValue, anyValue)
context('Regression tests wcUSDCv3 10/10/2023', () => {
it('should not revert during recollateralization', async () => {
await basketHandler.setPrimeBasket(
[token0.address, backupToken.address],
[fp('0.5'), fp('0.5')]
)
await basketHandler.refreshBasket()

// Should launch recollateralization auction successfully
await expect(backingManager.rebalance(TradeKind.BATCH_AUCTION))
.to.emit(backingManager, 'TradeStarted')
.withArgs(anyValue, token0.address, backupToken.address, anyValue, anyValue)
})

it('should not revert during revenue auction', async () => {
await token0.mint(rsrTrader.address, issueAmt)

// Should launch revenue auction successfully
await expect(rsrTrader.manageTokens([token0.address], [TradeKind.BATCH_AUCTION]))
.to.emit(rsrTrader, 'TradeStarted')
.withArgs(anyValue, token0.address, rsr.address, anyValue, anyValue)
})
})
})
})

0 comments on commit 6107963

Please sign in to comment.