diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0cb2e0558..3c0f5916d 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -36,6 +36,8 @@ jobs: wget https://github.com/xd009642/tarpaulin/releases/download/${{ env.TARPAULIN_VERSION }}/cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz tar -zxvf cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz -C $HOME/.cargo/bin make Cargo.toml + cargo update + cargo update -p frame-support-procedural --precise 30.0.2 cargo tarpaulin --verbose --no-fail-fast --workspace --timeout 300 --out Xml - name: Upload to codecov.io uses: codecov/codecov-action@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dfe572303..6b07dc772 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,9 @@ jobs: - name: Install clippy run: rustup component add clippy - name: Update - run: cargo update + run: | + cargo update + cargo update -p frame-support-procedural --precise 30.0.2 - name: Run clippy run: cargo clippy -- -D warnings - name: Check for Wasm diff --git a/.github/workflows/zepter.yml b/.github/workflows/zepter.yml index e2cbd94d6..1fccac7b0 100644 --- a/.github/workflows/zepter.yml +++ b/.github/workflows/zepter.yml @@ -28,6 +28,8 @@ jobs: - name: Install Zepter run: cargo install zepter --version 0.15.0 --locked -q -f --no-default-features && zepter --version - run: make Cargo.toml - - run: cargo update + - run: | + cargo update + cargo update -p frame-support-procedural --precise 30.0.2 - name: Check Rust features run: make dev-features-check diff --git a/currencies/src/lib.rs b/currencies/src/lib.rs index f9fa5047e..10a109158 100644 --- a/currencies/src/lib.rs +++ b/currencies/src/lib.rs @@ -21,8 +21,7 @@ //! //! - `MultiCurrency` - Abstraction over a fungible multi-currency system. //! - `MultiCurrencyExtended` - Extended `MultiCurrency` with additional helper -//! types and methods, like updating balance -//! by a given signed integer amount. +//! types and methods, like updating balance by a given signed integer amount. //! //! ## Interface //! @@ -31,8 +30,7 @@ //! - `transfer` - Transfer some balance to another account, in a given //! currency. //! - `transfer_native_currency` - Transfer some balance to another account, in -//! native currency set in -//! `Config::NativeCurrency`. +//! native currency set in `Config::NativeCurrency`. //! - `update_balance` - Update balance by signed integer amount, in a given //! currency, root origin required. diff --git a/payments/Cargo.toml b/payments/Cargo.toml index 1a38a968a..fefcdf068 100644 --- a/payments/Cargo.toml +++ b/payments/Cargo.toml @@ -13,6 +13,7 @@ readme = "README.md" parity-scale-codec = { workspace = true } log = { workspace = true } scale-info = { workspace = true } +serde = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } @@ -22,8 +23,6 @@ sp-std = { workspace = true } orml-traits = {path = "../traits", version = "1.0.0", default-features = false } [dev-dependencies] -serde = "1.0.136" - sp-core = { workspace = true } sp-io = { workspace = true } @@ -38,6 +37,7 @@ std = [ 'orml-traits/std', 'parity-scale-codec/std', 'scale-info/std', + 'serde', 'sp-runtime/std', 'sp-std/std', ] diff --git a/payments/src/lib.rs b/payments/src/lib.rs index 9163f0f4c..bd941b3d9 100644 --- a/payments/src/lib.rs +++ b/payments/src/lib.rs @@ -21,6 +21,7 @@ //! - CancelBufferBlockLength: This is the time window where the recipient can //! dispute a cancellation request from the payment creator. +//! //! Extrinsics //! //! - `pay` - Create an payment for the given currencyid/amount @@ -42,6 +43,7 @@ //! - `accept_and_pay` - Allows the sender to fulfill a payment request created //! by a recipient +//! //! Types //! //! The `PaymentDetail` struct stores information about the payment/escrow. A diff --git a/payments/src/types.rs b/payments/src/types.rs index 88cca5397..2dd780066 100644 --- a/payments/src/types.rs +++ b/payments/src/types.rs @@ -5,6 +5,9 @@ use parity_scale_codec::{Decode, Encode, HasCompact, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::{DispatchResult, Percent}; +#[cfg(feature = "std")] +use serde::{Deserialize, Serialize}; + /// The PaymentDetail struct stores information about the payment/escrow /// A "payment" in virto network is similar to an escrow, it is used to /// guarantee proof of funds and can be released once an agreed upon condition @@ -13,7 +16,7 @@ use sp_runtime::{DispatchResult, Percent}; #[derive(Encode, Decode, Debug, Clone, PartialEq, Eq, MaxEncodedLen, TypeInfo)] #[scale_info(skip_type_params(T))] #[codec(mel_bound(T: pallet::Config))] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct PaymentDetail { /// type of asset used for payment pub asset: AssetIdOf, @@ -38,7 +41,7 @@ pub struct PaymentDetail { #[derive(Encode, Decode, Debug, Clone, PartialEq, Eq, MaxEncodedLen, TypeInfo)] #[scale_info(skip_type_params(T))] #[codec(mel_bound(T: pallet::Config))] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub enum PaymentState { /// Amounts have been reserved and waiting for release/cancel Created, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b76bf618f..bd4541d29 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.77.0" +channel = "1.81.0" components = ["rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"] diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index cc7dfb83e..314066671 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -19,8 +19,7 @@ //! //! - `MultiCurrency` - Abstraction over a fungible multi-currency system. //! - `MultiCurrencyExtended` - Extended `MultiCurrency` with additional helper -//! types and methods, like updating balance -//! by a given signed integer amount. +//! types and methods, like updating balance by a given signed integer amount. //! //! ## Interface //! diff --git a/traits/src/currency.rs b/traits/src/currency.rs index 20aeaa503..e1772d27c 100644 --- a/traits/src/currency.rs +++ b/traits/src/currency.rs @@ -257,8 +257,7 @@ pub trait NamedMultiReservableCurrency: MultiReservableCurrency: BasicReser /// /// - This is different from `reserve`. /// - If the remaining reserved balance is less than `ExistentialDeposit`, - /// it will - /// invoke `on_reserved_too_low` and could reap the account. + /// it will invoke `on_reserved_too_low` and could reap the account. fn unreserve_named(id: &ReserveIdentifier, who: &AccountId, value: Self::Balance) -> Self::Balance; /// Moves up to `value` from reserved balance of account `slashed` to diff --git a/xcm-mock-message-queue/Cargo.toml b/xcm-mock-message-queue/Cargo.toml index 6c57a5cc3..f43825d55 100644 --- a/xcm-mock-message-queue/Cargo.toml +++ b/xcm-mock-message-queue/Cargo.toml @@ -37,3 +37,8 @@ std = [ "sp-std/std", "xcm/std", ] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +]