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

Update lastTotalAsset in updateWithdrawQueue #2

Closed
wants to merge 3 commits into from

Conversation

Jean-Grimal
Copy link
Contributor

src/MetaMorpho.sol Outdated Show resolved Hide resolved
src/MetaMorpho.sol Outdated Show resolved Hide resolved
src/MetaMorpho.sol Outdated Show resolved Hide resolved
src/MetaMorpho.sol Outdated Show resolved Hide resolved
Comment on lines +168 to +169
_setCap(allMarkets[0], firstAmountSupplied);
_setCap(allMarkets[1], secondAmountSupplied);
Copy link
Contributor

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?

Comment on lines +195 to +196
vm.expectEmit();
emit EventsLib.SetWithdrawQueue(ALLOCATOR, expectedWithdrawQueue);
Copy link
Contributor

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);
Copy link
Contributor

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!

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