style: Migrate to stable-only rustfmt configuration

- Remove nightly-only features from .rustfmt.toml and vendor/ss58-registry/rustfmt.toml
- Removed features: imports_granularity, wrap_comments, comment_width,
  reorder_impl_items, spaces_around_ranges, binop_separator,
  match_arm_blocks, trailing_semicolon, trailing_comma
- Format all 898 affected files with stable rustfmt
- Ensures long-term reliability without nightly toolchain dependency
This commit is contained in:
2025-12-22 17:12:58 +03:00
parent 65b7f5e640
commit 4c8f281051
898 changed files with 8671 additions and 6432 deletions
+15 -10
View File
@@ -118,17 +118,21 @@ impl<T: Config + Send + Sync> TransactionExtension<<T as pezframe_system::Config
// Extension is passthrough
None => Weight::zero(),
// Alias with existing account
Some(AsPersonInfo::AsPersonalAliasWithAccount(_)) =>
T::WeightInfo::as_person_alias_with_account(),
Some(AsPersonInfo::AsPersonalAliasWithAccount(_)) => {
T::WeightInfo::as_person_alias_with_account()
},
// Alias with proof
Some(AsPersonInfo::AsPersonalAliasWithProof(_, _, _)) =>
T::WeightInfo::as_person_alias_with_proof(),
Some(AsPersonInfo::AsPersonalAliasWithProof(_, _, _)) => {
T::WeightInfo::as_person_alias_with_proof()
},
// Personal Identity with proof
Some(AsPersonInfo::AsPersonalIdentityWithProof(_, _)) =>
T::WeightInfo::as_person_identity_with_proof(),
Some(AsPersonInfo::AsPersonalIdentityWithProof(_, _)) => {
T::WeightInfo::as_person_identity_with_proof()
},
// Personal Identity with existing account
Some(AsPersonInfo::AsPersonalIdentityWithAccount(_)) =>
T::WeightInfo::as_person_identity_with_account(),
Some(AsPersonInfo::AsPersonalIdentityWithAccount(_)) => {
T::WeightInfo::as_person_identity_with_account()
},
}
}
@@ -299,8 +303,9 @@ impl<T: Config + Send + Sync> TransactionExtension<<T as pezframe_system::Config
_len: usize,
) -> Result<Self::Pre, TransactionValidityError> {
match val {
Val::UsingAccount(who, nonce) =>
CheckNonce::<T>::prepare_nonce_for_account(&who, nonce)?,
Val::UsingAccount(who, nonce) => {
CheckNonce::<T>::prepare_nonce_for_account(&who, nonce)?
},
Val::NotUsing | Val::UsingProof => (),
}
+22 -19
View File
@@ -494,10 +494,10 @@ pub mod pezpallet {
// Check if there are any rings with suspensions and try to clean the first one.
if let Some(ring_index) = PendingSuspensions::<T>::iter_keys().next() {
if Self::should_remove_suspended_keys(ring_index, true) &&
weight_meter.can_consume(T::WeightInfo::remove_suspended_people(
T::MaxRingSize::get(),
)) {
if Self::should_remove_suspended_keys(ring_index, true)
&& weight_meter
.can_consume(T::WeightInfo::remove_suspended_people(T::MaxRingSize::get()))
{
let actual = Self::remove_suspended_keys(ring_index);
weight_meter.consume(actual)
}
@@ -829,9 +829,9 @@ pub mod pezpallet {
// merged.
let current_ring_index = CurrentRingIndex::<T>::get();
ensure!(
base_ring_index != target_ring_index &&
base_ring_index != current_ring_index &&
target_ring_index != current_ring_index,
base_ring_index != target_ring_index
&& base_ring_index != current_ring_index
&& target_ring_index != current_ring_index,
Error::<T>::InvalidRing
);
@@ -1091,8 +1091,9 @@ pub mod pezpallet {
People::<T>::insert(id, record);
},
// This call accepts migrations only for included keys.
RingPosition::Onboarding { .. } =>
return Err(Error::<T>::InvalidKeyMigration.into()),
RingPosition::Onboarding { .. } => {
return Err(Error::<T>::InvalidKeyMigration.into())
},
// Suspended people shouldn't be able to call this, but protect against this case
// anyway.
RingPosition::Suspended => return Err(Error::<T>::Suspended.into()),
@@ -1212,9 +1213,9 @@ pub mod pezpallet {
// Here we check we have enough items in the queue so that the onboarding group size is
// respected, but also that we can support another queue of at least onboarding size
// in a future call.
let can_onboard_with_cohort = to_include >= onboarding_size &&
ring_status.total.saturating_add(to_include.saturated_into()) <=
T::MaxRingSize::get().saturating_sub(onboarding_size);
let can_onboard_with_cohort = to_include >= onboarding_size
&& ring_status.total.saturating_add(to_include.saturated_into())
<= T::MaxRingSize::get().saturating_sub(onboarding_size);
// If this call completely fills the ring, no onboarding rule enforcement will be
// necessary.
let ring_filled = open_slots == to_include;
@@ -1645,8 +1646,9 @@ pub mod pezpallet {
}
let op_res = with_storage_layer::<bool, DispatchError, _>(|| match drain.next() {
Some((id, new_key)) =>
Self::migrate_keys_single_included_key(id, new_key).map(|_| false),
Some((id, new_key)) => {
Self::migrate_keys_single_included_key(id, new_key).map(|_| false)
},
None => {
let rings_state = RingsState::<T>::get()
.end_key_migration()
@@ -1809,9 +1811,9 @@ pub mod pezpallet {
}
fn renew_id_reservation(personal_id: PersonalId) -> Result<(), DispatchError> {
if NextPersonalId::<T>::get() <= personal_id ||
People::<T>::contains_key(personal_id) ||
ReservedPersonalId::<T>::contains_key(personal_id)
if NextPersonalId::<T>::get() <= personal_id
|| People::<T>::contains_key(personal_id)
|| ReservedPersonalId::<T>::contains_key(personal_id)
{
return Err(Error::<T>::PersonalIdReservationCannotRenew.into());
}
@@ -2046,8 +2048,9 @@ pub mod pezpallet {
fn try_origin(o: OriginFor<T>, arg: &Context) -> Result<Self::Success, OriginFor<T>> {
match ensure_revised_personal_alias(o.clone().into_caller()) {
Ok(ca) if &ca.ca.context == arg =>
Ok(RevisedAlias { revision: ca.revision, ring: ca.ring, alias: ca.ca.alias }),
Ok(ca) if &ca.ca.context == arg => {
Ok(RevisedAlias { revision: ca.revision, ring: ca.ring, alias: ca.ca.alias })
},
_ => Err(o),
}
}
+7 -7
View File
@@ -2056,8 +2056,8 @@ mod onboard_people {
assert_eq!(tail, 2);
assert!(
!OnboardingQueue::<Test>::get(head).is_empty() &&
!OnboardingQueue::<Test>::get(tail).is_empty()
!OnboardingQueue::<Test>::get(head).is_empty()
&& !OnboardingQueue::<Test>::get(tail).is_empty()
);
for _ in 0..=expected_rings_to_build - 1 {
@@ -2662,11 +2662,11 @@ fn on_poll_works() {
let merge_pages_weight =
<<Test as Config>::WeightInfo as crate::WeightInfo>::merge_queue_pages();
let expected_consumed = base_weight +
step_migration_weight.saturating_mul(5) +
end_migrate_db_weight +
step_remove_keys_weight +
merge_pages_weight;
let expected_consumed = base_weight
+ step_migration_weight.saturating_mul(5)
+ end_migrate_db_weight
+ step_remove_keys_weight
+ merge_pages_weight;
assert_eq!(meter.consumed(), expected_consumed);
});
}