-
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
Add tests for zUnipool #2
base: fix/gitcoinTesting
Are you sure you want to change the base?
Conversation
@Bobface Thank you for this. However, I noticed that you have mentioned that the tx and test are failing. Sadly, we will need to know why? We have been digging this issue at our end too. Can you share the test logs with me? |
@amateur-dev The reason the tests are failing is because the For example, your wrote: This is not the case. The second user gets a tiny amount less LP tokens than the first user. It is almost at a price ration of 1:1 but not exactly - the test detects that difference and fails which is what it is supposed to do in that situation. See the log in my original message:
By the requirements the second user is supposed to have Here is the full log of test case 2 failing:
Of course I can update the tests to account for that slight difference and make them pass. However it was unclear to me if that is something you would want, which is why I have been waiting on your feedback. Let me know how you want to continue. |
hey @Bobface I just went through the tests on a high level, correct me if I am wrong, so we have not been able to test at all the situations of advanceTime (for 1 week, etc etc). Right? |
@amateur-dev Correct. All tests are passing when we are working with natural time progession. When we try to use |
Test for zUnipool contract
This PR adds tests for the zUnipool contract. The following behaviour is tested as requested in the Gitcoin bounty:
The tests are supposed to run on a forked mainnet. To do that, run
ganache-cli
with the-f
option providing an web3-provider like Infura:ganache-cli -f https://mainnet.infura.io/v3/<API KEY>
. Due to running on a forked mainnet the test might take a while to complete.Result of tests
The tests are currently not passing - the contract seems to behave differently than expected. For example, the second user gets less zUni tokens when depositing after the first user than he provided LP tokens. Here he provided
2000000000000000000
(in wei) LP tokens and only gets1999999872560414474
(in wei) zUni tokens: