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:
@@ -1075,8 +1075,9 @@ pub mod pezpallet {
|
||||
timeout,
|
||||
maybe_match_querier: Some(Location::here().into()),
|
||||
},
|
||||
VersionNotifier { origin, is_active } =>
|
||||
QueryStatus::VersionNotifier { origin, is_active },
|
||||
VersionNotifier { origin, is_active } => {
|
||||
QueryStatus::VersionNotifier { origin, is_active }
|
||||
},
|
||||
Ready { response, at } => QueryStatus::Ready { response, at },
|
||||
}
|
||||
}
|
||||
@@ -1714,16 +1715,17 @@ pub mod pezpallet {
|
||||
ensure!(origin_location != new_aliaser, Error::<T>::BadLocation);
|
||||
// remove `network` from inner `AccountId32` for easier matching
|
||||
let origin_location = match origin_location.unpack() {
|
||||
(0, [AccountId32 { network: _, id }]) =>
|
||||
Location::new(0, [AccountId32 { network: None, id: *id }]),
|
||||
(0, [AccountId32 { network: _, id }]) => {
|
||||
Location::new(0, [AccountId32 { network: None, id: *id }])
|
||||
},
|
||||
_ => return Err(Error::<T>::InvalidOrigin.into()),
|
||||
};
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::add_authorized_alias", ?origin_location, ?new_aliaser, ?expires);
|
||||
ensure!(origin_location != new_aliaser, Error::<T>::BadLocation);
|
||||
if let Some(expiry) = expires {
|
||||
ensure!(
|
||||
expiry >
|
||||
pezframe_system::Pezpallet::<T>::current_block_number()
|
||||
expiry
|
||||
> pezframe_system::Pezpallet::<T>::current_block_number()
|
||||
.saturated_into::<u64>(),
|
||||
Error::<T>::ExpiresInPast
|
||||
);
|
||||
@@ -1797,8 +1799,9 @@ pub mod pezpallet {
|
||||
ensure!(origin_location != to_remove, Error::<T>::BadLocation);
|
||||
// remove `network` from inner `AccountId32` for easier matching
|
||||
let origin_location = match origin_location.unpack() {
|
||||
(0, [AccountId32 { network: _, id }]) =>
|
||||
Location::new(0, [AccountId32 { network: None, id: *id }]),
|
||||
(0, [AccountId32 { network: _, id }]) => {
|
||||
Location::new(0, [AccountId32 { network: None, id: *id }])
|
||||
},
|
||||
_ => return Err(Error::<T>::InvalidOrigin.into()),
|
||||
};
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::remove_authorized_alias", ?origin_location, ?to_remove);
|
||||
@@ -1847,8 +1850,9 @@ pub mod pezpallet {
|
||||
let origin_location: Location = T::ExecuteXcmOrigin::ensure_origin(origin)?;
|
||||
// remove `network` from inner `AccountId32` for easier matching
|
||||
let origin_location = match origin_location.unpack() {
|
||||
(0, [AccountId32 { network: _, id }]) =>
|
||||
Location::new(0, [AccountId32 { network: None, id: *id }]),
|
||||
(0, [AccountId32 { network: _, id }]) => {
|
||||
Location::new(0, [AccountId32 { network: None, id: *id }])
|
||||
},
|
||||
_ => return Err(Error::<T>::InvalidOrigin.into()),
|
||||
};
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::remove_all_authorized_aliases", ?origin_location);
|
||||
@@ -2236,8 +2240,9 @@ impl<T: Config> Pezpallet<T> {
|
||||
fees,
|
||||
weight_limit,
|
||||
)?,
|
||||
TransferType::RemoteReserve(_) =>
|
||||
return Err(Error::<T>::InvalidAssetUnsupportedReserve.into()),
|
||||
TransferType::RemoteReserve(_) => {
|
||||
return Err(Error::<T>::InvalidAssetUnsupportedReserve.into())
|
||||
},
|
||||
};
|
||||
FeesHandling::Separate { local_xcm, remote_xcm }
|
||||
};
|
||||
@@ -3460,13 +3465,13 @@ impl<T: Config> Pezpallet<T> {
|
||||
Ok(Self::authorized_aliasers(target)?.into_iter().any(|aliaser| {
|
||||
// `aliasers` and `origin` have already been transformed to `desired_version`, we
|
||||
// can just directly compare them.
|
||||
aliaser.location == origin &&
|
||||
aliaser
|
||||
aliaser.location == origin
|
||||
&& aliaser
|
||||
.expiry
|
||||
.map(|expiry| {
|
||||
pezframe_system::Pezpallet::<T>::current_block_number()
|
||||
.saturated_into::<u64>() <
|
||||
expiry
|
||||
.saturated_into::<u64>()
|
||||
< expiry
|
||||
})
|
||||
.unwrap_or(true)
|
||||
}))
|
||||
@@ -3631,8 +3636,8 @@ impl<T: Config> Pezpallet<T> {
|
||||
// check `RemoteLockedFungibles`
|
||||
ensure!(
|
||||
!RemoteLockedFungibles::<T>::iter()
|
||||
.any(|(key, data)| key.needs_migration(minimal_allowed_xcm_version) ||
|
||||
data.needs_migration(minimal_allowed_xcm_version)),
|
||||
.any(|(key, data)| key.needs_migration(minimal_allowed_xcm_version)
|
||||
|| data.needs_migration(minimal_allowed_xcm_version)),
|
||||
TryRuntimeError::Other(
|
||||
"`RemoteLockedFungibles` data should be migrated to the higher xcm version!"
|
||||
)
|
||||
@@ -3966,11 +3971,12 @@ impl<T: Config> ClaimAssets for Pezpallet<T> {
|
||||
) -> bool {
|
||||
let mut versioned = VersionedAssets::from(assets.clone());
|
||||
match ticket.unpack() {
|
||||
(0, [GeneralIndex(i)]) =>
|
||||
(0, [GeneralIndex(i)]) => {
|
||||
versioned = match versioned.into_version(*i as u32) {
|
||||
Ok(v) => v,
|
||||
Err(()) => return false,
|
||||
},
|
||||
}
|
||||
},
|
||||
(0, []) => (),
|
||||
_ => return false,
|
||||
};
|
||||
@@ -3996,15 +4002,17 @@ impl<T: Config> OnResponse for Pezpallet<T> {
|
||||
querier: Option<&Location>,
|
||||
) -> bool {
|
||||
match Queries::<T>::get(query_id) {
|
||||
Some(QueryStatus::Pending { responder, maybe_match_querier, .. }) =>
|
||||
Location::try_from(responder).map_or(false, |r| origin == &r) &&
|
||||
maybe_match_querier.map_or(true, |match_querier| {
|
||||
Some(QueryStatus::Pending { responder, maybe_match_querier, .. }) => {
|
||||
Location::try_from(responder).map_or(false, |r| origin == &r)
|
||||
&& maybe_match_querier.map_or(true, |match_querier| {
|
||||
Location::try_from(match_querier).map_or(false, |match_querier| {
|
||||
querier.map_or(false, |q| q == &match_querier)
|
||||
})
|
||||
}),
|
||||
Some(QueryStatus::VersionNotifier { origin: r, .. }) =>
|
||||
Location::try_from(r).map_or(false, |r| origin == &r),
|
||||
})
|
||||
},
|
||||
Some(QueryStatus::VersionNotifier { origin: r, .. }) => {
|
||||
Location::try_from(r).map_or(false, |r| origin == &r)
|
||||
},
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
@@ -4285,12 +4293,13 @@ where
|
||||
|
||||
fn try_origin(outer: O) -> Result<Self::Success, O> {
|
||||
match outer.caller().try_into() {
|
||||
Ok(Origin::Xcm(ref location)) =>
|
||||
Ok(Origin::Xcm(ref location)) => {
|
||||
if let Ok(location) = location.clone().try_into() {
|
||||
if F::contains(&location) {
|
||||
return Ok(location);
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user