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

[NPoS] Some simple refactors to Delegate Staking #4981

Merged
merged 9 commits into from
Jul 19, 2024
Merged

Conversation

Ank4n
Copy link
Contributor

@Ank4n Ank4n commented Jul 9, 2024

Changes

  • fn update_payee is renamed to fn set_payee in the trait StakingInterface since there is also a call Staking::update_payee which does something different, ie used for migrating deprecated Controller accounts.
  • set_payee does not re-dispatch, only mutates ledger.
  • Fix rustdocs for NominationPools::join.
  • Add an implementation note about why we cannot allow existing stakers to join/bond_extra into the pool.

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable-int
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6660114

@Ank4n Ank4n changed the title DelegateStake refactors. [NPoS] Some simple refactors to Delegate Staking Jul 11, 2024
@Ank4n Ank4n added R0-silent Changes should not be mentioned in any release notes T2-pallets This PR/Issue is related to a particular pallet. labels Jul 11, 2024
@Ank4n Ank4n marked this pull request as ready for review July 11, 2024 04:38
@Ank4n Ank4n requested a review from a team as a code owner July 11, 2024 04:38
@Ank4n Ank4n requested a review from gpestana July 11, 2024 04:39
Copy link
Contributor

@gpestana gpestana left a comment

Choose a reason for hiding this comment

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

LGMT. However you say in the PR description:

fn update_payee is renamed to fn set_payee in the trait StakingInterface since there is also a call Staking::update_payee which does something completely different.

but Staking::update_payee seems to do pretty much the same, or am I missing something here?

@Ank4n
Copy link
Contributor Author

Ank4n commented Jul 12, 2024

LGMT. However you say in the PR description:

fn update_payee is renamed to fn set_payee in the trait StakingInterface since there is also a call Staking::update_payee which does something completely different.

but Staking::update_payee seems to do pretty much the same, or am I missing something here?

update_payee is used to migrate RewardDestination::Controller accounts.

@Ank4n Ank4n requested a review from kianenigma July 13, 2024 09:57
RawOrigin::Signed(stash.clone()).into(),
RewardDestination::Account(reward_acc.clone()),
)
let ledger = Self::ledger(Stash(stash.clone()))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

does this write back to storage?

@Ank4n Ank4n enabled auto-merge July 18, 2024 21:46
@Ank4n Ank4n added this pull request to the merge queue Jul 18, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 18, 2024
@Ank4n Ank4n added this pull request to the merge queue Jul 19, 2024
Merged via the queue into master with commit 394ea70 Jul 19, 2024
158 of 159 checks passed
@Ank4n Ank4n deleted the ankan/ds-refactor branch July 19, 2024 17:14
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
## Changes
- `fn update_payee` is renamed to `fn set_payee` in the trait
`StakingInterface` since there is also a call `Staking::update_payee`
which does something different, ie used for migrating deprecated
`Controller` accounts.
- `set_payee` does not re-dispatch, only mutates ledger.
- Fix rustdocs for `NominationPools::join`.
- Add an implementation note about why we cannot allow existing stakers
to join/bond_extra into the pool.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T2-pallets This PR/Issue is related to a particular pallet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants