Skip to content

Commit

Permalink
chore: improve test tools for liquidation.ts (#9641)
Browse files Browse the repository at this point in the history
closes: #XXXX
refs: #XXXX

## Description

Currently liquidation.ts only allows placing bids in the beginning of the test flow which causes conflicting offer ids if there are 
newer bids. In this PR we offset those bids by defining a `base` variable.

cc @turadg 
### Security Considerations
None

### Scaling Considerations
None

### Documentation Considerations
None

### Testing Considerations
None

### Upgrade Considerations
None
  • Loading branch information
mergify[bot] committed Jul 2, 2024
2 parents 5d7774e + 1ba066a commit 0752cec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/boot/tools/liquidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ export const makeLiquidationTestKit = async ({
collateralBrandKey: string,
buyerWalletAddress: string,
setup: LiquidationSetup,
base = 0, // number of bids made before
) => {
const buyer =
await walletFactoryDriver.provideSmartWallet(buyerWalletAddress);
Expand All @@ -275,7 +276,7 @@ export const makeLiquidationTestKit = async ({
const maxBuy = `10000${collateralBrandKey}`;

for (let i = 0; i < setup.bids.length; i += 1) {
const offerId = `${collateralBrandKey}-bid${i + 1}`;
const offerId = `${collateralBrandKey}-bid${i + 1 + base}`;
// bids are long-lasting offers so we can't wait here for completion
await buyer.sendOfferMaker(Offers.auction.Bid, {
offerId,
Expand Down

0 comments on commit 0752cec

Please sign in to comment.