Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Commit 0e221ce

Browse files
authored
Update toolchain (#81)
* Update to latest nightly rust. It fixes problems with incremental builds announced in Rust 1.51. See https://blog.rust-lang.org/2021/05/10/Rust-1.52.1.html * Add stdlib dirs to gitignore * Fix BTreeMap import in parachain-staking * Fix clippy warnings * Fix clippy warnings * Remove unused attribute * Remove RUSTFLAGS=-D warnings form CI config * Disable check-benchmarks make target (temporary)
1 parent 6381c0f commit 0e221ce

File tree

9 files changed

+85
-84
lines changed

9 files changed

+85
-84
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ env:
1010
CARGO_INCREMENTAL: 1
1111
CARGO_NET_RETRY: 10
1212
CARGO_TERM_COLOR: always
13-
RUSTFLAGS: -D warnings
1413

1514
jobs:
1615
test:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@
1818

1919
artifacts/
2020
/node/move/stdlib/
21+
/pallets/sp-mvm/tests/assets/stdlib/
22+
/pallets/sp-mvm/tests/benchmark_assets/stdlib/
2123

2224
.direnv

Cargo.lock

Lines changed: 70 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ check:
1010
cargo check --all
1111
cargo check --all --tests
1212
make check-no-std
13-
make check-benchmarks
13+
#make check-benchmarks
1414

1515
.PHONY: check-benchmarks
1616
check-benchmarks:

pallets/parachain-staking/src/lib.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ pub mod pallet {
7474
traits::{AtLeast32BitUnsigned, Saturating, Zero},
7575
Perbill, Percent, RuntimeDebug,
7676
};
77-
use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*};
77+
use sp_std::{cmp::Ordering, prelude::*};
78+
#[cfg(feature = "std")]
79+
use sp_std::collections::btree_map::BTreeMap;
7880

7981
/// Pallet for parachain staking
8082
#[pallet::pallet]
@@ -1114,12 +1116,12 @@ pub mod pallet {
11141116
T::Currency::free_balance(&nominator) >= balance,
11151117
"Account does not have enough balance to place nomination."
11161118
);
1117-
let cn_count = if let Some(x) = col_nominator_count.get(&target) {
1119+
let cn_count = if let Some(x) = col_nominator_count.get(target) {
11181120
*x
11191121
} else {
11201122
0u32
11211123
};
1122-
let nn_count = if let Some(x) = nom_nominator_count.get(&nominator) {
1124+
let nn_count = if let Some(x) = nom_nominator_count.get(nominator) {
11231125
*x
11241126
} else {
11251127
0u32
@@ -1133,12 +1135,12 @@ pub mod pallet {
11331135
) {
11341136
log::warn!("Join nominators failed in genesis with error {:?}", error);
11351137
} else {
1136-
if let Some(x) = col_nominator_count.get_mut(&target) {
1138+
if let Some(x) = col_nominator_count.get_mut(target) {
11371139
*x += 1u32;
11381140
} else {
11391141
col_nominator_count.insert(target.clone(), 1u32);
11401142
};
1141-
if let Some(x) = nom_nominator_count.get_mut(&nominator) {
1143+
if let Some(x) = nom_nominator_count.get_mut(nominator) {
11421144
*x += 1u32;
11431145
} else {
11441146
nom_nominator_count.insert(nominator.clone(), 1u32);

pallets/sp-mvm/src/balance.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ where
8383
address,
8484
ticker
8585
);
86-
address_to_account::<T::AccountId>(&address)
86+
address_to_account::<T::AccountId>(address)
8787
.map_err(|_| error!("Can't convert address from Move to Substrate."))
8888
.and_then(|address| {
8989
<balances::Pallet<T> as Currency<T::AccountId>>::free_balance(&address)
@@ -106,7 +106,7 @@ where
106106
}
107107

108108
trace!("withdraw resource {} requested, amount: {}", ticker, amount);
109-
let imbalance = address_to_account::<T::AccountId>(&address)
109+
let imbalance = address_to_account::<T::AccountId>(address)
110110
.map_err(|_err| error!("Can't convert address from Move to Substrate."))
111111
.and_then(|address| {
112112
amount
@@ -137,7 +137,7 @@ where
137137
}
138138

139139
trace!("deposit resource {} requested, amount: {}", ticker, amount);
140-
let imbalance = address_to_account::<T::AccountId>(&address)
140+
let imbalance = address_to_account::<T::AccountId>(address)
141141
.map_err(|_| error!("Can't convert address from Move to Substrate."))
142142
.and_then(|address| {
143143
amount

pallets/sp-mvm/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<AccountId: DecodeT> TryFrom<InternalModuleId> for MoveModuleId<AccountId> {
1919

2020
fn try_from(id: InternalModuleId) -> Result<Self, Self::Error> {
2121
Ok(Self {
22-
owner: address_to_account::<AccountId>(&id.address())?,
22+
owner: address_to_account::<AccountId>(id.address())?,
2323
module: id.name().as_bytes().to_vec(),
2424
})
2525
}

runtime/src/primitives.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg_attr(not(feature = "std"), no_std)]
2-
31
use sp_runtime::{generic, MultiSignature};
42
use sp_runtime::traits::{Verify, IdentifyAccount};
53

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2021-04-24
1+
nightly-2021-07-26

0 commit comments

Comments
 (0)