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

Commit 3f11019

Browse files
authored
Update pallet macro migrations. (#8766)
* Update pallet macro migrations. * Revert dispatchable call visibility changes. * fmt
1 parent 10b9da5 commit 3f11019

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

frame/babe/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,10 @@ pub mod pallet {
401401
pub fn plan_config_change(
402402
origin: OriginFor<T>,
403403
config: NextConfigDescriptor,
404-
) -> DispatchResultWithPostInfo {
404+
) -> DispatchResult {
405405
ensure_root(origin)?;
406406
PendingEpochConfigChange::<T>::put(config);
407-
Ok(().into())
407+
Ok(())
408408
}
409409
}
410410
}

frame/im-online/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ pub mod pallet {
397397
// since signature verification is done in `validate_unsigned`
398398
// we can skip doing it here again.
399399
_signature: <T::AuthorityId as RuntimeAppPublic>::Signature,
400-
) -> DispatchResultWithPostInfo {
400+
) -> DispatchResult {
401401
ensure_none(origin)?;
402402

403403
let current_session = T::ValidatorSet::session_index();
@@ -417,7 +417,7 @@ pub mod pallet {
417417
&network_state
418418
);
419419

420-
Ok(().into())
420+
Ok(())
421421
} else if exists {
422422
Err(Error::<T>::DuplicatedHeartbeat)?
423423
} else {

frame/im-online/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fn heartbeat(
114114
authority_index: u32,
115115
id: UintAuthorityId,
116116
validators: Vec<u64>,
117-
) -> dispatch::DispatchResultWithPostInfo {
117+
) -> dispatch::DispatchResult {
118118
use frame_support::unsigned::ValidateUnsigned;
119119

120120
let heartbeat = Heartbeat {

frame/nicks/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub mod pallet {
141141
/// - One event.
142142
/// # </weight>
143143
#[pallet::weight(50_000_000)]
144-
pub(super) fn set_name(origin: OriginFor<T>, name: Vec<u8>) -> DispatchResultWithPostInfo {
144+
pub(super) fn set_name(origin: OriginFor<T>, name: Vec<u8>) -> DispatchResult {
145145
let sender = ensure_signed(origin)?;
146146

147147
ensure!(name.len() >= T::MinLength::get() as usize, Error::<T>::TooShort);
@@ -158,7 +158,7 @@ pub mod pallet {
158158
};
159159

160160
<NameOf<T>>::insert(&sender, (name, deposit));
161-
Ok(().into())
161+
Ok(())
162162
}
163163

164164
/// Clear an account's name and return the deposit. Fails if the account was not named.
@@ -172,7 +172,7 @@ pub mod pallet {
172172
/// - One event.
173173
/// # </weight>
174174
#[pallet::weight(70_000_000)]
175-
pub(super) fn clear_name(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
175+
pub(super) fn clear_name(origin: OriginFor<T>) -> DispatchResult {
176176
let sender = ensure_signed(origin)?;
177177

178178
let deposit = <NameOf<T>>::take(&sender).ok_or(Error::<T>::Unnamed)?.1;
@@ -181,7 +181,7 @@ pub mod pallet {
181181
debug_assert!(err_amount.is_zero());
182182

183183
Self::deposit_event(Event::<T>::NameCleared(sender, deposit));
184-
Ok(().into())
184+
Ok(())
185185
}
186186

187187
/// Remove an account's name and take charge of the deposit.
@@ -201,7 +201,7 @@ pub mod pallet {
201201
pub(super) fn kill_name(
202202
origin: OriginFor<T>,
203203
target: <T::Lookup as StaticLookup>::Source
204-
) -> DispatchResultWithPostInfo {
204+
) -> DispatchResult {
205205
T::ForceOrigin::ensure_origin(origin)?;
206206

207207
// Figure out who we're meant to be clearing.
@@ -212,7 +212,7 @@ pub mod pallet {
212212
T::Slashed::on_unbalanced(T::Currency::slash_reserved(&target, deposit.clone()).0);
213213

214214
Self::deposit_event(Event::<T>::NameKilled(target, deposit));
215-
Ok(().into())
215+
Ok(())
216216
}
217217

218218
/// Set a third-party account's name with no deposit.
@@ -232,15 +232,15 @@ pub mod pallet {
232232
origin: OriginFor<T>,
233233
target: <T::Lookup as StaticLookup>::Source,
234234
name: Vec<u8>
235-
) -> DispatchResultWithPostInfo {
235+
) -> DispatchResult {
236236
T::ForceOrigin::ensure_origin(origin)?;
237237

238238
let target = T::Lookup::lookup(target)?;
239239
let deposit = <NameOf<T>>::get(&target).map(|x| x.1).unwrap_or_else(Zero::zero);
240240
<NameOf<T>>::insert(&target, (name, deposit));
241241

242242
Self::deposit_event(Event::<T>::NameForced(target));
243-
Ok(().into())
243+
Ok(())
244244
}
245245
}
246246
}

frame/timestamp/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub mod pallet {
183183
T::WeightInfo::set(),
184184
DispatchClass::Mandatory
185185
))]
186-
pub(super) fn set(origin: OriginFor<T>, #[pallet::compact] now: T::Moment) -> DispatchResultWithPostInfo {
186+
pub(super) fn set(origin: OriginFor<T>, #[pallet::compact] now: T::Moment) -> DispatchResult {
187187
ensure_none(origin)?;
188188
assert!(!DidUpdate::<T>::exists(), "Timestamp must be updated only once in the block");
189189
let prev = Self::now();
@@ -196,7 +196,7 @@ pub mod pallet {
196196

197197
<T::OnTimestampSet as OnTimestampSet<_>>::on_timestamp_set(now);
198198

199-
Ok(().into())
199+
Ok(())
200200
}
201201
}
202202

0 commit comments

Comments
 (0)