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

Fix Staking and Democracy locking #3606

Merged
merged 6 commits into from
Sep 13, 2019
Merged

Fix Staking and Democracy locking #3606

merged 6 commits into from
Sep 13, 2019

Conversation

kianenigma
Copy link
Contributor

@kianenigma kianenigma commented Sep 12, 2019

  • Adds a parameter to allow election::vote() to define how much stake should be locked with the vote (with a configurable minimum)
  • Changes lock type in Staking
  • Some missing docs and reformats in election module.
  • re-organize all election tests into a mock file and groups of tests prefixed with
    • fn chunking_xxx(): everything about the vectors being chunked.
    • fn voting_xxx(): everything about voting rules.
    • fn candidacy_xxx(): everything about candidacy rules.
    • fn election_xxx(): e2e tests about election rounds carry etc.
    • fn pot_xxx(): everything about the weighted, decaying vote pot, which maybe we should have named differently.

closes #3564

TODO: make a PR for polkadot once MinimumVotingLock is settled.

}

#[test]
fn voting_cannot_lock_less_than_limit() {
Copy link
Contributor Author

@kianenigma kianenigma Sep 12, 2019

Choose a reason for hiding this comment

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

this + the following two are the main tests which are related to this PR, this rest of this file is almost the same with some minor style changes.

@kianenigma kianenigma added the A0-please_review Pull request needs code review. label Sep 12, 2019
///
/// Furthermore, each vector of scalars is chunked with the cap of `APPROVAL_SET_SIZE`.

// A list of votes for each voter. The votes are stored as numeric values and parsed in a
Copy link
Member

Choose a reason for hiding this comment

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

why replace the doc-comment as a dumb-comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, I started using this plugin to wrap doc-comment lines and... it seems to have failed me here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(probably because it inferred the prefix from the line above it "// ---- persistent state (always relevant, changes constantly)" )

@gavofyork
Copy link
Member

needs a runtime bump

@kianenigma kianenigma merged commit 2fc627d into master Sep 13, 2019
@kianenigma kianenigma deleted the kiz-locking-fix branch September 13, 2019 06:52
svyatonik pushed a commit that referenced this pull request Sep 17, 2019
* Fix locking.

* Some reformattings.

* Fix build.

* Fix doc comment.

* Bump.
Demi-Marie pushed a commit to Demi-Marie/substrate that referenced this pull request Sep 17, 2019
* Fix locking.

* Some reformattings.

* Fix build.

* Fix doc comment.

* Bump.
en pushed a commit to en/substrate that referenced this pull request Sep 24, 2019
* Fix locking.

* Some reformattings.

* Fix build.

* Fix doc comment.

* Bump.
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parameterise locked stake everywhere + Lock for all WithdrawReasons
2 participants