Skip to content

Commit

Permalink
Feat/loanmanager testing rebase (#34)
Browse files Browse the repository at this point in the history
* Coverage testing for loan manager, wip

* updates to refinance and a test to validate its cheaper

* add snapshot

* add asserts to preview order coverage tests to ensure correct output

* update astaria v1 testing to use the new refinance flow/remove old flow

* updates for 100 line and method coverage, LM at 80%

* add check and test to ensure the edgecase of fungible tokens in same block cannot be minted twice

* rebase main and add new snapshot

* add changes that got dropped

* finish natspec for methods

* fix typos in natspec

* Custodian Natspec, custodian seaport moves to ConsiderationInterface, test adjustment, comment out AAVE Pool Custodian

* update snapshot
  • Loading branch information
androolloyd authored Oct 19, 2023
1 parent 1b59637 commit f013dd4
Show file tree
Hide file tree
Showing 12 changed files with 2,072 additions and 580 deletions.
155 changes: 96 additions & 59 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,66 +1,103 @@
EnforcerTest:testCollateralEnforcer() (gas: 950647)
EnforcerTest:testFailCollateralEnforcerDifferentCollateral() (gas: 832776)
EnforcerTest:testFailRateEnforcerMaxCarryRate() (gas: 787916)
EnforcerTest:testFailRateEnforcerMaxRate() (gas: 787888)
EnforcerTest:testFailRateEnforcerMaxRateAndMaxCarryRate() (gas: 787753)
EnforcerTest:testRateEnforcerBasic() (gas: 907823)
EnforcerTest:testTermEnforcerBasic() (gas: 980151)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecall() (gas: 968823)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLender() (gas: 859221)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLiquidation() (gas: 906085)
TestCustodian:testCannotLazyMintTwice() (gas: 76591)
TestCustodian:testCannotMintInvalidLoanInvalidCustodian() (gas: 66811)
TestCustodian:testCannotMintInvalidLoanValidCustodian() (gas: 72394)
TestCustodian:testCustodySelector() (gas: 2790258)
TestCustodian:testDefaultCustodySelectorRevert() (gas: 11673)
TestCustodian:testGenerateOrderInvalidHandlerExecution() (gas: 147388)
TestCustodian:testGenerateOrderRepay() (gas: 189283)
TestCustodian:testGenerateOrderRepayAsRepayApprovedBorrower() (gas: 214857)
TestCustodian:testGenerateOrderRepayERC1155AndERC20AndNative() (gas: 1129477)
TestCustodian:testGenerateOrderRepayERC1155AndERC20AndNativeHandlerAuthorized() (gas: 1029201)
TestCustodian:testGenerateOrderRepayERC1155WithRevert() (gas: 530572)
TestCustodian:testGenerateOrderRepayInvalidHookAddress() (gas: 104841)
TestCustodian:testGenerateOrderRepayInvalidHookReturnType() (gas: 99244)
TestCustodian:testGenerateOrderRepayNotBorrower() (gas: 110879)
TestCustodian:testGenerateOrderSettlement() (gas: 164511)
TestCustodian:testGenerateOrderSettlementHandlerAuthorized() (gas: 173617)
TestCustodian:testGenerateOrderSettlementNoActiveLoan() (gas: 107403)
TestCustodian:testGenerateOrderSettlementUnauthorized() (gas: 108744)
TestCustodian:testGetBorrower() (gas: 76099)
EnforcerTest:testCollateralEnforcer() (gas: 954073)
EnforcerTest:testFailCollateralEnforcerDifferentCollateral() (gas: 834092)
EnforcerTest:testFailRateEnforcerMaxCarryRate() (gas: 789228)
EnforcerTest:testFailRateEnforcerMaxRate() (gas: 789200)
EnforcerTest:testFailRateEnforcerMaxRateAndMaxCarryRate() (gas: 789065)
EnforcerTest:testRateEnforcerBasic() (gas: 911246)
EnforcerTest:testTermEnforcerBasic() (gas: 983574)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallBase() (gas: 1218188)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLender() (gas: 858353)
TestAstariaV1Loan:testNewLoanERC721CollateralDefaultTermsRecallLiquidation() (gas: 894602)
TestCustodian:testCannotLazyMintTwice() (gas: 76663)
TestCustodian:testCannotMintInvalidLoanInvalidCustodian() (gas: 66883)
TestCustodian:testCannotMintInvalidLoanValidCustodian() (gas: 72400)
TestCustodian:testCustodySelector() (gas: 2818119)
TestCustodian:testDefaultCustodySelectorRevert() (gas: 11672)
TestCustodian:testGenerateOrderInvalidHandlerExecution() (gas: 139368)
TestCustodian:testGenerateOrderRepay() (gas: 176877)
TestCustodian:testGenerateOrderRepayAsRepayApprovedBorrower() (gas: 202524)
TestCustodian:testGenerateOrderRepayERC1155AndERC20AndNative() (gas: 1115040)
TestCustodian:testGenerateOrderRepayERC1155AndERC20AndNativeHandlerAuthorized() (gas: 1028737)
TestCustodian:testGenerateOrderRepayERC1155WithRevert() (gas: 524739)
TestCustodian:testGenerateOrderRepayInvalidHookAddress() (gas: 96790)
TestCustodian:testGenerateOrderRepayInvalidHookReturnType() (gas: 91194)
TestCustodian:testGenerateOrderRepayNotBorrower() (gas: 102990)
TestCustodian:testGenerateOrderSettlement() (gas: 158129)
TestCustodian:testGenerateOrderSettlementHandlerAuthorized() (gas: 167257)
TestCustodian:testGenerateOrderSettlementNoActiveLoan() (gas: 162422)
TestCustodian:testGenerateOrderSettlementUnauthorized() (gas: 100769)
TestCustodian:testGetBorrower() (gas: 76157)
TestCustodian:testInvalidAction() (gas: 121504)
TestCustodian:testInvalidActionRepayInActiveLoan() (gas: 124409)
TestCustodian:testInvalidActionSettleActiveLoan() (gas: 124413)
TestCustodian:testName() (gas: 7098)
TestCustodian:testNonPayableFunctions() (gas: 247767)
TestCustodian:testOnlySeaport() (gas: 17931)
TestCustodian:testNonPayableFunctions() (gas: 219009)
TestCustodian:testOnlySeaport() (gas: 17975)
TestCustodian:testPayableFunctions() (gas: 43468)
TestCustodian:testPreviewOrderNoActiveLoan() (gas: 104915)
TestCustodian:testPreviewOrderRepay() (gas: 243798)
TestCustodian:testPreviewOrderSettlement() (gas: 195979)
TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 106672)
TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 112759)
TestCustodian:testRatifyOrder() (gas: 195401)
TestCustodian:testSafeTransferReceive() (gas: 159065)
TestCustodian:testSeaportMetadata() (gas: 8501)
TestCustodian:testSetRepayApproval() (gas: 37907)
TestCustodian:testSupportsInterface() (gas: 9428)
TestCustodian:testSymbol() (gas: 7105)
TestCustodian:testTokenURI() (gas: 64811)
TestCustodian:testPreviewOrderNoActiveLoan() (gas: 105228)
TestCustodian:testPreviewOrderRepay() (gas: 227912)
TestCustodian:testPreviewOrderSettlement() (gas: 190065)
TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 107146)
TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 113276)
TestCustodian:testRatifyOrder() (gas: 183062)
TestCustodian:testSafeTransfer1155Receive() (gas: 115587)
TestCustodian:testSeaportMetadata() (gas: 8589)
TestCustodian:testSetRepayApproval() (gas: 37839)
TestCustodian:testSupportsInterface() (gas: 9406)
TestCustodian:testSymbol() (gas: 7171)
TestCustodian:testTokenURI() (gas: 64839)
TestCustodian:testTokenURIInvalidLoan() (gas: 13196)
TestExoticLoans:testSwap() (gas: 1353767)
TestExoticLoans:testSwap() (gas: 1353169)
TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 164)
TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 539789)
TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 756102)
TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 574976)
TestLoanCombinations:testLoanSimpleInterestEnglishFixed() (gas: 747748)
TestLoanManager:testGenerateOrder() (gas: 1005642)
TestLoanManager:testGenerateOrderNotSeaport() (gas: 13074)
TestLoanManager:testName() (gas: 7206)
TestLoanManager:testSupportsInterface() (gas: 9579)
TestLoanManager:testSymbol() (gas: 7148)
TestNewLoan:testBuyNowPayLater() (gas: 1141742)
TestNewLoan:testNewLoanERC721CollateralDefaultTerms2():((uint256,address,address,address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],(address,bytes,address,bytes,address,bytes))) (gas: 978940)
TestNewLoan:testNewLoanERC721CollateralDefaultTermsRefinance() (gas: 639711)
TestNewLoan:testNewLoanERC721CollateralLessDebtThanOffered():((uint256,address,address,address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],(address,bytes,address,bytes,address,bytes))) (gas: 979274)
TestNewLoan:testSettleLoan() (gas: 1233410)
TestRepayLoan:testRepayLoan() (gas: 694565)
TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 517422)
TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 711981)
TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 541506)
TestLoanCombinations:testLoanSimpleInterestEnglishFixed() (gas: 701482)
TestLoanManager:testCannotIssueSameLoanTwice() (gas: 1529536)
TestLoanManager:testCannotSettleInvalidLoan() (gas: 72844)
TestLoanManager:testCannotSettleUnlessValidCustodian() (gas: 68990)
TestLoanManager:testCaveatEnforcerInvalidOrigination() (gas: 1797025)
TestLoanManager:testDefaultFeeRake() (gas: 403187)
TestLoanManager:testExoticDebtWithNoCaveatsAsBorrower() (gas: 1587178)
TestLoanManager:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 1677088)
TestLoanManager:testGenerateOrder() (gas: 1495062)
TestLoanManager:testGenerateOrderInvalidAction() (gas: 1354698)
TestLoanManager:testGenerateOrderNotSeaport() (gas: 13023)
TestLoanManager:testInitializedFlagSetProperly() (gas: 65194)
TestLoanManager:testInvalidDebtLength() (gas: 39181)
TestLoanManager:testInvalidDebtType() (gas: 1364311)
TestLoanManager:testInvalidMaximumSpentEmpty() (gas: 50192)
TestLoanManager:testIssued() (gas: 67041)
TestLoanManager:testName() (gas: 7209)
TestLoanManager:testNativeDebtWithNoCaveatsAsBorrower() (gas: 1500521)
TestLoanManager:testNativeDebtWithNoCaveatsNotAsBorrower() (gas: 1541426)
TestLoanManager:testNativeDebtWithNoCaveatsNotAsBorrowerFeesOn() (gas: 1604818)
TestLoanManager:testNonDefaultCustodianCustodyCallFails() (gas: 23953)
TestLoanManager:testNonDefaultCustodianCustodyCallSuccess() (gas: 25327)
TestLoanManager:testNonPayableFunctions() (gas: 109562)
TestLoanManager:testOverrideFeeRake() (gas: 404503)
TestLoanManager:testPayableFunctions() (gas: 55281)
TestLoanManager:testPreviewOrderInvalidAction() (gas: 1299017)
TestLoanManager:testPreviewOrderOriginationWithNoCaveatsSetAsBorrowerFeeOn() (gas: 1345487)
TestLoanManager:testPreviewOrderOriginationWithNoCaveatsSetAsBorrowerNoFee() (gas: 1313690)
TestLoanManager:testPreviewOrderOriginationWithNoCaveatsSetNotBorrowerFeeOn() (gas: 1354173)
TestLoanManager:testPreviewOrderOriginationWithNoCaveatsSetNotBorrowerNoFee() (gas: 1322064)
TestLoanManager:testPreviewOrderRefinanceAsRefinancerFeeOff() (gas: 1373981)
TestLoanManager:testPreviewOrderRefinanceAsRefinancerFeeOn() (gas: 1399308)
TestLoanManager:testRefinanceNoRefinanceConsideration() (gas: 1386463)
TestLoanManager:testSafeTransfer1155Receive() (gas: 54338)
TestLoanManager:testSeaportMetadata() (gas: 8667)
TestLoanManager:testSupportsInterface() (gas: 9580)
TestLoanManager:testSymbol() (gas: 7238)
TestLoanManager:testTokenURI() (gas: 64967)
TestLoanManager:testTokenURIInvalidLoan() (gas: 13290)
TestLoanManager:testTransferFromFailFromSeaport() (gas: 82187)
TestNewLoan:testBuyNowPayLater() (gas: 1143307)
TestNewLoan:testNewLoanERC721CollateralDefaultTerms2():((uint256,address,address,address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],(address,bytes,address,bytes,address,bytes))) (gas: 982374)
TestNewLoan:testNewLoanERC721CollateralLessDebtThanOffered():((uint256,address,address,address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256)[],(address,bytes,address,bytes,address,bytes))) (gas: 982708)
TestNewLoan:testNewLoanRefinanceNew() (gas: 702267)
TestNewLoan:testSettleLoan() (gas: 1223453)
TestRepayLoan:testRepayLoan() (gas: 683942)
TestStarLiteUtils:testEncodeReceivedWithRecipient() (gas: 17955)
TestStarLiteUtils:testSpentToReceived() (gas: 17708)
TestStarLiteUtils:testValidateSaltOpt(address,bytes32) (runs: 256, μ: 26479, ~: 26479)
Expand Down
Loading

0 comments on commit f013dd4

Please sign in to comment.