Bring back the on_finalize weight of staking. (#8463)

* Bring back the on_finalize weighg of stakin.

* Better logs

* Also make a few things pub

* Fix build

* Add assertions

* Add test.

* remove dbg

* Update frame/election-provider-multi-phase/src/unsigned.rs

* Update frame/staking/src/tests.rs

* Fix

* Fix

* Update frame/election-provider-multi-phase/src/unsigned.rs
This commit is contained in:
Kian Paimani
2021-03-29 11:19:40 +02:00
committed by GitHub
parent d0eee4f1cb
commit 7b2cf33b73
5 changed files with 33 additions and 13 deletions
+5
View File
@@ -1205,6 +1205,11 @@ decl_module! {
}
}
fn on_initialize(_now: T::BlockNumber) -> Weight {
// just return the weight of the on_finalize.
T::DbWeight::get().reads(1)
}
fn on_finalize() {
// Set the start of the first era.
if let Some(mut active_era) = Self::active_era() {