-
Notifications
You must be signed in to change notification settings - Fork 55
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
Pooled Staking Runtime API #259
Conversation
Master coverage: 71.72% |
You need to update api-augment:
|
I would suggest we use the same procedure as in the CI. Compile the node and do:
|
LGTM. Can we add an integration test for this? Both rust and typescript if possible |
candidate: Candidate<T>, | ||
delegator: Delegator<T>, | ||
pool: AllTargetPool, | ||
) -> Option<T::Balance> { |
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.
What does None
mean here? If the stake is 0 this should return Some(0)
, no?
Also can you add some integration tests? |
Stake in currency amount is not available in storage, and instead must be computed from the amount of shares and the value of each share. The pending manual rewards also needs to be computed based on the difference between the pool counter and delegator "checkpoint" times the amount of shares.
To simplify the implementation of UIs, a new Runtime API is added to perform those computations.