Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions frame/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ use sp_npos_elections::{
};
pub use weights::WeightInfo;

/// The default solution type used in substrate-node with 24 maximum winners. A runtime can customize this to their needs.
/// The default solution type used in substrate-node with 24 maximum votes per voter. A runtime can customize this to their needs.
pub mod default_solution {
Copy link
Contributor

Choose a reason for hiding this comment

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

Honestly I put this mostly here so that it can be blindly used in tests/benchmarks etc. Polkadot or any other chain should probably generate their own version.

use super::*;
pub use sp_npos_elections::CompactSolution;
Expand Down Expand Up @@ -1402,8 +1402,8 @@ decl_module! {
}

fn integrity_test() {
// Ensure the size of both ValidatorIndex and NominatorIndex. They both need to be well
// below usize.
// Ensure the size of both ValidatorIndex and NominatorIndex. They both need to be less or
// equal to usize.
assert!(size_of::<ValidatorIndexOf<T>>() <= size_of::<usize>());
assert!(size_of::<ValidatorIndexOf<T>>() <= size_of::<u32>());
assert!(size_of::<NominatorIndexOf<T>>() <= size_of::<usize>());
Expand Down Expand Up @@ -2276,7 +2276,7 @@ decl_module! {
}
}

impl<T: Config> Module<T> {
impl<T: Config> Module<T> {
/// The total balance that can be slashed from a stash account as of right now.
pub fn slashable_balance_of(stash: &T::AccountId) -> BalanceOf<T> {
// Weight note: consider making the stake accessible through stash.
Expand Down