mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
cumulus: fix test runtimes panic (#2039)
the min slot duration should be 0 only if the `experimental` feature is enabled. otherwise, the runtime will panic on a division by 0.
This commit is contained in:
@@ -408,8 +408,9 @@ impl<T: Config> OnTimestampSet<T::Moment> for Pallet<T> {
|
||||
let timestamp_slot = moment / slot_duration;
|
||||
let timestamp_slot = Slot::from(timestamp_slot.saturated_into::<u64>());
|
||||
|
||||
assert!(
|
||||
CurrentSlot::<T>::get() == timestamp_slot,
|
||||
assert_eq!(
|
||||
CurrentSlot::<T>::get(),
|
||||
timestamp_slot,
|
||||
"Timestamp slot must match `CurrentSlot`"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user