Skip to content

Commit 82ab91c

Browse files
author
Grigoriy Simonov
committed
fix: move CurrentLogs are empty assert to evm pallet
1 parent 2a94e33 commit 82ab91c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

frame/ethereum/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ pub mod pallet {
224224
));
225225
}
226226
Pending::<T>::kill();
227-
assert_eq!(<CurrentLogs<T>>::get().len(), 0, "fake transaction finalizer is not initialized, as some logs was left after block is finished");
228227
}
229228

230229
fn on_initialize(_: T::BlockNumber) -> Weight {

frame/evm/src/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ pub mod pallet {
163163
}
164164
}
165165

166+
#[pallet::hooks]
167+
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
168+
fn on_finalize(_: T::BlockNumber) {
169+
assert_eq!(<CurrentLogs<T>>::get().len(), 0, "fake transaction finalizer is not initialized, as some logs was left after block is finished");
170+
}
171+
}
172+
166173
#[pallet::call]
167174
impl<T: Config> Pallet<T> {
168175
/// Withdraw balance from EVM into currency/balances pallet.

0 commit comments

Comments
 (0)