Skip to content

Commit

Permalink
fix: remove torus0 on_initialize hook from unregistered pallet_section
Browse files Browse the repository at this point in the history
  • Loading branch information
devwckd authored Jan 27, 2025
1 parent fcb3628 commit be9c69c
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions pallets/torus0/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,19 @@ pub mod pallet {
#[pallet::storage]
pub type BurnConfig<T: Config> = StorageValue<_, BurnConfiguration<T>, ValueQuery>;

#[pallet_section]
pub mod hooks {
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn on_initialize(block_number: BlockNumberFor<T>) -> Weight {
let current_block: u64 = block_number
.try_into()
.ok()
.expect("blockchain won't pass 2 ^ 64 blocks");
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn on_initialize(block_number: BlockNumberFor<T>) -> Weight {
let current_block: u64 = block_number
.try_into()
.ok()
.expect("blockchain won't pass 2 ^ 64 blocks");

burn::adjust_burn::<T>(current_block);
burn::adjust_burn::<T>(current_block);

RegistrationsThisBlock::<T>::set(0);
RegistrationsThisBlock::<T>::set(0);

Weight::default()
}
Weight::default()
}
}

Expand Down

0 comments on commit be9c69c

Please sign in to comment.