Skip to content

Commit

Permalink
Fix tests (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
grandizzy authored Dec 15, 2023
1 parent 157faca commit b3a1c1a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions tests/forge/unit/ERC20Pool/ERC20PoolLiquidationsArbTake.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ contract ERC20PoolLiquidationsArbTakeTest is ERC20HelperContract {
kicker: _lender,
index: _i1505_26,
collateralArbed: 1.243970037659931995 * 1e18,
quoteTokenAmount: 19.145503956317913307 * 1e18,
quoteTokenAmount: 19.145503956317913312 * 1e18,
bondChange: 0.210458053887159482 * 1e18,
isReward: false,
lpAwardTaker: 1_853.354102351073019651 * 1e18,
Expand Down Expand Up @@ -585,7 +585,7 @@ contract ERC20PoolLiquidationsArbTakeTest is ERC20HelperContract {
kicker: _lender,
index: _i100_33,
collateralArbed: 0.621978628605749775 * 1e18,
quoteTokenAmount: 19.145307256945244166 * 1e18,
quoteTokenAmount: 19.145307256945244190 * 1e18,
bondChange: 0.210458053887159482 * 1e18,
isReward: false,
lpAwardTaker: 43.259218990266946936 * 1e18,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ contract ERC20PoolLiquidationsDepositTakeTest is ERC20HelperContract {
kicker: _lender,
index: _i1505_26,
collateralArbed: 0.012983089918332295 * 1e18,
quoteTokenAmount: 19.542974337518039598 * 1e18,
quoteTokenAmount: 19.542974337518040881 * 1e18,
bondChange: 0.214827269923259784 * 1e18,
isReward: false,
lpAwardTaker: 0,
Expand Down Expand Up @@ -592,7 +592,7 @@ contract ERC20PoolLiquidationsDepositTakeTest is ERC20HelperContract {
kicker: _lender,
index: _i100_33,
collateralArbed: 0.194780347720468645 * 1e18,
quoteTokenAmount: 19.542773554566540925 * 1e18,
quoteTokenAmount: 19.542773554566540930 * 1e18,
bondChange: 0.214827269923259784 * 1e18,
isReward: false,
lpAwardTaker: 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/forge/unit/ERC20Pool/ERC20PoolLiquidationsMisc.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ contract ERC20PoolLiquidationsMiscTest is ERC20HelperContract {
borrower: _borrower,
maxCollateral: 2.0 * 1e18,
bondChange: 0.209172983065585793 * 1e18,
givenAmount: 19.028375417729999825 * 1e18,
givenAmount: 19.028375417729999837 * 1e18,
collateralTaken: 0.621977670077779898 * 1e18,
isReward: false
});
Expand Down
4 changes: 2 additions & 2 deletions tests/forge/unit/ERC20Pool/ERC20PoolLiquidationsTake.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ contract ERC20PoolLiquidationsTakeTest is ERC20HelperContract {
borrower: _borrower2,
maxCollateral: 1_001 * 1e18,
bondChange: 31.107643684582954716 * 1e18,
givenAmount: 9_954.602473053939912624 * 1e18,
givenAmount: 9_954.602473053939912630 * 1e18,
collateralTaken: 947.278817279990525519 * 1e18,
isReward: true
});
Expand Down Expand Up @@ -2080,7 +2080,7 @@ contract ERC20PoolLiquidationsTakeAndRepayAllDebtInPoolTest is ERC20HelperContra
borrower: _borrower,
maxCollateral: 0.067433366047580170 * 1e18,
bondChange: 1.150195169774094785 * 1e18,
givenAmount: 104.633060200351867030 * 1e18,
givenAmount: 104.633060200351870411 * 1e18,
collateralTaken: 0.023886288632228204 * 1e18,
isReward: false
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,13 +594,13 @@ contract ERC721PoolLiquidationsSettleAuctionTest is ERC721HelperContract {
borrower: _borrower,
maxCollateral: 2,
bondChange: 101.346184596990929201 * 1e18,
givenAmount: 9_236.603649496932503519 * 1e18,
givenAmount: 9_236.603649496932514865 * 1e18,
collateralTaken: 1.000000000000000000 * 1e18,
isReward: false
});

assertEq(_quote.balanceOf(_borrower), 7_500.903066211834660554 * 1e18);
assertEq(_quote.balanceOf(address(_pool)), 13_461.656029497009721769 * 1e18);
assertEq(_quote.balanceOf(address(_pool)), 13_461.656029497009733115 * 1e18);

_assertBorrower({
borrower: _borrower,
Expand Down Expand Up @@ -670,11 +670,11 @@ contract ERC721PoolLiquidationsSettleAuctionTest is ERC721HelperContract {
kicker: _lender,
index: 2500,
collateralArbed: 2.641774864645406157 * 1e18,
quoteTokenAmount: 10_206.904997350989039481 * 1e18,
bondChange: 3.376910369914579033 * 1e18,
quoteTokenAmount: 10_206.904997350989042985 * 1e18,
bondChange: 3.376910369914579034 * 1e18,
isReward: true,
lpAwardTaker: 0,
lpAwardKicker: 2.032141649575679123 * 1e18
lpAwardKicker: 2.032141649575679124 * 1e18
});
_assertCollateralInvariants();
_assertBorrower({
Expand Down Expand Up @@ -735,7 +735,7 @@ contract ERC721PoolLiquidationsSettleAuctionTest is ERC721HelperContract {
// lender removes collateral
_assertBucket({
index: 2500,
lpBalance: 8_001.666844845922711123 * 1e18,
lpBalance: 8_001.666844845922711124 * 1e18,
collateral: 2.641774864645406157 * 1e18,
deposit: 3_089.860880462677483506 * 1e18,
exchangeRate: 1.661749499903067308 * 1e18
Expand Down Expand Up @@ -892,8 +892,8 @@ contract ERC721PoolLiquidationsSettleAuctionTest is ERC721HelperContract {
kicker: _lender,
index: 2000,
collateralArbed: 0.146617724350579337 * 1e18,
quoteTokenAmount: 6_858.286469719939674566 * 1e18,
bondChange: 76.677973777304187581 * 1e18,
quoteTokenAmount: 6_858.286469719939684040 * 1e18,
bondChange: 76.677973777304187687 * 1e18,
isReward: false,
lpAwardTaker: 0,
lpAwardKicker: 0
Expand All @@ -915,7 +915,7 @@ contract ERC721PoolLiquidationsSettleAuctionTest is ERC721HelperContract {
bondFactor: 0,
kickTime: 0,
referencePrice: 0,
totalBondEscrowed: 148.374406222773030669 * 1e18,
totalBondEscrowed: 148.374406222773030563 * 1e18,
auctionPrice: 0,
debtInAuction: 10_066.670727855240484714 * 1e18,
thresholdPrice: 0,
Expand All @@ -937,7 +937,7 @@ contract ERC721PoolLiquidationsSettleAuctionTest is ERC721HelperContract {
kicker: _lender,
index: 2000,
collateralArbed: 0.218877853231731145 * 1e18,
quoteTokenAmount: 10_238.373470803340942675 * 1e18,
quoteTokenAmount: 10_238.373470803340954507 * 1e18,
bondChange: 112.526190000038609125 * 1e18,
isReward: false,
lpAwardTaker: 0,
Expand All @@ -960,7 +960,7 @@ contract ERC721PoolLiquidationsSettleAuctionTest is ERC721HelperContract {
bondFactor: 0,
kickTime: 0,
referencePrice: 0,
totalBondEscrowed: 35.848216222734421544 * 1e18,
totalBondEscrowed: 35.848216222734421438 * 1e18,
auctionPrice: 0,
debtInAuction: 0,
thresholdPrice: 0,
Expand Down
10 changes: 5 additions & 5 deletions tests/forge/unit/ERC721Pool/ERC721PoolLiquidationsTake.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ contract ERC721PoolLiquidationsTakeTest is ERC721HelperContract {
borrower: _borrower,
maxCollateral: 2,
bondChange: 0.243847547737474028 * 1e18,
givenAmount: 22.183024574062103585 * 1e18,
givenAmount: 22.183024574062103590 * 1e18,
collateralTaken: 2.0 * 1e18,
isReward: false
});
Expand Down Expand Up @@ -416,7 +416,7 @@ contract ERC721PoolLiquidationsTakeTest is ERC721HelperContract {
assertEq(_collateral.ownerOf(1), _lender);

// after take: check quote token balances of taker and borrower
assertEq(_quote.balanceOf(_lender), 46_969.765754986974727387 * 1e18);
assertEq(_quote.balanceOf(_lender), 46_969.765754986974727382 * 1e18);
assertEq(_quote.balanceOf(_borrower), 126.807372891225695000 * 1e18); // borrower gets quote tokens from the difference of rounded collateral (2) and needed collateral (1.49) at auction price (15.5) = 7.9 additional tokens
}

Expand Down Expand Up @@ -956,7 +956,7 @@ contract ERC721PoolLiquidationsHighTakeTest is ERC721HelperContract {
borrower: _borrower,
maxCollateral: 2 * 1e18,
bondChange: 10_897_869.739154233968795067 * 1e18,
givenAmount: 991_360_820.988112808697327591 * 1e18,
givenAmount: 991_360_820.988112939930817798 * 1e18,
collateralTaken: 1.0 * 1e18,
isReward: false
});
Expand Down Expand Up @@ -1095,7 +1095,7 @@ contract ERC721PoolLiquidationsHighTakeTest is ERC721HelperContract {
borrower: _borrower,
maxCollateral: 1 * 1e18,
bondChange: 21_502_134.795353695767188920 * 1e18,
givenAmount: 1_956_012_919.399533593528919134 * 1e18,
givenAmount: 1_956_012_919.399533852112525653 * 1e18,
collateralTaken: 1.0 * 1e18,
isReward: false
});
Expand Down Expand Up @@ -1265,7 +1265,7 @@ contract ERC721PoolLiquidationsHighTakeTest is ERC721HelperContract {
borrower: _borrower,
maxCollateral: 2 * 1e18,
bondChange: 21_502_134.795353695767188920 * 1e18,
givenAmount: 1_956_012_919.399533593528919134 * 1e18,
givenAmount: 1_956_012_919.399533852112525653 * 1e18,
collateralTaken: 1.0 * 1e18,
isReward: false
});
Expand Down

0 comments on commit b3a1c1a

Please sign in to comment.