add an absolute measure of election score on-chain as a parameter (#8903)

* add an absolute measure of election score on-chain as a parameter

* make it storage item

* line width

* some nits

* Apply suggestions from code review

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* make a few more things pub

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Kian Paimani
2021-05-26 10:49:45 +02:00
committed by GitHub
parent ee13ff2947
commit 0d13e20b35
5 changed files with 74 additions and 10 deletions
@@ -154,7 +154,7 @@ decl_storage! {
decl_module! {
/// A public part of the pallet.
pub struct Module<T: Config<I>, I: Instance = DefaultInstance> for enum Call where origin: T::Origin {
fn on_initialize(n: T::BlockNumber) -> Weight {
fn on_initialize(_n: T::BlockNumber) -> Weight {
use primitives::LeafDataProvider;
let leaves = Self::mmr_leaves();
let peaks_before = mmr::utils::NodesUtils::new(leaves).number_of_peaks();