diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 66c71195f..e555a9934 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -38,6 +38,7 @@ jobs: make Cargo.toml cargo update cargo update base64ct --precise 1.6.0 # 1.8.0 requires the Cargo feature called `edition2024` + cargo update pallet-revive-proc-macro --precise 0.3.0 # TODO: https://github.com/paritytech/polkadot-sdk/issues/9425 cargo tarpaulin --verbose --no-fail-fast --workspace --timeout 300 --out Xml - name: Upload to codecov.io uses: codecov/codecov-action@v5 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dff8d9700..d92349b1f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,7 @@ jobs: run: | cargo update cargo update base64ct --precise 1.6.0 # 1.8.0 requires the Cargo feature called `edition2024` + cargo update pallet-revive-proc-macro --precise 0.3.0 # TODO: https://github.com/paritytech/polkadot-sdk/issues/9425 - name: Run clippy run: cargo clippy -- -D warnings - name: Check for Wasm diff --git a/nft/src/lib.rs b/nft/src/lib.rs index 2b8bf2891..bc527e437 100644 --- a/nft/src/lib.rs +++ b/nft/src/lib.rs @@ -23,7 +23,7 @@ use frame_support::{ensure, pallet_prelude::*, traits::Get, BoundedVec, Parameter}; use frame_system::pallet_prelude::*; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::{ traits::{AtLeast32BitUnsigned, CheckedAdd, CheckedSub, MaybeSerializeDeserialize, Member, One, Zero}, @@ -35,7 +35,7 @@ mod mock; mod tests; /// Class info -#[derive(Encode, Decode, Clone, Eq, PartialEq, MaxEncodedLen, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, MaxEncodedLen, RuntimeDebug, TypeInfo)] pub struct ClassInfo { /// Class metadata pub metadata: ClassMetadataOf, @@ -48,7 +48,7 @@ pub struct ClassInfo { } /// Token info -#[derive(Encode, Decode, Clone, Eq, PartialEq, MaxEncodedLen, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, MaxEncodedLen, RuntimeDebug, TypeInfo)] pub struct TokenInfo { /// Token metadata pub metadata: TokenMetadataOf, diff --git a/oracle/src/lib.rs b/oracle/src/lib.rs index 3c51dde96..c0c9faf9c 100644 --- a/oracle/src/lib.rs +++ b/oracle/src/lib.rs @@ -19,7 +19,7 @@ #![allow(clippy::string_lit_as_bytes)] #![allow(clippy::unused_unit)] -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; @@ -77,7 +77,20 @@ pub mod module { pub(crate) type MomentOf = <>::Time as Time>::Moment; pub(crate) type TimestampedValueOf = TimestampedValue<>::OracleValue, MomentOf>; - #[derive(Encode, Decode, RuntimeDebug, Eq, PartialEq, Clone, Copy, Ord, PartialOrd, TypeInfo, MaxEncodedLen)] + #[derive( + Encode, + Decode, + DecodeWithMemTracking, + RuntimeDebug, + Eq, + PartialEq, + Clone, + Copy, + Ord, + PartialOrd, + TypeInfo, + MaxEncodedLen, + )] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct TimestampedValue { pub value: Value, diff --git a/payments/src/types.rs b/payments/src/types.rs index 2dd780066..da6091d06 100644 --- a/payments/src/types.rs +++ b/payments/src/types.rs @@ -1,7 +1,7 @@ #![allow(unused_qualifications)] use crate::{pallet, AssetIdOf, BalanceOf}; use frame_system::pallet_prelude::*; -use parity_scale_codec::{Decode, Encode, HasCompact, MaxEncodedLen}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, HasCompact, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::{DispatchResult, Percent}; @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize}; /// guarantee proof of funds and can be released once an agreed upon condition /// has reached between the payment creator and recipient. The payment lifecycle /// is tracked using the state field. -#[derive(Encode, Decode, Debug, Clone, PartialEq, Eq, MaxEncodedLen, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Debug, Clone, PartialEq, Eq, MaxEncodedLen, TypeInfo)] #[scale_info(skip_type_params(T))] #[codec(mel_bound(T: pallet::Config))] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] @@ -38,7 +38,7 @@ pub struct PaymentDetail { /// The `PaymentState` enum tracks the possible states that a payment can be in. /// When a payment is 'completed' or 'cancelled' it is removed from storage and /// hence not tracked by a state. -#[derive(Encode, Decode, Debug, Clone, PartialEq, Eq, MaxEncodedLen, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Debug, Clone, PartialEq, Eq, MaxEncodedLen, TypeInfo)] #[scale_info(skip_type_params(T))] #[codec(mel_bound(T: pallet::Config))] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] @@ -109,15 +109,18 @@ pub trait FeeHandler { } /// Types of Tasks that can be scheduled in the pallet -#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, MaxEncodedLen)] pub enum Task { // payment `from` to `to` has to be cancelled Cancel, } /// The details of a scheduled task -#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] -pub struct ScheduledTask { +#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, MaxEncodedLen)] +pub struct ScheduledTask