Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Set Rust channel to stable (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
José Molina Colmenero authored Sep 13, 2023
1 parent 17132d2 commit 95947dc
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 39 deletions.
11 changes: 6 additions & 5 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ impl From<&str> for Runtime {
fn from(value: &str) -> Self {
#[cfg(feature = "trappist-runtime")]
if value.starts_with("trappist") {
return Runtime::Trappist
return Runtime::Trappist;
}

#[cfg(feature = "stout-runtime")]
if value.starts_with("stout") {
return Runtime::Stout
return Runtime::Stout;
}

let fallback = Runtime::default();
Expand Down Expand Up @@ -337,7 +337,7 @@ pub fn run() -> Result<()> {
if !cfg!(feature = "runtime-benchmarks") {
return Err("Benchmarking wasn't enabled when building the node. \
You can enable it with `--features runtime-benchmarks`."
.into())
.into());
}

dispatch_runtime!(config.chain_spec.runtime(), |runtime| {
Expand All @@ -362,8 +362,9 @@ pub fn run() -> Result<()> {
cmd.run(config, partial.client, db, storage)
})
},
BenchmarkCmd::Machine(cmd) =>
cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()),
BenchmarkCmd::Machine(cmd) => {
cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone())
},
BenchmarkCmd::Overhead(cmd) => {
construct_partial!(config, |partial| {
let ext_builder = RemarkBuilder::new(partial.client.clone());
Expand Down
2 changes: 1 addition & 1 deletion node/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn wait_for(child: &mut Child, secs: u64) -> Result<ExitStatus, ()> {
let result = wait_timeout::ChildExt::wait_timeout(child, Duration::from_secs(secs - 5))
.map_err(|_| ())?;
if let Some(exit_status) = result {
return Ok(exit_status)
return Ok(exit_status);
}
}
eprintln!("Took too long to exit (> {} seconds). Killing...", secs);
Expand Down
12 changes: 6 additions & 6 deletions pallets/asset-registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ pub mod pallet {

let check = matches!(
last_junction,
Some(AccountId32 { .. }) |
Some(AccountKey20 { .. }) |
Some(PalletInstance(_)) |
Some(Parachain(_)) | None
Some(AccountId32 { .. })
| Some(AccountKey20 { .. })
| Some(PalletInstance(_))
| Some(Parachain(_)) | None
);

check |
match last_junction {
check
| match last_junction {
Some(GeneralIndex(_)) => {
let penultimate = split_multilocation.last();
matches!(penultimate, Some(PalletInstance(_)))
Expand Down
10 changes: 5 additions & 5 deletions primitives/xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,17 @@ impl<AssetId, AssetIdInfoGetter, AssetsPallet, BalancesPallet, XcmPallet, Accoun

// only trap if amount ≥ min_balance
// do nothing otherwise (asset is lost)
amount.saturated_into::<AssetsPallet::Balance>() >=
AssetsPallet::minimum_balance(asset_id)
amount.saturated_into::<AssetsPallet::Balance>()
>= AssetsPallet::minimum_balance(asset_id)
},
None => {
weight.saturating_accrue(Weigher::native());

// only trap if native token and amount ≥ min_balance
// do nothing otherwise (asset is lost)
*location == NATIVE_LOCATION &&
amount.saturated_into::<BalancesPallet::Balance>() >=
BalancesPallet::minimum_balance()
*location == NATIVE_LOCATION
&& amount.saturated_into::<BalancesPallet::Balance>()
>= BalancesPallet::minimum_balance()
},
}
} else {
Expand Down
16 changes: 8 additions & 8 deletions runtime/trappist/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ impl Contains<RuntimeCall> for RuntimeBlackListedCalls {
fn contains(call: &RuntimeCall) -> bool {
!matches!(
call,
RuntimeCall::Balances(_) |
RuntimeCall::Assets(_) |
RuntimeCall::Dex(_) |
RuntimeCall::PolkadotXcm(_) |
RuntimeCall::Treasury(_) |
RuntimeCall::Contracts(_) |
RuntimeCall::Uniques(_) |
RuntimeCall::AssetRegistry(_)
RuntimeCall::Balances(_)
| RuntimeCall::Assets(_)
| RuntimeCall::Dex(_)
| RuntimeCall::PolkadotXcm(_)
| RuntimeCall::Treasury(_)
| RuntimeCall::Contracts(_)
| RuntimeCall::Uniques(_)
| RuntimeCall::AssetRegistry(_)
)
}
}
Expand Down
5 changes: 3 additions & 2 deletions runtime/trappist/src/weights/xcm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ impl WeighMultiAssets for MultiAssetFilter {
WildFungibility::Fungible => weight,
// Magic number 2 has to do with the fact that we could have up to 2 times
// MaxAssetsIntoHolding in the worst-case scenario.
WildFungibility::NonFungible =>
weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64),
WildFungibility::NonFungible => {
weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64)
},
},
AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min(*count as u64)),
AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min(*count as u64)),
Expand Down
4 changes: 2 additions & 2 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2023-05-22"
channel = "stable"
components = [ "rustfmt" ]
targets = [ "wasm32-unknown-unknown" ]
profile = "minimal"
profile = "minimal"
10 changes: 0 additions & 10 deletions rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,11 @@ hard_tabs = true
max_width = 100
use_small_heuristics = "Max"
# Imports
imports_granularity = "Crate"
reorder_imports = true
# Consistency
newline_style = "Unix"
# Format comments
comment_width = 100
wrap_comments = true
# Misc
chain_width = 80
spaces_around_ranges = false
binop_separator = "Back"
reorder_impl_items = false
match_arm_leading_pipes = "Preserve"
match_arm_blocks = false
match_block_trailing_comma = true
trailing_comma = "Vertical"
trailing_semicolon = false
use_field_init_shorthand = true

0 comments on commit 95947dc

Please sign in to comment.