Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve fuzz testing #50

Merged
merged 4 commits into from
Mar 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: fuzz tests
0xgregthedev committed Mar 26, 2024
commit 8675f45da85eaa6eb9360c7a9abd5da78096e1d1
7 changes: 7 additions & 0 deletions test/fuzz-testing/TestFuzzV1.sol
Original file line number Diff line number Diff line change
@@ -204,6 +204,11 @@ contract TestFuzzV1 is AstariaV1Test, BaseFuzzStarport {

assertEq(additionalTransfers.length, 0, "additional transfers not empty");

// Burn all of the lender's debt token to avoid overflow
vm.startPrank(lender.addr);
erc20s[1].transfer(address(0xdead), erc20s[1].balanceOf(lender.addr));
vm.stopPrank();

Starport.Loan memory refiLoan = loanCopy(goodLoan);
refiLoan.terms.pricingData = newPricingDetails;
refiLoan.debt = SP.applyRefinanceConsiderationToLoan(considerationPayment, carryPayment);
@@ -213,6 +218,8 @@ contract TestFuzzV1 is AstariaV1Test, BaseFuzzStarport {

assertEq(address(goodLoan.debt[0].token), address(refiLoan.debt[0].token), "debt tokens not equal");

vm.assume(refiLoan.issuer != goodLoan.issuer);

_issueAndApproveTarget(refiLoan.debt, account.addr, address(SP));

vm.assume(!willArithmeticOverflow(refiLoan));