-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update lastTotalAsset in updateWithdrawQueue #2
Conversation
_setCap(allMarkets[0], firstAmountSupplied); | ||
_setCap(allMarkets[1], secondAmountSupplied); |
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.
Why is it done twice?
vm.expectEmit(); | ||
emit EventsLib.SetWithdrawQueue(ALLOCATOR, expectedWithdrawQueue); |
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.
Cool to have tested this here but I think it's out of context, better than removing it now, but next time I think it's better to have isolated purpose tests 😁
assertEq(Id.unwrap(vault.withdrawQueue(1)), Id.unwrap(expectedWithdrawQueue[1])); | ||
assertEq(Id.unwrap(vault.withdrawQueue(2)), Id.unwrap(expectedWithdrawQueue[2])); | ||
assertFalse(vault.config(allMarkets[1].id()).enabled); | ||
assertEq(vault.totalAssets(), firstAmountSupplied); |
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.
And we need to check lastTotalAssets! And check that the fee accrued after the next interaction is as expected!
Fixes https://cantina.xyz/ai/8409a0ce-6c21-4cc9-8ef2-bd77ce7425af/findings/5a81700d-ff95-422a-be37-e24f7e4d50a9