From 61079639ce6d6d13c98ad59fcd458d0e1b62ae7d Mon Sep 17 00:00:00 2001 From: Taylor Brent Date: Tue, 10 Oct 2023 13:02:09 -0400 Subject: [PATCH] add second regression test for revenue auctions --- test/scenario/BadERC20.test.ts | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/test/scenario/BadERC20.test.ts b/test/scenario/BadERC20.test.ts index 13adebdcd..220ed60d0 100644 --- a/test/scenario/BadERC20.test.ts +++ b/test/scenario/BadERC20.test.ts @@ -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) + }) }) }) })