Skip to content

feat: add feeamm tests#1292

Merged
0xKitsune merged 8 commits intomainfrom
howy/add-feeamm-tests
Dec 9, 2025
Merged

feat: add feeamm tests#1292
0xKitsune merged 8 commits intomainfrom
howy/add-feeamm-tests

Conversation

@howydev
Copy link
Copy Markdown
Contributor

@howydev howydev commented Dec 8, 2025

This bumps fee amm test coverage of {lines, function, branches} from ~30-40% to 100%

No errors when run with foundry-tempo locally

@howydev howydev requested a review from Zygimantass as a code owner December 8, 2025 11:38
@vercel
Copy link
Copy Markdown

vercel bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
tempo-docs Ready Ready Preview Comment Dec 9, 2025 2:02am

This PR updates various failing feeAMM tests introduces in
`howy/add-feeamm-tests`.
0xKitsune and others added 3 commits December 8, 2025 19:37
This PR updates the feeAMM to return custom errors rather than strings
to match the reference contract.
Copy link
Copy Markdown
Contributor

@0xKitsune 0xKitsune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets plan to further increase fuzzing for functions like burn, mintWithValidatorToken, etc. in a subsequent PR.

Comment on lines +131 to +135
try amm.mintWithValidatorToken(address(eurToken), address(validatorToken), 1e18, alice) {
revert CallShouldHaveReverted();
} catch (bytes memory err) {
assertEq(err, abi.encodeWithSelector(IFeeAMM.InvalidCurrency.selector));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should test both cases when the user token is USD but the validator token is not, as well as when the user token is non-USD but the validator token is.

@0xKitsune 0xKitsune merged commit bb8f386 into main Dec 9, 2025
24 checks passed
@0xKitsune 0xKitsune deleted the howy/add-feeamm-tests branch December 9, 2025 02:54
unbalancedparentheses pushed a commit to unbalancedparentheses/tempo that referenced this pull request Feb 23, 2026
This bumps fee amm test coverage of {lines, function, branches} from
~30-40% to 100%

No errors when run with foundry-tempo locally

---------

Co-authored-by: 0xKitsune <77890308+0xKitsune@users.noreply.github.com>
Co-authored-by: 0xKitsune <0xkitsune@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants