Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
More :clean:
  • Loading branch information
emostov committed Jul 19, 2021
commit 8deedee20e8bb87a052f6e1471d0540dcbcdf18d
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions frame/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,15 @@
#![recursion_limit = "128"]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(any(feature = "runtime-benchmarks", test))]
pub mod benchmarking;
#[cfg(any(test, feature = "make-bags"))]
pub mod mock;
#[cfg(any(feature = "runtime-benchmarks", test))]
pub mod testing_utils;
#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;
#[cfg(any(feature = "runtime-benchmarks", test))]
pub mod testing_utils;
#[cfg(any(feature = "runtime-benchmarks", test))]
pub mod benchmarking;


pub mod inflation;
pub mod slashing;
Expand Down
1 change: 0 additions & 1 deletion frame/staking/src/mock/voter_bags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ pub const CONSTANT_RATIO: f64 = 2.0000000000000000;

/// Upper thresholds delimiting the bag list.
// pub const THRESHOLDS: [u64; 65] = [5, 15, 25, 50, 100, 1000, 2000, 3000]; // TODO: switch to this
// @kian I am using the below because it is easier to calculate the next threshold in a loop
pub const THRESHOLDS: [u64; 9] = [10, 20, 30, 40, 50, 60, 1_000, 2_000, 10_000];
2 changes: 1 addition & 1 deletion frame/staking/src/voter_bags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ impl<T: Config> Bag<T> {
assert!(self
.tail()
.and_then(|tail| Some(tail.next().is_none()))
// if there is no head, then there must not be a tail
// if there is no tail, then there must not be a head
.unwrap_or_else(|| self.head.is_none()));
// 3) Iterate all voters and ensure that there are no loops.
let mut seen_in_bag = BTreeSet::new();
Expand Down