-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add on_idle hook #8209
Add on_idle hook #8209
Conversation
|
should we allow decl_module to implement on_idle? I think we can just make decl_module always define the default on_idle and not allow user to use its own implementation. EDIT: but now that it is implemented, we can keep it. |
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Guillaume Thiolliere <[email protected]>
gui1117
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, some doc nitpicks.
Also doc of expansion of pallet macro should be updated: https://substrate.dev/rustdocs/v3.0.0/frame_support/attr.pallet.html#macro-expansion-2
frame/support/src/traits.rs
Outdated
| /// The block is being finalized. Implement to have something happen. | ||
| fn on_finalize(_n: BlockNumber) {} | ||
|
|
||
| /// The block is being finalized. Implement to have something happen using the remaining weight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can copy/paste all the doc of OnIdle here and also link to it, something like:
"The function can be used to implement [OnIdle]."
Because pallet user probably want to read doc from this trait.
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Alexander Popiak <[email protected]>
apopiak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some minor docs nitpicks
Co-authored-by: Alexander Popiak <[email protected]>
Co-authored-by: Alexander Popiak <[email protected]>
Co-authored-by: Alexander Popiak <[email protected]>
This PR implements the on_idle hook as discussed in issue #4064