-
Notifications
You must be signed in to change notification settings - Fork 968
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
Pool tests #726
base: main
Are you sure you want to change the base?
Pool tests #726
Conversation
Forge code coverage:
|
@@ -456,17 +456,17 @@ library Pool { | |||
} | |||
|
|||
/// @notice Donates the given amount of currency0 and currency1 to the pool | |||
function donate(State storage state, uint256 amount0, uint256 amount1) internal returns (BalanceDelta delta) { | |||
uint128 liquidity = state.liquidity; | |||
function donate(State storage self, uint256 amount0, uint256 amount1) internal returns (BalanceDelta delta) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msotly looks great! just requesting some more assertions etc
state.donate(amount0, amount1); | ||
|
||
test_fuzz_modifyLiquidity(sqrtPriceX96, protocolFee, lpFee, params); | ||
state.donate(amount0, amount1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add checks for state changes after the donation?
}) | ||
); | ||
|
||
state.swap(params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be great to assert the return parameters f swap
are as expected - it returns the protocol fee, swap fee etc
Related Issue
Which issue does this pull request resolve?
Description of changes