Skip to content

Commit

Permalink
chore: add snapshot, remvoe dead comments
Browse files Browse the repository at this point in the history
  • Loading branch information
androolloyd committed Nov 20, 2023
1 parent 3f3af1a commit 9822752
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 59 deletions.
84 changes: 45 additions & 39 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,48 +1,54 @@
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallAuctionFailLenderClaim() (gas: 653045)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallAuctionFailLenderClaimRandomFulfiller() (gas: 644029)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallBase() (gas: 1041643)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLender() (gas: 666522)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLiquidation() (gas: 1437972)
TestAstariaV1Pricing:testGetRefinanceConsiderationAsBorrowerZeroRate() (gas: 79761)
TestAstariaV1Pricing:testGetRefinanceConsiderationInsufficientRefinance() (gas: 110639)
TestAstariaV1Pricing:testGetRefinanceConsiderationInvalidRefinance() (gas: 87576)
TestAstariaV1Pricing:testGetRefinanceConsiderationValidEqualRate() (gas: 149408)
TestAstariaV1Pricing:testGetRefinanceConsiderationValidHigherRate() (gas: 162784)
TestAstariaV1Pricing:testGetRefinanceConsiderationValidLowerRate() (gas: 157603)
TestAstariaV1Pricing:testGetRefinanceConsiderationZeroRate() (gas: 141978)
TestAstariaV1Settlement:testGetAuctionStart() (gas: 468404)
TestAstariaV1Settlement:testGetAuctionStartNotStarted() (gas: 467934)
TestAstariaV1Settlement:testGetCurrentAuctionPrice() (gas: 483586)
TestAstariaV1Settlement:testGetCurrentAuctionPriceNoAuction() (gas: 471587)
TestAstariaV1Settlement:testGetSettlementConsiderationDutchAuctionSettlementAbove() (gas: 524392)
TestAstariaV1Settlement:testGetSettlementConsiderationFailedDutchAuction() (gas: 484065)
TestAstariaV1Settlement:testGetSettlementConsiderationLoanNotRecalled() (gas: 474180)
TestAstariaV1Settlement:testGetSettlementConsiderationLoanRecalledByLender() (gas: 506679)
TestAstariaV1Settlement:testGetSettlementConsiderationNoRecallRate() (gas: 485871)
TestAstariaV1Settlement:testV1SettlementHandlerValidate() (gas: 454816)
TestAstariaV1Settlement:testV1SettlementHandlerValidateInvalidHandler() (gas: 454757)
TestAstariaV1Status:testCannotRecallTwice() (gas: 581737)
TestAstariaV1Status:testCannotWithdrawLoanHasNotBeenRefinanced() (gas: 462929)
TestAstariaV1Status:testCannotWithdrawWithdrawDoesNotExist() (gas: 469550)
TestAstariaV1Status:testGenerateRecallConsideration() (gas: 508017)
TestAstariaV1Status:testInvalidRecallInvalidStakeType() (gas: 523463)
TestAstariaV1Status:testInvalidRecallLoanDoesNotExist() (gas: 510755)
TestAstariaV1Status:testIsActive() (gas: 467636)
TestAstariaV1Status:testIsRecalledInsideWindow() (gas: 596196)
TestAstariaV1Status:testIsRecalledOutsideWindow() (gas: 594128)
TestAstariaV1Status:testRecallAndRefinanceInsideWindow() (gas: 752887)
TestAstariaV1Status:testRecallRateActiveRecall() (gas: 582697)
TestAstariaV1Status:testRecallRateEmptyRecall() (gas: 465970)
TestCompoundInterest:testDecimalsTooHigh() (gas: 3362)
TestCompoundInterest:testDecimalsTooLowZero() (gas: 3281)
TestCompoundInterest:testInterestAccrual() (gas: 67039)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallAuctionFailLenderClaim() (gas: 653231)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallAuctionFailLenderClaimRandomFulfiller() (gas: 644215)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallBase() (gas: 1042358)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLender() (gas: 666730)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLiquidation() (gas: 1438180)
TestAstariaV1Pricing:testGetRefinanceConsiderationAsBorrowerZeroRate() (gas: 79783)
TestAstariaV1Pricing:testGetRefinanceConsiderationInsufficientRefinance() (gas: 111189)
TestAstariaV1Pricing:testGetRefinanceConsiderationInvalidRefinance() (gas: 88304)
TestAstariaV1Pricing:testGetRefinanceConsiderationValidEqualRate() (gas: 149516)
TestAstariaV1Pricing:testGetRefinanceConsiderationValidHigherRate() (gas: 162892)
TestAstariaV1Pricing:testGetRefinanceConsiderationValidLowerRate() (gas: 157711)
TestAstariaV1Pricing:testGetRefinanceConsiderationZeroRate() (gas: 81207)
TestAstariaV1Pricing:testGetRefinanceNewDecimalMismatch() (gas: 81092)
TestAstariaV1Pricing:testV1PricingValidateInvalid() (gas: 69869)
TestAstariaV1Pricing:testV1PricingValidateValid() (gas: 69677)
TestAstariaV1Settlement:testGetAuctionStart() (gas: 468743)
TestAstariaV1Settlement:testGetAuctionStartNotStarted() (gas: 468163)
TestAstariaV1Settlement:testGetCurrentAuctionPrice() (gas: 483815)
TestAstariaV1Settlement:testGetCurrentAuctionPriceNoAuction() (gas: 471816)
TestAstariaV1Settlement:testGetSettlementConsiderationDutchAuctionSettlementAbove() (gas: 524599)
TestAstariaV1Settlement:testGetSettlementConsiderationFailedDutchAuction() (gas: 484272)
TestAstariaV1Settlement:testGetSettlementConsiderationLoanNotRecalled() (gas: 474409)
TestAstariaV1Settlement:testGetSettlementConsiderationLoanRecalledByLender() (gas: 506886)
TestAstariaV1Settlement:testGetSettlementConsiderationNoRecallRate() (gas: 486189)
TestAstariaV1Settlement:testV1SettlementHandlerValidate() (gas: 454714)
TestAstariaV1Settlement:testV1SettlementValidateInvalid() (gas: 62616)
TestAstariaV1Settlement:testV1SettlementValidateValid() (gas: 61991)
TestAstariaV1Status:testCannotRecallTwice() (gas: 581966)
TestAstariaV1Status:testCannotWithdrawLoanHasNotBeenRefinanced() (gas: 463071)
TestAstariaV1Status:testCannotWithdrawWithdrawDoesNotExist() (gas: 469779)
TestAstariaV1Status:testGenerateRecallConsideration() (gas: 508246)
TestAstariaV1Status:testInvalidRecallInvalidStakeType() (gas: 523692)
TestAstariaV1Status:testInvalidRecallLoanDoesNotExist() (gas: 510984)
TestAstariaV1Status:testIsActive() (gas: 467865)
TestAstariaV1Status:testIsRecalledInsideWindow() (gas: 596425)
TestAstariaV1Status:testIsRecalledOutsideWindow() (gas: 594357)
TestAstariaV1Status:testRecallAndRefinanceInsideWindow() (gas: 753362)
TestAstariaV1Status:testRecallRateActiveRecall() (gas: 582949)
TestAstariaV1Status:testRecallRateEmptyRecall() (gas: 466199)
TestAstariaV1Status:testV1StatusValidateInValid() (gas: 69799)
TestAstariaV1Status:testV1StatusValidateValid() (gas: 63252)
TestCompoundInterest:testDecimalsTooHigh() (gas: 3340)
TestCompoundInterest:testDecimalsTooLowZero() (gas: 3391)
TestCompoundInterest:testInterestAccrual() (gas: 67017)
TestCompoundInterest:testMaxAmountDecimals() (gas: 171733)
TestCompoundInterest:testRateExceedsMaxRecallRate() (gas: 3319)
TestCompoundInterest:testRateTooLowOne() (gas: 5105)
TestCompoundInterest:testRateTooLowOneNonWADDecimal() (gas: 6412)
TestCompoundInterest:testRateTooLowZero() (gas: 5126)
TestV1BorrowerEnforcer:testFuzzRateMethods((uint256,uint256,uint256),uint256) (runs: 200, μ: 1107, ~: 1107)
TestV1BorrowerEnforcer:testRevertLocateCurrentRateAndAmount() (gas: 61186)
TestV1BorrowerEnforcer:testRevertLocateCurrentRateAndAmount() (gas: 61164)
TestV1BorrowerEnforcer:testV1BorrowerEnforcerAmountOOB() (gas: 114125)
TestV1BorrowerEnforcer:testV1BorrowerEnforcerDebtBundlesNotSupported() (gas: 75113)
TestV1BorrowerEnforcer:testV1BorrowerEnforcerEnd() (gas: 121194)
Expand Down
18 changes: 0 additions & 18 deletions test/TestV1Settlement.sol
Original file line number Diff line number Diff line change
Expand Up @@ -301,24 +301,6 @@ contract TestAstariaV1Settlement is AstariaV1Test, DeepEq {
assertEq(AstariaV1Settlement(loan.terms.settlement).validate(loan), Validation.validate.selector);
}

function testV1SettlementHandlerValidateInvalidHandler() public {
Starport.Terms memory terms = Starport.Terms({
status: address(status),
settlement: address(settlement),
pricing: address(pricing),
pricingData: defaultPricingData,
settlementData: defaultSettlementData,
statusData: defaultStatusData
});
Starport.Loan memory loan =
_createLoan721Collateral20Debt({lender: lender.addr, borrowAmount: 1e18, terms: terms});

address settlement = loan.terms.settlement;
loan.terms.settlement = address(0);
vm.expectRevert(abi.encodeWithSelector(AstariaV1Settlement.InvalidHandler.selector));
AstariaV1Settlement(settlement).validate(loan);
}

function testV1SettlementValidateValid() public {
Starport.Loan memory loan = generateDefaultLoanTerms();
assert(Validation(loan.terms.settlement).validate(loan) == Validation.validate.selector);
Expand Down
1 change: 0 additions & 1 deletion test/TestV1Status.sol
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ contract TestAstariaV1Status is AstariaV1Test, DeepEq {
assert(Validation(loan.terms.status).validate(loan) == Validation.validate.selector);
}

//if (details.recallerRewardRatio > 10 ** pDetails.decimals || details.recallMax > 10 * 10 ** pDetails.decimals) {
function testV1StatusValidateInValid() public {
Starport.Loan memory loan = generateDefaultLoanTerms();
bytes memory defaultDetailsData = loan.terms.statusData;
Expand Down

0 comments on commit 9822752

Please sign in to comment.