mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 22:01:04 +00:00
Add extra docs to on_initialize (#7552)
* Add some extra on_initialize docs. * Address review comments.
This commit is contained in:
@@ -1427,6 +1427,9 @@ pub trait GetCallMetadata {
|
|||||||
#[impl_for_tuples(30)]
|
#[impl_for_tuples(30)]
|
||||||
pub trait OnFinalize<BlockNumber> {
|
pub trait OnFinalize<BlockNumber> {
|
||||||
/// The block is being finalized. Implement to have something happen.
|
/// The block is being finalized. Implement to have something happen.
|
||||||
|
///
|
||||||
|
/// NOTE: This function is called AFTER ALL extrinsics in a block are applied,
|
||||||
|
/// including inherent extrinsics.
|
||||||
fn on_finalize(_n: BlockNumber) {}
|
fn on_finalize(_n: BlockNumber) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1438,6 +1441,10 @@ pub trait OnInitialize<BlockNumber> {
|
|||||||
/// The block is being initialized. Implement to have something happen.
|
/// The block is being initialized. Implement to have something happen.
|
||||||
///
|
///
|
||||||
/// Return the non-negotiable weight consumed in the block.
|
/// Return the non-negotiable weight consumed in the block.
|
||||||
|
///
|
||||||
|
/// NOTE: This function is called BEFORE ANY extrinsic in a block is applied,
|
||||||
|
/// including inherent extrinsics. Hence for instance, if you runtime includes
|
||||||
|
/// `pallet_timestamp`, the `timestamp` is not yet up to date at this point.
|
||||||
fn on_initialize(_n: BlockNumber) -> crate::weights::Weight { 0 }
|
fn on_initialize(_n: BlockNumber) -> crate::weights::Weight { 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user