Skip to content

Commit

Permalink
test: auctioneer
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Aug 20, 2024
1 parent 52c7912 commit ad395f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/test/BaseAuctioneer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ contract BaseAuctioneerTest is Setup {
uint256 toTake = (_amount * _percent) / MAX_BPS;
uint256 left = _amount - toTake;
uint256 needed = auctioneer.getAmountNeeded(id, toTake);
uint256 beforeAsset = ERC20(asset).balanceOf(address(this));

airdrop(ERC20(asset), address(this), needed);

Expand All @@ -291,7 +292,7 @@ contract BaseAuctioneerTest is Setup {

(, , , _available) = auctioneer.auctionInfo(id);
assertEq(_available, left);
assertEq(ERC20(asset).balanceOf(address(this)), 0);
assertEq(ERC20(asset).balanceOf(address(this)), beforeAsset);
assertEq(ERC20(from).balanceOf(address(this)), before + toTake);
assertEq(ERC20(from).balanceOf(address(auctioneer)), left);
assertEq(ERC20(asset).balanceOf(address(auctioneer)), needed);
Expand Down Expand Up @@ -430,6 +431,7 @@ contract BaseAuctioneerTest is Setup {
uint256 toTake = (kickable * _percent) / MAX_BPS;
uint256 left = _amount - toTake;
uint256 needed = auctioneer.getAmountNeeded(id, toTake);
uint256 beforeAsset = ERC20(asset).balanceOf(address(this));

airdrop(ERC20(asset), address(this), needed);

Expand All @@ -447,7 +449,7 @@ contract BaseAuctioneerTest is Setup {

(, , , _available) = auctioneer.auctionInfo(id);
assertEq(_available, kickable - toTake);
assertEq(ERC20(asset).balanceOf(address(this)), 0);
assertEq(ERC20(asset).balanceOf(address(this)), beforeAsset);
assertEq(ERC20(from).balanceOf(address(this)), before + toTake);
assertEq(ERC20(from).balanceOf(address(auctioneer)), left);
assertEq(ERC20(asset).balanceOf(address(auctioneer)), needed);
Expand Down

0 comments on commit ad395f7

Please sign in to comment.