-
Notifications
You must be signed in to change notification settings - Fork 129
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(lockup): add test of unlocking schedule with termination #191
base: lockup-v2.0.0-branch
Are you sure you want to change the base?
Conversation
7320741
to
e5e1321
Compare
e5e1321
to
ad2028e
Compare
Hmm, how is it based on v2 if the code is from the master branch? I suggest we create lockup-v2 branch that corresponds to Also, we need the same test on master (lockup v3), so we can at least demonstrate how the behavior is different between the versions. |
assert_eq!( | ||
contract.get_locked_amount().0, | ||
unvested_amount_at_termination_day | ||
); |
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.
Please, add assert on get_unlocked() == initial lockup amount - terminated
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.
Sorry, I will not add this check because both possible methods are broken
#192 (comment)
I guess they will work for this specific case, but anyway, I don't want to use them, that's a matter of coincidence that they give us the expected result here
P.S. It's still too early to review this; I will ping you separately when I finish the work here
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.
As per our last discussion, let's add this assert anyway, and if it crashes (supposedly in the next test), let's comment it out and leave an explanation why we believe it is not critical
5dd63e2
to
f8dfb76
Compare
We discussed some ideas on how to improve these tests. One of the ideas was to make the same tests on the master branch. This PR is ready to review. |
Actually, I'm not sure whether we need these tests on master at all. I hope no one will use this contract right now; it means that we can stop spending time on it and invest it in other issues. |
Created the test for v3.0.0 |
Warn: it should never be merged, it's based on v2 of lockup contract
The reason of this code is to test the lockup functionality that is used most widely nowadays. We want to be sure how current lockups work