Skip to content

Commit 7d60899

Browse files
authored
Update rust 1.81.0 (#1009)
* fix clippy with rust-1.81.0 * add Cargo.lock to pin frame-support-procedural 30.0.2 * remove Cargo.lock and fix CI * fix CI * fix zepter CI
1 parent 144a962 commit 7d60899

File tree

11 files changed

+28
-17
lines changed

11 files changed

+28
-17
lines changed

.github/workflows/coverage.yml

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
wget https://github.com/xd009642/tarpaulin/releases/download/${{ env.TARPAULIN_VERSION }}/cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz
3737
tar -zxvf cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz -C $HOME/.cargo/bin
3838
make Cargo.toml
39+
cargo update
40+
cargo update -p frame-support-procedural --precise 30.0.2
3941
cargo tarpaulin --verbose --no-fail-fast --workspace --timeout 300 --out Xml
4042
- name: Upload to codecov.io
4143
uses: codecov/codecov-action@v3

.github/workflows/test.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
- name: Install clippy
3535
run: rustup component add clippy
3636
- name: Update
37-
run: cargo update
37+
run: |
38+
cargo update
39+
cargo update -p frame-support-procedural --precise 30.0.2
3840
- name: Run clippy
3941
run: cargo clippy -- -D warnings
4042
- name: Check for Wasm

.github/workflows/zepter.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
- name: Install Zepter
2929
run: cargo install zepter --version 0.15.0 --locked -q -f --no-default-features && zepter --version
3030
- run: make Cargo.toml
31-
- run: cargo update
31+
- run: |
32+
cargo update
33+
cargo update -p frame-support-procedural --precise 30.0.2
3234
- name: Check Rust features
3335
run: make dev-features-check

currencies/src/lib.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
//!
2222
//! - `MultiCurrency` - Abstraction over a fungible multi-currency system.
2323
//! - `MultiCurrencyExtended` - Extended `MultiCurrency` with additional helper
24-
//! types and methods, like updating balance
25-
//! by a given signed integer amount.
24+
//! types and methods, like updating balance by a given signed integer amount.
2625
//!
2726
//! ## Interface
2827
//!
@@ -31,8 +30,7 @@
3130
//! - `transfer` - Transfer some balance to another account, in a given
3231
//! currency.
3332
//! - `transfer_native_currency` - Transfer some balance to another account, in
34-
//! native currency set in
35-
//! `Config::NativeCurrency`.
33+
//! native currency set in `Config::NativeCurrency`.
3634
//! - `update_balance` - Update balance by signed integer amount, in a given
3735
//! currency, root origin required.
3836

payments/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ readme = "README.md"
1313
parity-scale-codec = { workspace = true }
1414
log = { workspace = true }
1515
scale-info = { workspace = true }
16+
serde = { workspace = true, optional = true }
1617

1718
frame-support = { workspace = true }
1819
frame-system = { workspace = true }
@@ -22,8 +23,6 @@ sp-std = { workspace = true }
2223
orml-traits = {path = "../traits", version = "1.0.0", default-features = false }
2324

2425
[dev-dependencies]
25-
serde = "1.0.136"
26-
2726
sp-core = { workspace = true }
2827
sp-io = { workspace = true }
2928

@@ -38,6 +37,7 @@ std = [
3837
'orml-traits/std',
3938
'parity-scale-codec/std',
4039
'scale-info/std',
40+
'serde',
4141
'sp-runtime/std',
4242
'sp-std/std',
4343
]

payments/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
//! - CancelBufferBlockLength: This is the time window where the recipient can
2222
//! dispute a cancellation request from the payment creator.
2323
24+
//!
2425
//! Extrinsics
2526
//!
2627
//! - `pay` - Create an payment for the given currencyid/amount
@@ -42,6 +43,7 @@
4243
//! - `accept_and_pay` - Allows the sender to fulfill a payment request created
4344
//! by a recipient
4445
46+
//!
4547
//! Types
4648
//!
4749
//! The `PaymentDetail` struct stores information about the payment/escrow. A

payments/src/types.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ use parity_scale_codec::{Decode, Encode, HasCompact, MaxEncodedLen};
55
use scale_info::TypeInfo;
66
use sp_runtime::{DispatchResult, Percent};
77

8+
#[cfg(feature = "std")]
9+
use serde::{Deserialize, Serialize};
10+
811
/// The PaymentDetail struct stores information about the payment/escrow
912
/// A "payment" in virto network is similar to an escrow, it is used to
1013
/// guarantee proof of funds and can be released once an agreed upon condition
@@ -13,7 +16,7 @@ use sp_runtime::{DispatchResult, Percent};
1316
#[derive(Encode, Decode, Debug, Clone, PartialEq, Eq, MaxEncodedLen, TypeInfo)]
1417
#[scale_info(skip_type_params(T))]
1518
#[codec(mel_bound(T: pallet::Config))]
16-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
19+
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
1720
pub struct PaymentDetail<T: pallet::Config> {
1821
/// type of asset used for payment
1922
pub asset: AssetIdOf<T>,
@@ -38,7 +41,7 @@ pub struct PaymentDetail<T: pallet::Config> {
3841
#[derive(Encode, Decode, Debug, Clone, PartialEq, Eq, MaxEncodedLen, TypeInfo)]
3942
#[scale_info(skip_type_params(T))]
4043
#[codec(mel_bound(T: pallet::Config))]
41-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
44+
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
4245
pub enum PaymentState<T: pallet::Config> {
4346
/// Amounts have been reserved and waiting for release/cancel
4447
Created,

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "1.77.0"
2+
channel = "1.81.0"
33
components = ["rustfmt", "clippy"]
44
targets = ["wasm32-unknown-unknown"]

tokens/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
//!
2020
//! - `MultiCurrency` - Abstraction over a fungible multi-currency system.
2121
//! - `MultiCurrencyExtended` - Extended `MultiCurrency` with additional helper
22-
//! types and methods, like updating balance
23-
//! by a given signed integer amount.
22+
//! types and methods, like updating balance by a given signed integer amount.
2423
//!
2524
//! ## Interface
2625
//!

traits/src/currency.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ pub trait NamedMultiReservableCurrency<AccountId>: MultiReservableCurrency<Accou
257257
///
258258
/// - This is different from `reserve`.
259259
/// - If the remaining reserved balance is less than `ExistentialDeposit`,
260-
/// it will
261-
/// invoke `on_reserved_too_low` and could reap the account.
260+
/// it will invoke `on_reserved_too_low` and could reap the account.
262261
fn unreserve_named(
263262
id: &Self::ReserveIdentifier,
264263
currency_id: Self::CurrencyId,
@@ -551,8 +550,7 @@ pub trait NamedBasicReservableCurrency<AccountId, ReserveIdentifier>: BasicReser
551550
///
552551
/// - This is different from `reserve`.
553552
/// - If the remaining reserved balance is less than `ExistentialDeposit`,
554-
/// it will
555-
/// invoke `on_reserved_too_low` and could reap the account.
553+
/// it will invoke `on_reserved_too_low` and could reap the account.
556554
fn unreserve_named(id: &ReserveIdentifier, who: &AccountId, value: Self::Balance) -> Self::Balance;
557555

558556
/// Moves up to `value` from reserved balance of account `slashed` to

xcm-mock-message-queue/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,8 @@ std = [
3737
"sp-std/std",
3838
"xcm/std",
3939
]
40+
try-runtime = [
41+
"frame-support/try-runtime",
42+
"frame-system/try-runtime",
43+
"sp-runtime/try-runtime",
44+
]

0 commit comments

Comments
 (0)