reset events before apply runtime upgrade (#10620)

* reset events before apply runtime upgrade

* fix tests

* add test

* update comment

* Update frame/system/src/lib.rs

* trigger CI

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Xiliang Chen
2022-01-12 21:22:29 +13:00
committed by GitHub
parent 79cab81364
commit d346028a9d
11 changed files with 79 additions and 83 deletions
+4 -2
View File
@@ -326,7 +326,8 @@ pub fn start_session(session_index: SessionIndex) {
System::parent_hash()
};
System::initialize(&(i as u64 + 1), &parent_hash, &Default::default(), Default::default());
System::reset_events();
System::initialize(&(i as u64 + 1), &parent_hash, &Default::default());
System::set_block_number((i + 1).into());
Timestamp::set_timestamp(System::block_number() * 6000);
@@ -345,7 +346,8 @@ pub fn start_era(era_index: EraIndex) {
}
pub fn initialize_block(number: u64, parent_hash: H256) {
System::initialize(&number, &parent_hash, &Default::default(), Default::default());
System::reset_events();
System::initialize(&number, &parent_hash, &Default::default());
}
pub fn generate_equivocation_proof(