Adds new event phase Initialization (#5302)

* Adds new event phase `Initialization`

Every event that was deposited inside of `on_initialize` was assigned to
the `ApplyExtrinsic(0)` phase which wasn't correct. This pr introduces a
new phase `Initialization`. This is the new phase while initializing
a block. After initialization we switch to `ApplyExtrinsic(N)` and at
the end to `Finalization` as before.

* Set `ExecutionPhase` in `initialize`

* Increment `spec_version`
This commit is contained in:
Bastian Köcher
2020-03-20 19:34:51 +01:00
committed by GitHub
parent 459557aadc
commit 7693bd5ee5
5 changed files with 96 additions and 71 deletions
+2
View File
@@ -199,6 +199,8 @@ where
<frame_system::Module<System>>::register_extra_weight_unchecked(
<AllModules as WeighBlock<System::BlockNumber>>::on_finalize(*block_number)
);
frame_system::Module::<System>::note_finished_initialize();
}
/// Returns if the runtime was upgraded since the last time this function was called.