diff --git a/frame/babe/src/lib.rs b/frame/babe/src/lib.rs index fb1e32e5350b5..6eecf2675291c 100644 --- a/frame/babe/src/lib.rs +++ b/frame/babe/src/lib.rs @@ -401,10 +401,10 @@ pub mod pallet { pub fn plan_config_change( origin: OriginFor, config: NextConfigDescriptor, - ) -> DispatchResultWithPostInfo { + ) -> DispatchResult { ensure_root(origin)?; PendingEpochConfigChange::::put(config); - Ok(().into()) + Ok(()) } } } diff --git a/frame/im-online/src/lib.rs b/frame/im-online/src/lib.rs index 0290c564ec599..bddb286fad739 100644 --- a/frame/im-online/src/lib.rs +++ b/frame/im-online/src/lib.rs @@ -397,7 +397,7 @@ pub mod pallet { // since signature verification is done in `validate_unsigned` // we can skip doing it here again. _signature: ::Signature, - ) -> DispatchResultWithPostInfo { + ) -> DispatchResult { ensure_none(origin)?; let current_session = T::ValidatorSet::session_index(); @@ -417,7 +417,7 @@ pub mod pallet { &network_state ); - Ok(().into()) + Ok(()) } else if exists { Err(Error::::DuplicatedHeartbeat)? } else { diff --git a/frame/im-online/src/tests.rs b/frame/im-online/src/tests.rs index 5ce931875b9a6..f100bd71c34f6 100644 --- a/frame/im-online/src/tests.rs +++ b/frame/im-online/src/tests.rs @@ -114,7 +114,7 @@ fn heartbeat( authority_index: u32, id: UintAuthorityId, validators: Vec, -) -> dispatch::DispatchResultWithPostInfo { +) -> dispatch::DispatchResult { use frame_support::unsigned::ValidateUnsigned; let heartbeat = Heartbeat { diff --git a/frame/nicks/src/lib.rs b/frame/nicks/src/lib.rs index a6d2415ab96ef..45a0dc477b1d9 100644 --- a/frame/nicks/src/lib.rs +++ b/frame/nicks/src/lib.rs @@ -141,7 +141,7 @@ pub mod pallet { /// - One event. /// # #[pallet::weight(50_000_000)] - pub(super) fn set_name(origin: OriginFor, name: Vec) -> DispatchResultWithPostInfo { + pub(super) fn set_name(origin: OriginFor, name: Vec) -> DispatchResult { let sender = ensure_signed(origin)?; ensure!(name.len() >= T::MinLength::get() as usize, Error::::TooShort); @@ -158,7 +158,7 @@ pub mod pallet { }; >::insert(&sender, (name, deposit)); - Ok(().into()) + Ok(()) } /// Clear an account's name and return the deposit. Fails if the account was not named. @@ -172,7 +172,7 @@ pub mod pallet { /// - One event. /// # #[pallet::weight(70_000_000)] - pub(super) fn clear_name(origin: OriginFor) -> DispatchResultWithPostInfo { + pub(super) fn clear_name(origin: OriginFor) -> DispatchResult { let sender = ensure_signed(origin)?; let deposit = >::take(&sender).ok_or(Error::::Unnamed)?.1; @@ -181,7 +181,7 @@ pub mod pallet { debug_assert!(err_amount.is_zero()); Self::deposit_event(Event::::NameCleared(sender, deposit)); - Ok(().into()) + Ok(()) } /// Remove an account's name and take charge of the deposit. @@ -201,7 +201,7 @@ pub mod pallet { pub(super) fn kill_name( origin: OriginFor, target: ::Source - ) -> DispatchResultWithPostInfo { + ) -> DispatchResult { T::ForceOrigin::ensure_origin(origin)?; // Figure out who we're meant to be clearing. @@ -212,7 +212,7 @@ pub mod pallet { T::Slashed::on_unbalanced(T::Currency::slash_reserved(&target, deposit.clone()).0); Self::deposit_event(Event::::NameKilled(target, deposit)); - Ok(().into()) + Ok(()) } /// Set a third-party account's name with no deposit. @@ -232,7 +232,7 @@ pub mod pallet { origin: OriginFor, target: ::Source, name: Vec - ) -> DispatchResultWithPostInfo { + ) -> DispatchResult { T::ForceOrigin::ensure_origin(origin)?; let target = T::Lookup::lookup(target)?; @@ -240,7 +240,7 @@ pub mod pallet { >::insert(&target, (name, deposit)); Self::deposit_event(Event::::NameForced(target)); - Ok(().into()) + Ok(()) } } } diff --git a/frame/timestamp/src/lib.rs b/frame/timestamp/src/lib.rs index 7c553b1e4b82f..dde635c6a8a30 100644 --- a/frame/timestamp/src/lib.rs +++ b/frame/timestamp/src/lib.rs @@ -183,7 +183,7 @@ pub mod pallet { T::WeightInfo::set(), DispatchClass::Mandatory ))] - pub(super) fn set(origin: OriginFor, #[pallet::compact] now: T::Moment) -> DispatchResultWithPostInfo { + pub(super) fn set(origin: OriginFor, #[pallet::compact] now: T::Moment) -> DispatchResult { ensure_none(origin)?; assert!(!DidUpdate::::exists(), "Timestamp must be updated only once in the block"); let prev = Self::now(); @@ -196,7 +196,7 @@ pub mod pallet { >::on_timestamp_set(now); - Ok(().into()) + Ok(()) } }