Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Dec 9, 2024
1 parent b13fdfb commit 8c90492
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
let delivery_fees = AssetHubKusama::execute_with(|| {
xcm_helpers::teleport_assets_delivery_fees::<
<AssetHubKusamaXcmConfig as xcm_executor::Config>::XcmSender,
>(
test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest
)
>(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
});

// Sender's balance is reduced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,7 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
let delivery_fees = AssetHubPolkadot::execute_with(|| {
xcm_helpers::teleport_assets_delivery_fees::<
<AssetHubPolkadotXcmConfig as xcm_executor::Config>::XcmSender,
>(
test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest
)
>(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
});

// Sender's balance is reduced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
let delivery_fees = PeopleKusama::execute_with(|| {
xcm_helpers::teleport_assets_delivery_fees::<
<PeopleKusamaXcmConfig as xcm_executor::Config>::XcmSender,
>(
test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest
)
>(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
});

// Sender's balance is reduced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
let delivery_fees = PeoplePolkadot::execute_with(|| {
xcm_helpers::teleport_assets_delivery_fees::<
<PeoplePolkadotXcmConfig as xcm_executor::Config>::XcmSender,
>(
test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest
)
>(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
});

// Sender's balance is reduced
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/zombienet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub async fn wait_subxt_client(
match node.client::<PolkadotConfig>().await {
Ok(cli) => {
log::info!("returning client for: {}", node.ws_uri());
return Ok(cli);
return Ok(cli)
},
Err(e) => {
log::trace!("{e:?}");
Expand All @@ -60,10 +60,10 @@ pub async fn wait_subxt_client(
if inner.to_string().contains("i/o error") {
// The node is not ready to accept connections yet
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
continue;
continue
}
}
return Err(anyhow!("Cannot connect to node : {e:?}"));
return Err(anyhow!("Cannot connect to node : {e:?}"))
},
};
}
Expand Down
3 changes: 1 addition & 2 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1213,8 +1213,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
matches!(
c,
RuntimeCall::Staking(..) |
RuntimeCall::Session(..) |
RuntimeCall::Utility(..) |
RuntimeCall::Session(..) | RuntimeCall::Utility(..) |
RuntimeCall::FastUnstake(..) |
RuntimeCall::VoterList(..) |
RuntimeCall::NominationPools(..)
Expand Down
9 changes: 4 additions & 5 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,8 +1093,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
matches!(
c,
RuntimeCall::Staking(..) |
RuntimeCall::Session(..) |
RuntimeCall::Utility(..) |
RuntimeCall::Session(..) | RuntimeCall::Utility(..) |
RuntimeCall::FastUnstake(..) |
RuntimeCall::VoterList(..) |
RuntimeCall::NominationPools(..)
Expand Down Expand Up @@ -1845,7 +1844,7 @@ mod clear_judgement_proxies {
ensure!(&deposit == expected_deposit, "Unexpected deposit");
},
None => {
return Err(TryRuntimeError::Other("Missing Proxy"));
return Err(TryRuntimeError::Other("Missing Proxy"))
},
}
}
Expand All @@ -1862,7 +1861,7 @@ mod clear_judgement_proxies {
// current state
for (who, _) in expected_proxies.iter() {
if !Proxies::<Runtime>::contains_key(who) {
return Err(TryRuntimeError::Other("Extra entry in expected state"));
return Err(TryRuntimeError::Other("Extra entry in expected state"))
}
}

Expand Down Expand Up @@ -1895,7 +1894,7 @@ pub mod migrations {
let now = frame_system::Pallet::<Runtime>::block_number();
let lease = slots::Leases::<Runtime>::get(para);
if lease.is_empty() {
return None;
return None
}
let (index, _) =
<slots::Pallet<Runtime> as Leaser<BlockNumber>>::lease_period_index(now)?;
Expand Down
4 changes: 2 additions & 2 deletions system-parachains/asset-hubs/asset-hub-kusama/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub mod tx_payment {
already_withdrawn: Self::LiquidityInfo,
) -> Result<(), TransactionValidityError> {
let Some(paid) = already_withdrawn else {
return Ok(());
return Ok(())
};
// Make sure the credit is in desired asset id.
ensure!(paid.asset() == A::get(), InvalidTransaction::Payment);
Expand Down Expand Up @@ -212,7 +212,7 @@ pub mod tx_payment {
initial_asset_consumed: T::Balance,
) -> Result<T::Balance, TransactionValidityError> {
let Some(fee_paid) = fee_paid else {
return Ok(Zero::zero());
return Ok(Zero::zero())
};
// Try to refund if the fee paid is more than the corrected fee and the account was not
// removed by the dispatched function.
Expand Down
3 changes: 1 addition & 2 deletions system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. } |
RuntimeCall::NftFractionalization { .. } |
RuntimeCall::Nfts { .. } |
RuntimeCall::Uniques { .. }
RuntimeCall::Nfts { .. } | RuntimeCall::Uniques { .. }
)
},
ProxyType::AssetOwner => matches!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,10 @@ pub mod bridging {
{
fn contains(asset: &L, origin: &L) -> bool {
let Ok(asset) = asset.clone().try_into() else {
return false;
return false
};
let Ok(origin) = origin.clone().try_into() else {
return false;
return false
};

let expected_origin = OriginLocation::get();
Expand All @@ -590,7 +590,7 @@ pub mod bridging {
target: "xcm::contains",
"RemoteAssetFromLocation asset: {asset:?}, origin: {origin:?} is not from expected {expected_origin:?}"
);
return false;
return false
} else {
log::trace!(
target: "xcm::contains",
Expand All @@ -603,8 +603,7 @@ pub mod bridging {
}
}
impl<AssetsAllowedNetworks: Contains<Location>, OriginLocation: Get<Location>>
ContainsPair<Asset, Location>
for RemoteAssetFromLocation<AssetsAllowedNetworks, OriginLocation>
ContainsPair<Asset, Location> for RemoteAssetFromLocation<AssetsAllowedNetworks, OriginLocation>
{
fn contains(asset: &Asset, origin: &Location) -> bool {
<Self as ContainsPair<Location, Location>>::contains(&asset.id.0, origin)
Expand Down
4 changes: 2 additions & 2 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub mod tx_payment {
already_withdrawn: Self::LiquidityInfo,
) -> Result<(), TransactionValidityError> {
let Some(paid) = already_withdrawn else {
return Ok(());
return Ok(())
};
// Make sure the credit is in desired asset id.
ensure!(paid.asset() == A::get(), InvalidTransaction::Payment);
Expand Down Expand Up @@ -212,7 +212,7 @@ pub mod tx_payment {
initial_asset_consumed: T::Balance,
) -> Result<T::Balance, TransactionValidityError> {
let Some(fee_paid) = fee_paid else {
return Ok(Zero::zero());
return Ok(Zero::zero())
};
// Try to refund if the fee paid is more than the corrected fee and the account was not
// removed by the dispatched function.
Expand Down
3 changes: 1 addition & 2 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Assets { .. } |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. } |
RuntimeCall::Nfts { .. } |
RuntimeCall::Uniques { .. }
RuntimeCall::Nfts { .. } | RuntimeCall::Uniques { .. }
)
},
ProxyType::AssetOwner => matches!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,10 @@ pub mod bridging {
{
fn contains(asset: &L, origin: &L) -> bool {
let Ok(asset) = asset.clone().try_into() else {
return false;
return false
};
let Ok(origin) = origin.clone().try_into() else {
return false;
return false
};

let expected_origin = OriginLocation::get();
Expand All @@ -657,7 +657,7 @@ pub mod bridging {
target: "xcm::contains",
"RemoteAssetFromLocation asset: {asset:?}, origin: {origin:?} is not from expected {expected_origin:?}"
);
return false;
return false
} else {
log::trace!(
target: "xcm::contains",
Expand All @@ -670,8 +670,7 @@ pub mod bridging {
}
}
impl<AssetsAllowedNetworks: Contains<Location>, OriginLocation: Get<Location>>
ContainsPair<Asset, Location>
for RemoteAssetFromLocation<AssetsAllowedNetworks, OriginLocation>
ContainsPair<Asset, Location> for RemoteAssetFromLocation<AssetsAllowedNetworks, OriginLocation>
{
fn contains(asset: &Asset, origin: &Location) -> bool {
<Self as ContainsPair<Location, Location>>::contains(&asset.id.0, origin)
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/coretime/coretime-kusama/src/coretime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ impl CoretimeInterface for CoretimeAllocator {
// If checked_rem returns `None`, `TIMESLICE_PERIOD` is misconfigured for some reason. We
// have bigger issues with the chain, but we still want to burn.
if t.checked_rem(BURN_PERIOD).map_or(false, |r| r != 0) {
return;
return
}

let stash = CoretimeBurnAccount::get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ impl CoretimeInterface for CoretimeAllocator {
// If checked_rem returns `None`, `TIMESLICE_PERIOD` is misconfigured for some reason. We
// have bigger issues with the chain, but we still want to burn.
if t.checked_rem(BURN_PERIOD).map_or(false, |r| r != 0) {
return;
return
}

let stash = CoretimeBurnAccount::get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl OnRuntimeUpgrade for FixMigration {
{
// Idempotency check - this core will never be renewable at this timeslice ever again.
log::error!(target: TARGET, "This migration includes hardcoded values not relevant to this runtime. Bailing.");
return <Runtime as frame_system::Config>::DbWeight::get().reads(1);
return <Runtime as frame_system::Config>::DbWeight::get().reads(1)
}

let Some(mut first_core) = Self::get_first_usable_core() else {
Expand Down Expand Up @@ -435,7 +435,7 @@ impl OnRuntimeUpgrade for FixMigration {
for i in 0..62 {
if i >= 51 && i < 56 {
// Cores offered for sale, we don't know anything about them.
continue;
continue
}
log::trace!(target: TARGET, "Core: {:?}", i);

Expand Down
3 changes: 2 additions & 1 deletion system-parachains/encointer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@ parameter_types! {

impl pallet_encointer_scheduler::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
// attention!: EncointerDemocracy must be first hook as it potentially changes the rules for following hooks
// attention!: EncointerDemocracy must be first hook as it potentially changes the rules for
// following hooks
type OnCeremonyPhaseChange = (EncointerDemocracy, EncointerCeremonies);
type MomentsPerDay = MomentsPerDay;
type CeremonyMaster = MoreThanHalfCouncil;
Expand Down

0 comments on commit 8c90492

Please sign in to comment.