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

Test: deposit test #692

Merged
merged 5 commits into from
Oct 31, 2022
Merged

Test: deposit test #692

merged 5 commits into from
Oct 31, 2022

Conversation

haythemsellami
Copy link
Member

@haythemsellami haythemsellami commented Oct 30, 2022

Task: deposit test

Should be merged after #690

Description

This PR add a second test case for deposit()

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Document update

How Has This Been Tested

Please describe how to test to verify the changes. Provide instructions so we can reproduce.

FE Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Added video recordings if it is a UI change

User Facing Checklist

  • I fully understand the user problem this PR is solving
  • I know who the target user is for this PR and have a deep understanding of that user
  • I have tried this flow thinking from the pov of the target user for this PR
  • I (or working w someone on team) have scheduled a user test for this PR (if it is a large change)

@vercel
Copy link

vercel bot commented Oct 30, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
continuouscall ✅ Ready (Inspect) Visit Preview Oct 31, 2022 at 7:01PM (UTC)

@haythemsellami
Copy link
Member Author

haythemsellami commented Oct 30, 2022

Let's try to make code coverage, %branches 90% or more @daryakaviani
Screen Shot 2022-10-30 at 11 44 28 PM

Copy link
Contributor

@daryakaviani daryakaviani left a comment

Choose a reason for hiding this comment

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

lgtm, see note about fuzzing in future


assertEq(bullStrategy.balanceOf(user1), crabToDepositInitially);
assertEq(IEulerDToken(dToken).balanceOf(address(bullStrategy)), usdcToBorrow);
assertTrue(wethToLend.sub(IEulerEToken(eToken).balanceOfUnderlying(address(bullStrategy))) <= 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for this test, but if you add a fuzzing one, note that sometimes it gets to 2 wei difference.


assertEq(bullStrategy.balanceOf(user1).sub(userBullBalanceBefore), bullToMint);
assertEq(IEulerDToken(dToken).balanceOf(address(bullStrategy)).sub(usdcToBorrow), usdcToBorrowSecond);
assertTrue(wethToLendSecond.sub(IEulerEToken(eToken).balanceOfUnderlying(address(bullStrategy)).sub(wethToLend)) <= 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for this test, but if you add a fuzzing one, note that sometimes it gets to 2 wei difference.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added issue #696

Base automatically changed from refactor to main October 31, 2022 18:52
@aleone
Copy link
Contributor

aleone commented Nov 5, 2022

looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants