Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Rpc for pending rewards #11831

Merged
merged 52 commits into from
Jul 26, 2022
Merged

Rpc for pending rewards #11831

merged 52 commits into from
Jul 26, 2022

Conversation

Szegoo
Copy link
Contributor

@Szegoo Szegoo commented Jul 13, 2022

Closes #11830

polkadot companion: paritytech/polkadot#5784

Polkadot address: 126X27SbhrV19mBFawys3ovkyBS87SGfYwtwa8J2FjHrtbmA

Update

This new runtime api call can be used by wallets to receive the pending rewards of a specific member.

The total pending rewards of a pool is basically the balance of the reward account, minus existential deposit.

@Szegoo
Copy link
Contributor Author

Szegoo commented Jul 13, 2022

Still in progress.

@Szegoo Szegoo changed the title Rpc pending rewards Rpc for pending rewards Jul 14, 2022
@Szegoo
Copy link
Contributor Author

Szegoo commented Jul 14, 2022

@kianenigma Could you review this?

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks in the right path! just needs to make sure it handles non-existent members correctly.

@kianenigma kianenigma added A0-please_review Pull request needs code review. B5-clientnoteworthy C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. labels Jul 14, 2022
@kianenigma
Copy link
Contributor

Also, needs a companion that adds it to Polkadot.

@Szegoo
Copy link
Contributor Author

Szegoo commented Jul 14, 2022

Also, needs a companion that adds it to Polkadot.

I will give it a try.

Copy link
Contributor

@ruseinov ruseinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kianenigma
Copy link
Contributor

\tip medium

@kianenigma
Copy link
Contributor

/tip medium

@substrate-tip-bot
Copy link

A medium tip was successfully submitted for Szegoo (126X27SbhrV19mBFawys3ovkyBS87SGfYwtwa8J2FjHrtbmA on polkadot).

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.polkadot.io#/treasury/tips

frame/nomination-pools/rpc/runtime-api/src/lib.rs Outdated Show resolved Hide resolved
frame/nomination-pools/rpc/src/lib.rs Outdated Show resolved Hide resolved
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
@Szegoo
Copy link
Contributor Author

Szegoo commented Jul 26, 2022

@kianenigma Should I make a new PR when we merge this for the pool's total pending rewards endpoint?

@kianenigma
Copy link
Contributor

@kianenigma Should I make a new PR when we merge this for the pool's total pending rewards endpoint?

I am not sure if it is possible, therefore I removed my comment.

@bkchr bkchr merged commit 5709dfa into paritytech:master Jul 26, 2022
Szegoo added a commit to Szegoo/substrate-docs that referenced this pull request Aug 4, 2022
DaviRain-Su pushed a commit to octopus-network/substrate that referenced this pull request Aug 23, 2022
* rpc pending rewards

* commit

* remove unused imports

* fix

* fix

* fmt

* fix

* fmt

* fix

* docs

* docs & formatting

* better formatting

* temporary fix

* error handling

* fix?

* fmt

* use to_string

* fmt

* fixed error handling

* fix

* rpc added to client

* Update Cargo.toml

* Update Cargo.toml

* fix wrong reward counter

* expose function

* move implementation

* docs

* docs

* docs

* Update lib.rs

* Update lib.rs

* unexpose functions

* unused dependency

* update Cargo.lock

* Update frame/nomination-pools/src/lib.rs

* Update lib.rs

* Update lib.rs

* Update frame/nomination-pools/rpc/runtime-api/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* remove rpc

* remove rpc directory

* final fix

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* rpc pending rewards

* commit

* remove unused imports

* fix

* fix

* fmt

* fix

* fmt

* fix

* docs

* docs & formatting

* better formatting

* temporary fix

* error handling

* fix?

* fmt

* use to_string

* fmt

* fixed error handling

* fix

* rpc added to client

* Update Cargo.toml

* Update Cargo.toml

* fix wrong reward counter

* expose function

* move implementation

* docs

* docs

* docs

* Update lib.rs

* Update lib.rs

* unexpose functions

* unused dependency

* update Cargo.lock

* Update frame/nomination-pools/src/lib.rs

* Update lib.rs

* Update lib.rs

* Update frame/nomination-pools/rpc/runtime-api/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* remove rpc

* remove rpc directory

* final fix

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

nomination-pools: RPC for pending reward
4 participants