-
Notifications
You must be signed in to change notification settings - Fork 62
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: withdraw unit tests #529
Conversation
2b48d98
to
425064e
Compare
425064e
to
5c7c28d
Compare
5c7c28d
to
6c40769
Compare
f68a214
to
95da1b5
Compare
95da1b5
to
3e42aa2
Compare
3e42aa2
to
79bdc82
Compare
79bdc82
to
031864a
Compare
ad292e1
to
714ed00
Compare
7c7b1f3
to
919232a
Compare
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.
Pushed a failed test. We need to test all values properly and not only replicate the formulas in the contract.
919232a
to
1ce9d22
Compare
1ce9d22
to
dd742ae
Compare
While reviewing this test I noticed that the total amount of minted rewards was not being distributed to the users and manager, there was a small amount that remained locked in the contract. After debugging I found that the cause of this small amount was a precision loss in the calculation of As it is calculated with the following formula I applied that change in the commit Increase accNxmPerRewardsShare precision Let me know your thoughts on this @shark0der |
c78ba7c
to
2a1a40c
Compare
The
where "1" was actually "1 wei" The new value represents
which makes perfect sense and solves the precision loss issue. |
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.
Right now it seems to me that all tests are using a single staker (unless I missed something). Could you please add a new test where 2+ stakers would deposit and withdraw their stake and rewards? I'm not expecting to discover any issues, but just in case, you know!
0b1b231
to
996f9ec
Compare
996f9ec
to
71f7a10
Compare
71f7a10
to
f047539
Compare
f047539
to
5d510a3
Compare
Context
Closes #491
Changes proposed in this pull request
Added
Withdraw
event toStakingPool
contract andwithdrawNXMStakeAndRewards
method toTokenControllerMock
. Also in setup updatemaster
address for tokenController.Test plan
Added unit tests to
StakingPool/withdraw.js
.Checklist
Review
When reviewing a PR, please indicate intention in comments using the following emojis: