substrate
substrate copied to clipboard
Deprecate individual hooks traits like `OnInitialize`
because as far as I know, as as of FRAME v2, they are not really used in any meaningful way. I recall Gui mentioning this, and from myself scouting the code, I don't see a strong reason to have them either.
The only benefit of the current separation is that you could manually implement OnInitialize
for your pallet, without using #[hooks]
, and not implement the other traits.
But, through the default #[hooks], a pallet will always implement all of the on_xxx
functions anyways, so there is not much point in having these separate traits.
This would probably clean some of the trait bounds in frame-executive
.
All in all, we should mark the OnInitialize
, OnFinalize
and anything else that's already in Hooks
with #[deprecated]
, and stop using it in substrate. We should use Hooks
instead.
cc @wirednkod
I'll take this issue. Thank you @kianenigma
@wirednkod what's up?