From 6cb73befe69faa85dce1b72fea6bfc9e5ce8145f Mon Sep 17 00:00:00 2001 From: Dan Shields Date: Tue, 13 Sep 2022 13:39:49 -0600 Subject: [PATCH] fix duration check --- frame/safe-mode/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frame/safe-mode/src/lib.rs b/frame/safe-mode/src/lib.rs index a0c9356473d0d..d5f9874eb9b75 100644 --- a/frame/safe-mode/src/lib.rs +++ b/frame/safe-mode/src/lib.rs @@ -196,8 +196,9 @@ pub mod pallet { /// Emits an [`Event::Enabled`] event on success. #[pallet::weight(0)] pub fn force_enable(origin: OriginFor) -> DispatchResult { - let duration = T::EnableOrigin::ensure_origin(origin)?; + T::EnableOrigin::ensure_origin(origin)?; + let duration = T::EnableDuration::get(); Self::do_enable(None, duration) } @@ -219,8 +220,9 @@ pub mod pallet { /// Can only be called by the [`Config::ExtendOrigin`] origin. #[pallet::weight(0)] pub fn force_extend(origin: OriginFor) -> DispatchResult { - let duration = T::ExtendOrigin::ensure_origin(origin)?; + T::ExtendOrigin::ensure_origin(origin)?; + let duration = T::ExtendDuration::get(); Self::do_extend(None, duration) }