Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Prev Previous commit
Next Next commit
Reversions
  • Loading branch information
gavofyork committed Oct 20, 2021
commit b26a8c56c339a7760e32456bdd3ccaf66c5296b2
12 changes: 6 additions & 6 deletions frame/support/src/traits/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub trait OnInitialize<BlockNumber> {
}
}

#[impl_for_tuples(60)]
#[impl_for_tuples(30)]
impl<BlockNumber: Clone> OnInitialize<BlockNumber> for Tuple {
fn on_initialize(n: BlockNumber) -> crate::weights::Weight {
let mut weight = 0;
Expand All @@ -50,7 +50,7 @@ impl<BlockNumber: Clone> OnInitialize<BlockNumber> for Tuple {
/// The block finalization trait.
///
/// Implementing this lets you express what should happen for your pallet when the block is ending.
#[impl_for_tuples(60)]
#[impl_for_tuples(30)]
pub trait OnFinalize<BlockNumber> {
/// The block is being finalized. Implement to have something happen.
///
Expand Down Expand Up @@ -79,7 +79,7 @@ pub trait OnIdle<BlockNumber> {
}
}

#[impl_for_tuples(60)]
#[impl_for_tuples(30)]
impl<BlockNumber: Copy + AtLeast32BitUnsigned> OnIdle<BlockNumber> for Tuple {
fn on_idle(n: BlockNumber, remaining_weight: crate::weights::Weight) -> crate::weights::Weight {
let on_idle_functions: &[fn(
Expand All @@ -105,7 +105,7 @@ impl<BlockNumber: Copy + AtLeast32BitUnsigned> OnIdle<BlockNumber> for Tuple {
/// Implementing this trait for a pallet let's you express operations that should
/// happen at genesis. It will be called in an externalities provided environment and
/// will see the genesis state after all pallets have written their genesis state.
#[impl_for_tuples(60)]
#[impl_for_tuples(30)]
pub trait OnGenesis {
/// Something that should happen at genesis.
fn on_genesis() {}
Expand Down Expand Up @@ -187,7 +187,7 @@ pub trait OnRuntimeUpgrade {
}
}

#[impl_for_tuples(60)]
#[impl_for_tuples(30)]
impl OnRuntimeUpgrade for Tuple {
fn on_runtime_upgrade() -> crate::weights::Weight {
let mut weight = 0;
Expand Down Expand Up @@ -316,7 +316,7 @@ pub trait GenesisBuild<T, I = ()>: Default + sp_runtime::traits::MaybeSerializeD
}

/// A trait which is called when the timestamp is set in the runtime.
#[impl_for_tuples(60)]
#[impl_for_tuples(30)]
pub trait OnTimestampSet<Moment> {
/// Called when the timestamp is set.
fn on_timestamp_set(moment: Moment);
Expand Down