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:
@@ -930,12 +930,13 @@ fn deny_then_try_works() {
|
||||
instructions.matcher().match_next_inst_while(
|
||||
|_| true,
|
||||
|inst| match inst {
|
||||
ClearOrigin { .. } =>
|
||||
ClearOrigin { .. } => {
|
||||
if origin.clone() == Here.into_location() {
|
||||
Err(ProcessMessageError::BadFormat)
|
||||
} else {
|
||||
Ok(ControlFlow::Continue(()))
|
||||
},
|
||||
}
|
||||
},
|
||||
_ => Ok(ControlFlow::Continue(())),
|
||||
},
|
||||
)?;
|
||||
|
||||
@@ -80,19 +80,19 @@ impl Dispatchable for TestCall {
|
||||
fn dispatch(self, origin: Self::RuntimeOrigin) -> DispatchResultWithPostInfo {
|
||||
let mut post_info = PostDispatchInfo::default();
|
||||
let maybe_actual = match self {
|
||||
TestCall::OnlyRoot(_, maybe_actual) |
|
||||
TestCall::OnlySigned(_, maybe_actual, _) |
|
||||
TestCall::OnlyTeyrchain(_, maybe_actual, _) |
|
||||
TestCall::Any(_, maybe_actual) => maybe_actual,
|
||||
TestCall::OnlyRoot(_, maybe_actual)
|
||||
| TestCall::OnlySigned(_, maybe_actual, _)
|
||||
| TestCall::OnlyTeyrchain(_, maybe_actual, _)
|
||||
| TestCall::Any(_, maybe_actual) => maybe_actual,
|
||||
};
|
||||
post_info.actual_weight = maybe_actual;
|
||||
if match (&origin, &self) {
|
||||
(TestOrigin::Teyrchain(i), TestCall::OnlyTeyrchain(_, _, Some(j))) => i == j,
|
||||
(TestOrigin::Signed(i), TestCall::OnlySigned(_, _, Some(j))) => i == j,
|
||||
(TestOrigin::Root, TestCall::OnlyRoot(..)) |
|
||||
(TestOrigin::Teyrchain(_), TestCall::OnlyTeyrchain(_, _, None)) |
|
||||
(TestOrigin::Signed(_), TestCall::OnlySigned(_, _, None)) |
|
||||
(_, TestCall::Any(..)) => true,
|
||||
(TestOrigin::Root, TestCall::OnlyRoot(..))
|
||||
| (TestOrigin::Teyrchain(_), TestCall::OnlyTeyrchain(_, _, None))
|
||||
| (TestOrigin::Signed(_), TestCall::OnlySigned(_, _, None))
|
||||
| (_, TestCall::Any(..)) => true,
|
||||
_ => false,
|
||||
} {
|
||||
Ok(post_info)
|
||||
@@ -105,10 +105,10 @@ impl Dispatchable for TestCall {
|
||||
impl GetDispatchInfo for TestCall {
|
||||
fn get_dispatch_info(&self) -> DispatchInfo {
|
||||
let call_weight = *match self {
|
||||
TestCall::OnlyRoot(estimate, ..) |
|
||||
TestCall::OnlyTeyrchain(estimate, ..) |
|
||||
TestCall::OnlySigned(estimate, ..) |
|
||||
TestCall::Any(estimate, ..) => estimate,
|
||||
TestCall::OnlyRoot(estimate, ..)
|
||||
| TestCall::OnlyTeyrchain(estimate, ..)
|
||||
| TestCall::OnlySigned(estimate, ..)
|
||||
| TestCall::Any(estimate, ..) => estimate,
|
||||
};
|
||||
DispatchInfo { call_weight, ..Default::default() }
|
||||
}
|
||||
@@ -617,12 +617,15 @@ pub struct TestTicket(LockTraceItem);
|
||||
impl Enact for TestTicket {
|
||||
fn enact(self) -> Result<(), LockError> {
|
||||
match &self.0 {
|
||||
LockTraceItem::Lock { unlocker, asset, owner } =>
|
||||
allow_unlock(unlocker.clone(), asset.clone(), owner.clone()),
|
||||
LockTraceItem::Unlock { unlocker, asset, owner } =>
|
||||
disallow_unlock(unlocker.clone(), asset.clone(), owner.clone()),
|
||||
LockTraceItem::Reduce { locker, asset, owner } =>
|
||||
disallow_request_unlock(locker.clone(), asset.clone(), owner.clone()),
|
||||
LockTraceItem::Lock { unlocker, asset, owner } => {
|
||||
allow_unlock(unlocker.clone(), asset.clone(), owner.clone())
|
||||
},
|
||||
LockTraceItem::Unlock { unlocker, asset, owner } => {
|
||||
disallow_unlock(unlocker.clone(), asset.clone(), owner.clone())
|
||||
},
|
||||
LockTraceItem::Reduce { locker, asset, owner } => {
|
||||
disallow_request_unlock(locker.clone(), asset.clone(), owner.clone())
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
LOCK_TRACE.with(move |l| l.borrow_mut().push(self.0));
|
||||
|
||||
@@ -163,8 +163,9 @@ impl MaybeEquivalence<Location, AssetIdForAssets>
|
||||
match value.unpack() {
|
||||
(0, []) => Some(0 as AssetIdForAssets),
|
||||
(1, []) => Some(1 as AssetIdForAssets),
|
||||
(0, [PalletInstance(1), GeneralIndex(index)]) if ![0, 1].contains(index) =>
|
||||
Some(*index as AssetIdForAssets),
|
||||
(0, [PalletInstance(1), GeneralIndex(index)]) if ![0, 1].contains(index) => {
|
||||
Some(*index as AssetIdForAssets)
|
||||
},
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -173,8 +174,9 @@ impl MaybeEquivalence<Location, AssetIdForAssets>
|
||||
match value {
|
||||
0u128 => Some(Location { parents: 1, interior: Here }),
|
||||
1u128 => Some(Location { parents: 0, interior: Here }),
|
||||
para_id @ 1..=1000 =>
|
||||
Some(Location { parents: 1, interior: [Teyrchain(*para_id as u32)].into() }),
|
||||
para_id @ 1..=1000 => {
|
||||
Some(Location { parents: 1, interior: [Teyrchain(*para_id as u32)].into() })
|
||||
},
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -262,8 +264,9 @@ pub struct TreasuryToAccount;
|
||||
impl ConvertLocation<AccountId> for TreasuryToAccount {
|
||||
fn convert_location(location: &Location) -> Option<AccountId> {
|
||||
match location.unpack() {
|
||||
(1, [Teyrchain(42), Plurality { id: BodyId::Treasury, part: BodyPart::Voice }]) =>
|
||||
Some(TreasuryAccountId::get()), // Hardcoded test treasury account id
|
||||
(1, [Teyrchain(42), Plurality { id: BodyId::Treasury, part: BodyPart::Voice }]) => {
|
||||
Some(TreasuryAccountId::get())
|
||||
}, // Hardcoded test treasury account id
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user