Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
fix duration check
Browse files Browse the repository at this point in the history
  • Loading branch information
nuke-web3 committed Sep 13, 2022
1 parent ea0f3e4 commit 6cb73be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frame/safe-mode/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ pub mod pallet {
/// Emits an [`Event::Enabled`] event on success.
#[pallet::weight(0)]
pub fn force_enable(origin: OriginFor<T>) -> DispatchResult {
let duration = T::EnableOrigin::ensure_origin(origin)?;
T::EnableOrigin::ensure_origin(origin)?;

let duration = T::EnableDuration::get();
Self::do_enable(None, duration)
}

Expand All @@ -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<T>) -> DispatchResult {
let duration = T::ExtendOrigin::ensure_origin(origin)?;
T::ExtendOrigin::ensure_origin(origin)?;

let duration = T::ExtendDuration::get();
Self::do_extend(None, duration)
}

Expand Down

0 comments on commit 6cb73be

Please sign in to comment.