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

Pooled Staking Runtime API #259

Closed
wants to merge 8 commits into from
Closed

Conversation

nanocryk
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 12, 2023

Master coverage: 71.72%
Coverage generated "Wed Sep 20 14:58:51 UTC 2023":
https://d3gkbsry1ehhqi.cloudfront.net/tanssi-coverage/pulls/259/index.html
Pull coverage: 71.80%

@tmpolaczyk
Copy link
Contributor

You need to update api-augment:

cd typescript-api
pnpm tsx ./scripts/generate-types.ts

@girazoki
Copy link
Collaborator

I would suggest we use the same procedure as in the CI. Compile the node and do:

cd typescript-api
pnpm install
pnpm create-local-interfaces

@girazoki
Copy link
Collaborator

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> {
Copy link
Contributor

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?

@tmpolaczyk
Copy link
Contributor

Also can you add some integration tests?

@nanocryk nanocryk closed this Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants