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

withdraw reward takes reward to my balance but not to pay off my staking debt first #84

Closed
kevingzhang opened this issue Jul 11, 2021 · 4 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@kevingzhang
Copy link
Contributor

I have made some reward. I also have staking debt not paid off yet.
When I click "withdraw reward", we should pay off the debt first. But all of the reward goes to my account balance. not used to pay off the debt

@liyangwood
Copy link
Contributor

@raindust
目前应该是在没有还清debt之前是不会有收益的吧,那理论上kevin的这种情况不应该出现吧。
请确认一下。

@liyangwood liyangwood assigned raindust and unassigned liyangwood Jul 12, 2021
@raindust
Copy link
Contributor

这个情况不会发生,在还清debt之前不可能会记录reward收益。这块之前也有单元测试,我刚又对收益计算的主要逻辑加了单元测试:tearust/tea-camellia@8c9e3e8 再次验证没有问题。
如果还有疑问可以在 https://github.com/tearust/tea-camellia/blob/main/pallets/cml/src/staking.rs#L88-L113 这里阅读代码

@raindust raindust assigned kevingzhang and unassigned raindust Jul 12, 2021
@kevingzhang
Copy link
Contributor Author

今天我重现了这个错误. 实际上是另外一个 bug 引起的. Layer1 tearust/tea-camellia#21
and #93

这些都是同一个 bug. 目前还没有解决

@kevingzhang kevingzhang added the duplicate This issue or pull request already exists label Jul 12, 2021
@kevingzhang kevingzhang assigned raindust and unassigned kevingzhang Jul 12, 2021
@raindust
Copy link
Contributor

update in tearust/tea-camellia#21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants