diff --git a/Cargo.lock b/Cargo.lock index d129f4eea452c..a4cf608cdcdb0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23331,6 +23331,7 @@ dependencies = [ name = "sp-debug-derive" version = "14.0.0" dependencies = [ + "proc-macro-warning", "proc-macro2 1.0.95", "quote 1.0.40", "syn 2.0.98", diff --git a/bridges/bin/runtime-common/src/extensions.rs b/bridges/bin/runtime-common/src/extensions.rs index 9e27e01efa1e8..7f9ea38900cd7 100644 --- a/bridges/bin/runtime-common/src/extensions.rs +++ b/bridges/bin/runtime-common/src/extensions.rs @@ -271,7 +271,7 @@ where #[macro_export] macro_rules! generate_bridge_reject_obsolete_headers_and_messages { ($call:ty, $account_id:ty, $($filter_call:ty),*) => { - #[derive(Clone, codec::Decode, codec::DecodeWithMemTracking, Default, codec::Encode, Eq, PartialEq, sp_runtime::RuntimeDebug, scale_info::TypeInfo)] + #[derive(Clone, codec::Decode, codec::DecodeWithMemTracking, Default, codec::Encode, Eq, PartialEq, Debug, scale_info::TypeInfo)] pub struct BridgeRejectObsoleteHeadersAndMessages; impl sp_runtime::traits::TransactionExtension<$call> for BridgeRejectObsoleteHeadersAndMessages { const IDENTIFIER: &'static str = "BridgeRejectObsoleteHeadersAndMessages"; diff --git a/bridges/modules/grandpa/src/call_ext.rs b/bridges/modules/grandpa/src/call_ext.rs index 1d819a3073935..dc09b44d441be 100644 --- a/bridges/modules/grandpa/src/call_ext.rs +++ b/bridges/modules/grandpa/src/call_ext.rs @@ -23,6 +23,7 @@ use bp_header_chain::{ SubmitFinalityProofInfo, }; use bp_runtime::{BlockNumberOf, Chain, OwnedBridgeModule}; +use core::fmt::Debug; use frame_support::{ dispatch::CallableCallFor, traits::{Get, IsSubType}, @@ -32,12 +33,11 @@ use sp_consensus_grandpa::SetId; use sp_runtime::{ traits::{CheckedSub, Header, Zero}, transaction_validity::{InvalidTransaction, TransactionValidityError}, - RuntimeDebug, SaturatedConversion, + SaturatedConversion, }; -use sp_std::fmt::Debug; /// Verified `SubmitFinalityProofInfo`. -#[derive(Copy, Clone, PartialEq, RuntimeDebug)] +#[derive(Copy, Clone, PartialEq, Debug)] pub struct VerifiedSubmitFinalityProofInfo { /// Base call information. pub base: SubmitFinalityProofInfo, diff --git a/bridges/modules/grandpa/src/storage_types.rs b/bridges/modules/grandpa/src/storage_types.rs index 6d1a7882dd499..2d17d0a29e00b 100644 --- a/bridges/modules/grandpa/src/storage_types.rs +++ b/bridges/modules/grandpa/src/storage_types.rs @@ -20,7 +20,7 @@ use crate::{Config, Error}; use bp_header_chain::{AuthoritySet, ChainWithGrandpa}; use codec::{Decode, Encode, MaxEncodedLen}; -use frame_support::{traits::Get, BoundedVec, CloneNoBound, RuntimeDebugNoBound}; +use frame_support::{traits::Get, BoundedVec, CloneNoBound, DebugNoBound}; use scale_info::TypeInfo; use sp_consensus_grandpa::{AuthorityId, AuthorityList, AuthorityWeight, SetId}; use sp_std::marker::PhantomData; @@ -39,7 +39,7 @@ impl, I: 'static> Get for StoredAuthorityListLimit { } /// A bounded GRANDPA Authority List and ID. -#[derive(CloneNoBound, Decode, Encode, Eq, TypeInfo, MaxEncodedLen, RuntimeDebugNoBound)] +#[derive(CloneNoBound, Decode, Encode, Eq, TypeInfo, MaxEncodedLen, DebugNoBound)] #[scale_info(skip_type_params(T, I))] pub struct StoredAuthoritySet, I: 'static> { /// List of GRANDPA authorities for the current round. diff --git a/bridges/modules/messages/src/inbound_lane.rs b/bridges/modules/messages/src/inbound_lane.rs index 91f1159f8f915..262220e044483 100644 --- a/bridges/modules/messages/src/inbound_lane.rs +++ b/bridges/modules/messages/src/inbound_lane.rs @@ -26,8 +26,8 @@ use bp_messages::{ use bp_runtime::AccountIdOf; use codec::{Decode, Encode, EncodeLike, MaxEncodedLen}; use scale_info::{Type, TypeInfo}; -use sp_runtime::RuntimeDebug; use sp_std::prelude::PartialEq; +use Debug; /// Inbound lane storage. pub trait InboundLaneStorage { @@ -58,7 +58,7 @@ pub trait InboundLaneStorage { /// these generic bounds all over the code. /// /// The encoding of this type matches encoding of the corresponding `MessageData`. -#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)] +#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq)] pub struct StoredInboundLaneData, I: 'static>( pub InboundLaneData>>, ); diff --git a/bridges/modules/messages/src/lanes_manager.rs b/bridges/modules/messages/src/lanes_manager.rs index c785ed4e01efa..9d4b49afd93aa 100644 --- a/bridges/modules/messages/src/lanes_manager.rs +++ b/bridges/modules/messages/src/lanes_manager.rs @@ -26,14 +26,12 @@ use bp_messages::{ }; use bp_runtime::AccountIdOf; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use frame_support::{ensure, sp_runtime::RuntimeDebug, PalletError}; +use frame_support::{ensure, PalletError}; use scale_info::TypeInfo; use sp_std::marker::PhantomData; /// Lanes manager errors. -#[derive( - Encode, Decode, DecodeWithMemTracking, RuntimeDebug, PartialEq, Eq, PalletError, TypeInfo, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, Debug, PartialEq, Eq, PalletError, TypeInfo)] pub enum LanesManagerError { /// Inbound lane already exists. InboundLaneAlreadyExists, diff --git a/bridges/modules/messages/src/outbound_lane.rs b/bridges/modules/messages/src/outbound_lane.rs index 5f718109e329d..d87a89ed4dcf6 100644 --- a/bridges/modules/messages/src/outbound_lane.rs +++ b/bridges/modules/messages/src/outbound_lane.rs @@ -25,8 +25,8 @@ use bp_messages::{ use codec::{Decode, DecodeWithMemTracking, Encode}; use frame_support::{traits::Get, BoundedVec, PalletError}; use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; use sp_std::{collections::vec_deque::VecDeque, marker::PhantomData, ops::RangeInclusive}; +use Debug; /// Outbound lane storage. pub trait OutboundLaneStorage { @@ -65,9 +65,7 @@ impl, I: 'static> Get for StoredMessagePayloadLimit { pub type StoredMessagePayload = BoundedVec>; /// Result of messages receival confirmation. -#[derive( - Encode, Decode, DecodeWithMemTracking, RuntimeDebug, PartialEq, Eq, PalletError, TypeInfo, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, Debug, PartialEq, Eq, PalletError, TypeInfo)] pub enum ReceptionConfirmationError { /// Bridged chain is trying to confirm more messages than we have generated. May be a result /// of invalid bridged chain storage. diff --git a/bridges/modules/parachains/src/call_ext.rs b/bridges/modules/parachains/src/call_ext.rs index f6871ecdb0443..91da553aee537 100644 --- a/bridges/modules/parachains/src/call_ext.rs +++ b/bridges/modules/parachains/src/call_ext.rs @@ -26,11 +26,11 @@ use pallet_bridge_grandpa::SubmitFinalityProofHelper; use sp_runtime::{ traits::Zero, transaction_validity::{InvalidTransaction, TransactionValidityError}, - RuntimeDebug, + Debug, }; /// Verified `SubmitParachainHeadsInfo`. -#[derive(PartialEq, RuntimeDebug)] +#[derive(PartialEq, Debug)] pub struct VerifiedSubmitParachainHeadsInfo { /// Base call information. pub base: SubmitParachainHeadsInfo, diff --git a/bridges/modules/relayers/src/extension/mod.rs b/bridges/modules/relayers/src/extension/mod.rs index c953ab836e9c2..c22d678b489b3 100644 --- a/bridges/modules/relayers/src/extension/mod.rs +++ b/bridges/modules/relayers/src/extension/mod.rs @@ -36,7 +36,7 @@ use frame_support::{ dispatch::{DispatchInfo, PostDispatchInfo}, pallet_prelude::TransactionSource, weights::Weight, - CloneNoBound, DefaultNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, + CloneNoBound, DebugNoBound, DefaultNoBound, EqNoBound, PartialEqNoBound, }; use frame_system::Config as SystemConfig; use pallet_bridge_messages::{ @@ -52,7 +52,7 @@ use sp_runtime::{ TransactionExtension, ValidateResult, Zero, }, transaction_validity::{InvalidTransaction, TransactionValidityError, ValidTransactionBuilder}, - DispatchResult, RuntimeDebug, + DispatchResult, }; pub use grandpa_adapter::WithGrandpaChainExtensionConfig; @@ -96,7 +96,7 @@ impl { /// Do nothing with relayer account. None, @@ -121,7 +121,7 @@ pub enum RelayerAccountAction { Encode, EqNoBound, PartialEqNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, )] #[scale_info(skip_type_params(Runtime, Config, LaneId))] diff --git a/bridges/primitives/beefy/src/lib.rs b/bridges/primitives/beefy/src/lib.rs index 2494706818ef1..84012bf8e08a8 100644 --- a/bridges/primitives/beefy/src/lib.rs +++ b/bridges/primitives/beefy/src/lib.rs @@ -42,7 +42,7 @@ use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use sp_runtime::{ traits::{Convert, MaybeSerializeDeserialize}, - RuntimeAppPublic, RuntimeDebug, + Debug, RuntimeAppPublic, }; use sp_std::prelude::*; @@ -130,7 +130,7 @@ pub type BeefyMmrLeafOf = sp_consensus_beefy::mmr::MmrLeaf< /// /// Provides the initial context that the bridge needs in order to know /// where to start the sync process from. -#[derive(Encode, Decode, RuntimeDebug, PartialEq, Clone, TypeInfo, Serialize, Deserialize)] +#[derive(Encode, Decode, Debug, PartialEq, Clone, TypeInfo, Serialize, Deserialize)] pub struct InitializationData { /// Pallet operating mode. pub operating_mode: BasicOperatingMode, @@ -142,7 +142,7 @@ pub struct InitializationData { } /// Basic data, stored by the pallet for every imported commitment. -#[derive(Encode, Decode, RuntimeDebug, PartialEq, TypeInfo)] +#[derive(Encode, Decode, Debug, PartialEq, TypeInfo)] pub struct ImportedCommitment { /// Block number and hash of the finalized block parent. pub parent_number_and_hash: (BlockNumber, BlockHash), diff --git a/bridges/primitives/header-chain/src/call_info.rs b/bridges/primitives/header-chain/src/call_info.rs index acf7447adabc7..642beb4aee935 100644 --- a/bridges/primitives/header-chain/src/call_info.rs +++ b/bridges/primitives/header-chain/src/call_info.rs @@ -20,7 +20,7 @@ use crate::{justification, InitializationData}; use bp_runtime::HeaderOf; use codec::{Decode, Encode}; -use frame_support::{weights::Weight, RuntimeDebugNoBound}; +use frame_support::{weights::Weight, DebugNoBound}; use scale_info::TypeInfo; use sp_consensus_grandpa::SetId; use sp_runtime::traits::{Header as HeaderT, Zero}; @@ -60,7 +60,7 @@ pub enum BridgeGrandpaCall { pub type BridgeGrandpaCallOf = BridgeGrandpaCall>; /// A digest information on the `BridgeGrandpaCall::submit_finality_proof` call. -#[derive(Copy, Clone, PartialEq, RuntimeDebugNoBound)] +#[derive(Copy, Clone, PartialEq, DebugNoBound)] pub struct SubmitFinalityProofInfo { /// Number of the finality target. pub block_number: N, diff --git a/bridges/primitives/header-chain/src/justification/mod.rs b/bridges/primitives/header-chain/src/justification/mod.rs index 46c4656e33ac8..ee58a79469c34 100644 --- a/bridges/primitives/header-chain/src/justification/mod.rs +++ b/bridges/primitives/header-chain/src/justification/mod.rs @@ -34,7 +34,7 @@ use bp_runtime::{BlockNumberOf, Chain, HashOf, HeaderId}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_consensus_grandpa::{AuthorityId, AuthoritySignature}; -use sp_runtime::{traits::Header as HeaderT, RuntimeDebug, SaturatedConversion}; +use sp_runtime::{traits::Header as HeaderT, SaturatedConversion}; use sp_std::prelude::*; /// A GRANDPA Justification is a proof that a given header was finalized @@ -119,7 +119,7 @@ impl crate::FinalityProof for GrandpaJustificati } /// Justification verification error. -#[derive(Eq, RuntimeDebug, PartialEq)] +#[derive(Eq, Debug, PartialEq)] pub enum Error { /// Failed to decode justification. JustificationDecode, diff --git a/bridges/primitives/header-chain/src/justification/verification/mod.rs b/bridges/primitives/header-chain/src/justification/verification/mod.rs index 9d9f6a36b5e8b..f839f0b3021c5 100644 --- a/bridges/primitives/header-chain/src/justification/verification/mod.rs +++ b/bridges/primitives/header-chain/src/justification/verification/mod.rs @@ -25,7 +25,7 @@ use crate::{justification::GrandpaJustification, AuthoritySet}; use bp_runtime::HeaderId; use finality_grandpa::voter_set::VoterSet; use sp_consensus_grandpa::{AuthorityId, AuthoritySignature, SetId}; -use sp_runtime::{traits::Header as HeaderT, RuntimeDebug}; +use sp_runtime::traits::Header as HeaderT; use sp_std::{ collections::{ btree_map::{ @@ -47,7 +47,7 @@ type SignedPrecommit
= finality_grandpa::SignedPrecommit< >; /// Votes ancestries with useful methods. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct AncestryChain { /// We expect all forks in the ancestry chain to be descendants of base. base: HeaderId, @@ -136,7 +136,7 @@ impl AncestryChain
{ } /// Justification verification error. -#[derive(Eq, RuntimeDebug, PartialEq)] +#[derive(Eq, Debug, PartialEq)] pub enum Error { /// Could not convert `AuthorityList` to `VoterSet`. InvalidAuthorityList, @@ -154,7 +154,7 @@ pub enum Error { } /// Justification verification error. -#[derive(Eq, RuntimeDebug, PartialEq)] +#[derive(Eq, Debug, PartialEq)] pub enum PrecommitError { /// Justification contains redundant votes. RedundantAuthorityVote, @@ -170,7 +170,7 @@ pub enum PrecommitError { } /// The context needed for validating GRANDPA finality proofs. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct JustificationVerificationContext { /// The authority set used to verify the justification. pub voter_set: VoterSet, diff --git a/bridges/primitives/header-chain/src/lib.rs b/bridges/primitives/header-chain/src/lib.rs index cf7fde2dd739d..f67e734841dac 100644 --- a/bridges/primitives/header-chain/src/lib.rs +++ b/bridges/primitives/header-chain/src/lib.rs @@ -35,7 +35,7 @@ use serde::{Deserialize, Serialize}; use sp_consensus_grandpa::{ AuthorityList, ConsensusLog, ScheduledChange, SetId, GRANDPA_ENGINE_ID, }; -use sp_runtime::{traits::Header as HeaderT, Digest, RuntimeDebug, SaturatedConversion}; +use sp_runtime::{traits::Header as HeaderT, Digest, SaturatedConversion}; use sp_std::{boxed::Box, vec::Vec}; pub use call_info::{BridgeGrandpaCall, BridgeGrandpaCallOf, SubmitFinalityProofInfo}; @@ -60,7 +60,7 @@ pub enum HeaderChainError { /// /// Even though we may store full header, our applications (XCM) only use couple of header /// fields. Extracting those values makes on-chain storage and PoV smaller, which is good. -#[derive(Clone, Decode, Encode, Eq, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Decode, Encode, Eq, MaxEncodedLen, PartialEq, Debug, TypeInfo)] pub struct StoredHeaderData { /// Header number. pub number: Number, @@ -103,9 +103,7 @@ pub trait Parameter: Codec + EncodeLike + Clone + Eq + Debug + TypeInfo {} impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + Debug + TypeInfo {} /// A GRANDPA Authority List and ID. -#[derive( - Default, Encode, Eq, Decode, DecodeWithMemTracking, RuntimeDebug, PartialEq, Clone, TypeInfo, -)] +#[derive(Default, Encode, Eq, Decode, DecodeWithMemTracking, Debug, PartialEq, Clone, TypeInfo)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct AuthoritySet { /// List of GRANDPA authorities for the current round. @@ -129,7 +127,7 @@ impl AuthoritySet { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, PartialEq, Eq, Clone, diff --git a/bridges/primitives/messages/src/call_info.rs b/bridges/primitives/messages/src/call_info.rs index dfd076f029b47..215171a860cd6 100644 --- a/bridges/primitives/messages/src/call_info.rs +++ b/bridges/primitives/messages/src/call_info.rs @@ -21,8 +21,8 @@ use crate::{MessageNonce, UnrewardedRelayersState}; use codec::{Decode, Encode}; use frame_support::weights::Weight; use scale_info::TypeInfo; -use sp_core::RuntimeDebug; use sp_std::ops::RangeInclusive; +use Debug; /// A minimized version of `pallet-bridge-messages::Call` that can be used without a runtime. #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)] @@ -51,7 +51,7 @@ pub enum BridgeMessagesCall { } /// Generic info about a messages delivery/confirmation proof. -#[derive(PartialEq, RuntimeDebug)] +#[derive(PartialEq, Debug)] pub struct BaseMessagesProofInfo { /// Message lane, used by the call. pub lane_id: LaneId, @@ -75,7 +75,7 @@ impl BaseMessagesProofInfo { } /// Occupation state of the unrewarded relayers vector. -#[derive(PartialEq, RuntimeDebug)] +#[derive(PartialEq, Debug)] #[cfg_attr(test, derive(Default))] pub struct UnrewardedRelayerOccupation { /// The number of remaining unoccupied entries for new relayers. @@ -85,7 +85,7 @@ pub struct UnrewardedRelayerOccupation { } /// Info about a `ReceiveMessagesProof` call which tries to update a single lane. -#[derive(PartialEq, RuntimeDebug)] +#[derive(PartialEq, Debug)] pub struct ReceiveMessagesProofInfo { /// Base messages proof info pub base: BaseMessagesProofInfo, @@ -125,7 +125,7 @@ impl ReceiveMessagesProofInfo { } /// Info about a `ReceiveMessagesDeliveryProof` call which tries to update a single lane. -#[derive(PartialEq, RuntimeDebug)] +#[derive(PartialEq, Debug)] pub struct ReceiveMessagesDeliveryProofInfo(pub BaseMessagesProofInfo); impl ReceiveMessagesDeliveryProofInfo { @@ -137,7 +137,7 @@ impl ReceiveMessagesDeliveryProofInfo { /// Info about a `ReceiveMessagesProof` or a `ReceiveMessagesDeliveryProof` call /// which tries to update a single lane. -#[derive(PartialEq, RuntimeDebug)] +#[derive(PartialEq, Debug)] pub enum MessagesCallInfo { /// Messages delivery call info. ReceiveMessagesProof(ReceiveMessagesProofInfo), diff --git a/bridges/primitives/messages/src/lane.rs b/bridges/primitives/messages/src/lane.rs index adf06b64d31d9..8ad35098075c6 100644 --- a/bridges/primitives/messages/src/lane.rs +++ b/bridges/primitives/messages/src/lane.rs @@ -19,7 +19,7 @@ use codec::{Codec, Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen}; use scale_info::TypeInfo; use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use sp_core::{RuntimeDebug, TypeId, H256}; +use sp_core::{TypeId, H256}; use sp_io::hashing::blake2_256; use sp_std::fmt::Debug; @@ -199,7 +199,7 @@ impl TryFrom> for HashedLaneId { } /// Lane state. -#[derive(Clone, Copy, Decode, Encode, Eq, PartialEq, TypeInfo, MaxEncodedLen, RuntimeDebug)] +#[derive(Clone, Copy, Decode, Encode, Eq, PartialEq, TypeInfo, MaxEncodedLen, Debug)] pub enum LaneState { /// Lane is opened and messages may be sent/received over it. Opened, diff --git a/bridges/primitives/messages/src/lib.rs b/bridges/primitives/messages/src/lib.rs index 16f5cfa1bea66..b54f9618fa7d2 100644 --- a/bridges/primitives/messages/src/lib.rs +++ b/bridges/primitives/messages/src/lib.rs @@ -31,8 +31,8 @@ pub use frame_support::weights::Weight; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use source_chain::RelayersRewards; -use sp_core::RuntimeDebug; use sp_std::{collections::vec_deque::VecDeque, ops::RangeInclusive, prelude::*}; +use Debug; pub use call_info::{ BaseMessagesProofInfo, BridgeMessagesCall, MessagesCallInfo, ReceiveMessagesDeliveryProofInfo, @@ -140,7 +140,7 @@ where Copy, PartialEq, Eq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, Serialize, @@ -181,7 +181,7 @@ pub type MessageNonce = u64; pub type MessagePayload = Vec; /// Message key (unique message identifier) as it is stored in the storage. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct MessageKey { /// ID of the message lane. pub lane_id: LaneId, @@ -190,7 +190,7 @@ pub struct MessageKey { } /// Message as it is stored in the storage. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo)] pub struct Message { /// Message key. pub key: MessageKey, @@ -199,7 +199,7 @@ pub struct Message { } /// Inbound lane data. -#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo)] +#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, TypeInfo)] pub struct InboundLaneData { /// Identifiers of relayers and messages that they have delivered to this lane (ordered by /// message nonce). @@ -299,7 +299,7 @@ impl InboundLaneData { } /// Outbound message details, returned by runtime APIs. -#[derive(Clone, Encode, Decode, RuntimeDebug, PartialEq, Eq, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, PartialEq, Eq, TypeInfo)] pub struct OutboundMessageDetails { /// Nonce assigned to the message. pub nonce: MessageNonce, @@ -313,7 +313,7 @@ pub struct OutboundMessageDetails { } /// Inbound message details, returned by runtime APIs. -#[derive(Clone, Encode, Decode, RuntimeDebug, PartialEq, Eq, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, PartialEq, Eq, TypeInfo)] pub struct InboundMessageDetails { /// Computed message dispatch weight. /// @@ -328,7 +328,7 @@ pub struct InboundMessageDetails { /// /// This struct represents a continuous range of messages that have been delivered by the same /// relayer and whose confirmations are still pending. -#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, TypeInfo, MaxEncodedLen)] pub struct UnrewardedRelayer { /// Identifier of the relayer. pub relayer: RelayerId, @@ -337,7 +337,7 @@ pub struct UnrewardedRelayer { } /// Received messages with their dispatch result. -#[derive(Clone, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, PartialEq, Eq, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, Debug, PartialEq, Eq, TypeInfo)] pub struct ReceivedMessages { /// Id of the lane which is receiving messages. pub lane: LaneId, @@ -361,7 +361,7 @@ impl ReceivedMessages } /// Result of single message receival. -#[derive(RuntimeDebug, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, Clone, TypeInfo)] +#[derive(Debug, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, Clone, TypeInfo)] pub enum ReceptionResult { /// Message has been received and dispatched. Note that we don't care whether dispatch has /// been successful or not - in both case message falls into this category. @@ -383,7 +383,7 @@ pub enum ReceptionResult { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, PartialEq, Eq, TypeInfo, @@ -420,9 +420,7 @@ impl DeliveredMessages { } /// Gist of `InboundLaneData::relayers` field used by runtime APIs. -#[derive( - Clone, Default, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, PartialEq, Eq, TypeInfo, -)] +#[derive(Clone, Default, Encode, Decode, DecodeWithMemTracking, Debug, PartialEq, Eq, TypeInfo)] pub struct UnrewardedRelayersState { /// Number of entries in the `InboundLaneData::relayers` set. pub unrewarded_relayer_entries: MessageNonce, @@ -461,7 +459,7 @@ impl From<&InboundLaneData> for UnrewardedRelayersState { } /// Outbound lane data. -#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, TypeInfo, MaxEncodedLen)] pub struct OutboundLaneData { /// Nonce of the oldest message that we haven't yet pruned. May point to not-yet-generated /// message if all sent messages are already pruned. @@ -526,9 +524,7 @@ where } /// Error that happens during message verification. -#[derive( - Encode, Decode, DecodeWithMemTracking, RuntimeDebug, PartialEq, Eq, PalletError, TypeInfo, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, Debug, PartialEq, Eq, PalletError, TypeInfo)] pub enum VerificationError { /// The message proof is empty. EmptyMessageProof, diff --git a/bridges/primitives/messages/src/source_chain.rs b/bridges/primitives/messages/src/source_chain.rs index afb70b3d01598..4fa4e375673da 100644 --- a/bridges/primitives/messages/src/source_chain.rs +++ b/bridges/primitives/messages/src/source_chain.rs @@ -21,7 +21,6 @@ use crate::{MessageNonce, UnrewardedRelayer}; use bp_runtime::{raw_storage_proof_size, RawStorageProof, Size}; use codec::{Decode, DecodeWithMemTracking, Encode}; use scale_info::TypeInfo; -use sp_core::RuntimeDebug; use sp_std::{ collections::{btree_map::BTreeMap, vec_deque::VecDeque}, fmt::Debug, @@ -38,7 +37,7 @@ use sp_std::{ /// - storage proof of the inbound lane state; /// /// - lane id. -#[derive(Clone, Decode, DecodeWithMemTracking, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Decode, DecodeWithMemTracking, Encode, Eq, PartialEq, Debug, TypeInfo)] pub struct FromBridgedChainMessagesDeliveryProof { /// Hash of the bridge header the proof is for. pub bridged_header_hash: BridgedHeaderHash, @@ -108,7 +107,7 @@ impl OnMessagesDelivered for () { } /// Send message artifacts. -#[derive(Eq, RuntimeDebug, PartialEq)] +#[derive(Eq, Debug, PartialEq)] pub struct SendMessageArtifacts { /// Nonce of the message. pub nonce: MessageNonce, diff --git a/bridges/primitives/messages/src/target_chain.rs b/bridges/primitives/messages/src/target_chain.rs index e5b860ce305ee..253e34143272e 100644 --- a/bridges/primitives/messages/src/target_chain.rs +++ b/bridges/primitives/messages/src/target_chain.rs @@ -22,7 +22,6 @@ use bp_runtime::{messages::MessageDispatchResult, raw_storage_proof_size, RawSto use codec::{Decode, DecodeWithMemTracking, Encode, Error as CodecError}; use frame_support::weights::Weight; use scale_info::TypeInfo; -use sp_core::RuntimeDebug; use sp_std::{fmt::Debug, marker::PhantomData, prelude::*}; /// Messages proof from bridged chain. @@ -37,7 +36,7 @@ use sp_std::{fmt::Debug, marker::PhantomData, prelude::*}; /// - lane id; /// /// - nonces (inclusive range) of messages which are included in this proof. -#[derive(Clone, Decode, DecodeWithMemTracking, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Decode, DecodeWithMemTracking, Encode, Eq, PartialEq, Debug, TypeInfo)] pub struct FromBridgedChainMessagesProof { /// Hash of the finalized bridged header the proof is for. pub bridged_header_hash: BridgedHeaderHash, @@ -62,7 +61,7 @@ impl Size for FromBridgedChainMessagesProof = (LaneId, ProvedLaneMessages); /// Proved messages from single lane of the source chain. -#[derive(RuntimeDebug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)] +#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)] pub struct ProvedLaneMessages { /// Optional outbound lane state. pub lane_state: Option, @@ -71,14 +70,14 @@ pub struct ProvedLaneMessages { } /// Message data with decoded dispatch payload. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct DispatchMessageData { /// Result of dispatch payload decoding. pub payload: Result, } /// Message with decoded dispatch payload. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct DispatchMessage { /// Message key. pub key: MessageKey, diff --git a/bridges/primitives/parachains/src/call_info.rs b/bridges/primitives/parachains/src/call_info.rs index fd7cd45a72c81..d985951ca39c6 100644 --- a/bridges/primitives/parachains/src/call_info.rs +++ b/bridges/primitives/parachains/src/call_info.rs @@ -22,8 +22,8 @@ use bp_polkadot_core::parachains::ParaHeadsProof; use bp_runtime::HeaderId; use codec::{Decode, Encode}; use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; use sp_std::vec::Vec; +use Debug; /// A minimized version of `pallet-bridge-parachains::Call` that can be used without a runtime. #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)] @@ -44,7 +44,7 @@ pub enum BridgeParachainCall { /// Info about a `SubmitParachainHeads` call which tries to update a single parachain. /// /// The pallet supports updating multiple parachain heads at once, -#[derive(PartialEq, RuntimeDebug)] +#[derive(PartialEq, Debug)] pub struct SubmitParachainHeadsInfo { /// Number and hash of the finalized relay block that has been used to prove parachain /// finality. diff --git a/bridges/primitives/parachains/src/lib.rs b/bridges/primitives/parachains/src/lib.rs index 38acc588d5154..c8a50d8dbcd1d 100644 --- a/bridges/primitives/parachains/src/lib.rs +++ b/bridges/primitives/parachains/src/lib.rs @@ -31,7 +31,7 @@ use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{weights::Weight, Blake2_128Concat, Twox64Concat}; use scale_info::TypeInfo; use sp_core::storage::StorageKey; -use sp_runtime::{traits::Header as HeaderT, RuntimeDebug}; +use sp_runtime::traits::Header as HeaderT; use sp_std::{marker::PhantomData, prelude::*}; /// Block hash of the bridged relay chain. @@ -44,7 +44,7 @@ pub type RelayBlockHasher = bp_polkadot_core::Hasher; mod call_info; /// Best known parachain head hash. -#[derive(Clone, Decode, Encode, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Decode, Encode, MaxEncodedLen, PartialEq, Debug, TypeInfo)] pub struct BestParaHeadHash { /// Number of relay block where this head has been read. /// @@ -60,7 +60,7 @@ pub struct BestParaHeadHash { } /// Best known parachain head as it is stored in the runtime storage. -#[derive(Decode, Encode, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Decode, Encode, MaxEncodedLen, PartialEq, Debug, TypeInfo)] pub struct ParaInfo { /// Best known parachain head hash. pub best_head_hash: BestParaHeadHash, @@ -109,7 +109,7 @@ impl StorageDoubleMapKeyProvider for ImportedParaHeadsKeyProvider { /// /// We do not know exact structure of the parachain head, so we always store encoded version /// of the `bp_runtime::StoredHeaderData`. It is only decoded when we talk about specific parachain. -#[derive(Clone, Decode, Encode, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Decode, Encode, PartialEq, Debug, TypeInfo)] pub struct ParaStoredHeaderData(pub Vec); impl ParaStoredHeaderData { diff --git a/bridges/primitives/polkadot-core/src/parachains.rs b/bridges/primitives/polkadot-core/src/parachains.rs index 70de6e4c5b436..fc7c7abc4d8a7 100644 --- a/bridges/primitives/polkadot-core/src/parachains.rs +++ b/bridges/primitives/polkadot-core/src/parachains.rs @@ -26,8 +26,8 @@ use bp_runtime::{raw_storage_proof_size, RawStorageProof, Size}; use codec::{CompactAs, Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_core::Hasher; -use sp_runtime::RuntimeDebug; use sp_std::vec::Vec; +use Debug; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; @@ -50,7 +50,7 @@ use serde::{Deserialize, Serialize}; Ord, PartialEq, PartialOrd, - RuntimeDebug, + Debug, TypeInfo, )] pub struct ParaId(pub u32); @@ -75,7 +75,7 @@ impl From for ParaId { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, Default, )] @@ -96,7 +96,7 @@ pub type ParaHash = crate::Hash; pub type ParaHasher = crate::Hasher; /// Raw storage proof of parachain heads, stored in polkadot-like chain runtime. -#[derive(Clone, Decode, DecodeWithMemTracking, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Decode, DecodeWithMemTracking, Encode, Eq, PartialEq, Debug, TypeInfo)] pub struct ParaHeadsProof { /// Unverified storage proof of finalized parachain heads. pub storage_proof: RawStorageProof, diff --git a/bridges/primitives/relayers/src/extension.rs b/bridges/primitives/relayers/src/extension.rs index 8fd0f151e2a5e..c51374c271d02 100644 --- a/bridges/primitives/relayers/src/extension.rs +++ b/bridges/primitives/relayers/src/extension.rs @@ -22,20 +22,18 @@ use bp_messages::MessagesCallInfo; use bp_parachains::SubmitParachainHeadsInfo; use bp_runtime::StaticStrProvider; use codec::{Decode, Encode}; -use frame_support::{ - dispatch::CallableCallFor, traits::IsSubType, weights::Weight, RuntimeDebugNoBound, -}; +use core::fmt::Debug; +use frame_support::{dispatch::CallableCallFor, traits::IsSubType, weights::Weight, DebugNoBound}; use frame_system::Config as SystemConfig; use pallet_utility::{Call as UtilityCall, Pallet as UtilityPallet}; use sp_runtime::{ traits::Get, transaction_validity::{TransactionPriority, TransactionValidityError}, - RuntimeDebug, }; -use sp_std::{fmt::Debug, marker::PhantomData, vec, vec::Vec}; +use sp_std::{marker::PhantomData, vec, vec::Vec}; /// Type of the call that the signed extension recognizes. -#[derive(PartialEq, RuntimeDebugNoBound)] +#[derive(PartialEq, DebugNoBound)] pub enum ExtensionCallInfo { /// Relay chain finality + parachain finality + message delivery/confirmation calls. AllFinalityAndMsgs( @@ -99,7 +97,7 @@ impl { /// Transaction is immortal. Immortal, @@ -346,7 +346,7 @@ pub trait OperatingMode: Send + Copy + Debug + FullCodec { Copy, PartialEq, Eq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, Serialize, diff --git a/bridges/primitives/runtime/src/messages.rs b/bridges/primitives/runtime/src/messages.rs index 4163fdc6fc151..04cc4007d8859 100644 --- a/bridges/primitives/runtime/src/messages.rs +++ b/bridges/primitives/runtime/src/messages.rs @@ -19,10 +19,10 @@ use codec::{Decode, DecodeWithMemTracking, Encode}; use frame_support::weights::Weight; use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; +use Debug; /// Message dispatch result. -#[derive(Encode, Decode, DecodeWithMemTracking, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Debug, Clone, PartialEq, Eq, TypeInfo)] pub struct MessageDispatchResult { /// Unspent dispatch weight. This weight that will be deducted from total delivery transaction /// weight, thus reducing the transaction cost. This shall not be zero in (at least) two cases: diff --git a/bridges/primitives/runtime/src/storage_proof.rs b/bridges/primitives/runtime/src/storage_proof.rs index 19355358e2e33..f4a0a07ee4bfd 100644 --- a/bridges/primitives/runtime/src/storage_proof.rs +++ b/bridges/primitives/runtime/src/storage_proof.rs @@ -17,11 +17,11 @@ //! Logic for working with storage proofs. use frame_support::PalletError; -use sp_core::RuntimeDebug; use sp_std::vec::Vec; use sp_trie::{ accessed_nodes_tracker::AccessedNodesTracker, read_trie_value, LayoutV1, MemoryDB, StorageProof, }; +use Debug; use codec::{Decode, DecodeWithMemTracking, Encode}; use hash_db::{HashDB, Hasher, EMPTY_PREFIX}; @@ -33,7 +33,7 @@ use trie_db::{Trie, TrieConfiguration, TrieDBMut}; /// Errors that can occur when interacting with `UnverifiedStorageProof` and `VerifiedStorageProof`. #[derive( - Clone, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, PartialEq, Eq, PalletError, TypeInfo, + Clone, Encode, Decode, DecodeWithMemTracking, Debug, PartialEq, Eq, PalletError, TypeInfo, )] pub enum StorageProofError { /// Call to `generate_trie_proof()` failed. diff --git a/bridges/primitives/runtime/src/storage_types.rs b/bridges/primitives/runtime/src/storage_types.rs index 91c5451805a98..a113967a5fdca 100644 --- a/bridges/primitives/runtime/src/storage_types.rs +++ b/bridges/primitives/runtime/src/storage_types.rs @@ -20,11 +20,11 @@ use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::traits::Get; use scale_info::{Type, TypeInfo}; -use sp_runtime::RuntimeDebug; use sp_std::{marker::PhantomData, ops::Deref}; +use Debug; /// Error that is returned when the value size exceeds maximal configured size. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct MaximalSizeExceededError { /// Size of the value. pub value_size: usize, diff --git a/bridges/primitives/test-utils/src/keyring.rs b/bridges/primitives/test-utils/src/keyring.rs index 22691183acf7a..00d41ad3b8151 100644 --- a/bridges/primitives/test-utils/src/keyring.rs +++ b/bridges/primitives/test-utils/src/keyring.rs @@ -21,8 +21,8 @@ use codec::Encode; use ed25519_dalek::{Signature, SigningKey, VerifyingKey}; use finality_grandpa::voter_set::VoterSet; use sp_consensus_grandpa::{AuthorityId, AuthorityList, AuthorityWeight, SetId}; -use sp_runtime::RuntimeDebug; use sp_std::prelude::*; +use Debug; /// Set of test accounts with friendly names: Alice. pub const ALICE: Account = Account(0); @@ -38,7 +38,7 @@ pub const EVE: Account = Account(4); pub const FERDIE: Account = Account(5); /// A test account which can be used to sign messages. -#[derive(RuntimeDebug, Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct Account(pub u16); impl Account { diff --git a/bridges/primitives/xcm-bridge-hub-router/src/lib.rs b/bridges/primitives/xcm-bridge-hub-router/src/lib.rs index 89123b51ef2f9..f0a8439f1401b 100644 --- a/bridges/primitives/xcm-bridge-hub-router/src/lib.rs +++ b/bridges/primitives/xcm-bridge-hub-router/src/lib.rs @@ -21,7 +21,7 @@ use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_core::H256; -use sp_runtime::{FixedU128, RuntimeDebug}; +use sp_runtime::FixedU128; use xcm::latest::prelude::Location; /// Minimal delivery fee factor. @@ -43,7 +43,7 @@ impl XcmChannelStatusProvider for () { } /// Current status of the bridge. -#[derive(Clone, Decode, Encode, Eq, PartialEq, TypeInfo, MaxEncodedLen, RuntimeDebug)] +#[derive(Clone, Decode, Encode, Eq, PartialEq, TypeInfo, MaxEncodedLen, Debug)] pub struct BridgeState { /// Current delivery fee factor. pub delivery_fee_factor: FixedU128, diff --git a/bridges/primitives/xcm-bridge-hub/src/lib.rs b/bridges/primitives/xcm-bridge-hub/src/lib.rs index 89bb888ab3faa..9659905bd733e 100644 --- a/bridges/primitives/xcm-bridge-hub/src/lib.rs +++ b/bridges/primitives/xcm-bridge-hub/src/lib.rs @@ -23,10 +23,7 @@ use bp_messages::LaneIdType; use bp_runtime::{AccountIdOf, BalanceOf, Chain}; pub use call_info::XcmBridgeHubCall; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use frame_support::{ - ensure, sp_runtime::RuntimeDebug, CloneNoBound, PalletError, PartialEqNoBound, - RuntimeDebugNoBound, -}; +use frame_support::{ensure, CloneNoBound, DebugNoBound, PalletError, PartialEqNoBound}; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use sp_core::H256; @@ -142,7 +139,7 @@ impl LocalXcmChannelManager for () { } /// Bridge state. -#[derive(Clone, Copy, Decode, Encode, Eq, PartialEq, TypeInfo, MaxEncodedLen, RuntimeDebug)] +#[derive(Clone, Copy, Decode, Encode, Eq, PartialEq, TypeInfo, MaxEncodedLen, Debug)] pub enum BridgeState { /// Bridge is opened. Associated lanes are also opened. Opened, @@ -158,7 +155,7 @@ pub enum BridgeState { /// Bridge metadata. #[derive( - CloneNoBound, Decode, Encode, Eq, PartialEqNoBound, TypeInfo, MaxEncodedLen, RuntimeDebugNoBound, + CloneNoBound, Decode, Encode, Eq, PartialEqNoBound, TypeInfo, MaxEncodedLen, DebugNoBound, )] #[scale_info(skip_type_params(ThisChain, LaneId))] pub struct Bridge { @@ -185,7 +182,7 @@ pub struct Bridge { } /// Locations of bridge endpoints at both sides of the bridge. -#[derive(Clone, RuntimeDebug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct BridgeLocations { /// Relative (to this bridge hub) location of this side of the bridge. bridge_origin_relative_location: Location, @@ -198,9 +195,7 @@ pub struct BridgeLocations { } /// Errors that may happen when we check bridge locations. -#[derive( - Encode, Decode, DecodeWithMemTracking, RuntimeDebug, PartialEq, Eq, PalletError, TypeInfo, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, Debug, PartialEq, Eq, PalletError, TypeInfo)] pub enum BridgeLocationsError { /// Origin or destination locations are not universal. NonUniversalLocation, diff --git a/bridges/snowbridge/pallets/inbound-queue/src/envelope.rs b/bridges/snowbridge/pallets/inbound-queue/src/envelope.rs index 2ba779b410709..34507f10302ab 100644 --- a/bridges/snowbridge/pallets/inbound-queue/src/envelope.rs +++ b/bridges/snowbridge/pallets/inbound-queue/src/envelope.rs @@ -3,7 +3,7 @@ use snowbridge_core::ChannelId; use snowbridge_inbound_queue_primitives::Log; -use sp_core::{RuntimeDebug, H160, H256}; +use sp_core::{H160, H256}; use sp_std::prelude::*; use alloy_core::{primitives::B256, sol, sol_types::SolEvent}; @@ -13,7 +13,7 @@ sol! { } /// An inbound message that has had its outer envelope decoded. -#[derive(Clone, RuntimeDebug)] +#[derive(Clone, Debug)] pub struct Envelope { /// The address of the outbound queue on Ethereum that emitted this message as an event log pub gateway: H160, @@ -27,7 +27,7 @@ pub struct Envelope { pub payload: Vec, } -#[derive(Copy, Clone, RuntimeDebug)] +#[derive(Copy, Clone, Debug)] pub struct EnvelopeDecodeError; impl TryFrom<&Log> for Envelope { diff --git a/bridges/snowbridge/pallets/outbound-queue-v2/src/types.rs b/bridges/snowbridge/pallets/outbound-queue-v2/src/types.rs index b001381d0e642..a045a0c501b31 100644 --- a/bridges/snowbridge/pallets/outbound-queue-v2/src/types.rs +++ b/bridges/snowbridge/pallets/outbound-queue-v2/src/types.rs @@ -6,13 +6,13 @@ use frame_support::traits::ProcessMessage; use scale_info::TypeInfo; pub use snowbridge_merkle_tree::MerkleProof; use sp_core::H256; -use sp_runtime::RuntimeDebug; use sp_std::prelude::*; +use Debug; pub type ProcessMessageOriginOf = as ProcessMessage>::Origin; /// Pending order -#[derive(Encode, Decode, TypeInfo, Clone, Eq, PartialEq, RuntimeDebug, MaxEncodedLen)] +#[derive(Encode, Decode, TypeInfo, Clone, Eq, PartialEq, Debug, MaxEncodedLen)] pub struct PendingOrder { /// The nonce used to identify the message pub nonce: u64, diff --git a/bridges/snowbridge/pallets/outbound-queue/src/send_message_impl.rs b/bridges/snowbridge/pallets/outbound-queue/src/send_message_impl.rs index 6d13703d864eb..6ce446250f512 100644 --- a/bridges/snowbridge/pallets/outbound-queue/src/send_message_impl.rs +++ b/bridges/snowbridge/pallets/outbound-queue/src/send_message_impl.rs @@ -7,7 +7,7 @@ use codec::Encode; use frame_support::{ ensure, traits::{EnqueueMessage, Get}, - CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, + CloneNoBound, DebugNoBound, PartialEqNoBound, }; use frame_system::unique; use snowbridge_core::{ChannelId, PRIMARY_GOVERNANCE_CHANNEL}; @@ -22,7 +22,7 @@ use sp_runtime::BoundedVec; pub type MaxEnqueuedMessageSizeOf = <::MessageQueue as EnqueueMessage>::MaxMessageLen; -#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound)] +#[derive(Encode, Decode, CloneNoBound, PartialEqNoBound, DebugNoBound)] pub struct Ticket where T: Config, diff --git a/bridges/snowbridge/pallets/outbound-queue/src/types.rs b/bridges/snowbridge/pallets/outbound-queue/src/types.rs index 76d32fab462a4..d9e9d8cda99ec 100644 --- a/bridges/snowbridge/pallets/outbound-queue/src/types.rs +++ b/bridges/snowbridge/pallets/outbound-queue/src/types.rs @@ -6,8 +6,8 @@ use frame_support::traits::ProcessMessage; use scale_info::TypeInfo; use snowbridge_core::ChannelId; use sp_core::H256; -use sp_runtime::RuntimeDebug; use sp_std::prelude::*; +use Debug; use super::Pallet; @@ -16,7 +16,7 @@ pub type ProcessMessageOriginOf = as ProcessMessage>::Origin; pub const LOG_TARGET: &str = "snowbridge-outbound-queue"; /// Message which has been assigned a nonce and will be committed at the end of a block -#[derive(Encode, Decode, Clone, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Clone, PartialEq, Debug, TypeInfo)] pub struct CommittedMessage { /// Message channel pub channel_id: ChannelId, diff --git a/bridges/snowbridge/pallets/system/src/lib.rs b/bridges/snowbridge/pallets/system/src/lib.rs index d277186bd5b9d..004b50b846d88 100644 --- a/bridges/snowbridge/pallets/system/src/lib.rs +++ b/bridges/snowbridge/pallets/system/src/lib.rs @@ -50,7 +50,7 @@ use snowbridge_outbound_queue_primitives::{ v1::{Command, Initializer, Message, SendMessage}, OperatingMode, SendError, }; -use sp_core::{RuntimeDebug, H160, H256}; +use sp_core::{H160, H256}; use sp_io::hashing::blake2_256; use sp_runtime::{traits::MaybeConvert, DispatchError, SaturatedConversion}; use sp_std::prelude::*; @@ -81,7 +81,7 @@ where } /// Whether a fee should be withdrawn to an account for sending an outbound message -#[derive(Clone, PartialEq, RuntimeDebug)] +#[derive(Clone, PartialEq, Debug)] pub enum PaysFee where T: Config, diff --git a/bridges/snowbridge/pallets/system/src/mock.rs b/bridges/snowbridge/pallets/system/src/mock.rs index 311981a873b01..252c3f796b0f2 100644 --- a/bridges/snowbridge/pallets/system/src/mock.rs +++ b/bridges/snowbridge/pallets/system/src/mock.rs @@ -50,15 +50,7 @@ mod pallet_xcm_origin { // Insert this custom Origin into the aggregate RuntimeOrigin #[pallet::origin] #[derive( - PartialEq, - Eq, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, MaxEncodedLen, )] pub struct Origin(pub Location); diff --git a/bridges/snowbridge/primitives/beacon/src/bls.rs b/bridges/snowbridge/primitives/beacon/src/bls.rs index 5834b9986564c..4ae62e033798a 100644 --- a/bridges/snowbridge/primitives/beacon/src/bls.rs +++ b/bridges/snowbridge/primitives/beacon/src/bls.rs @@ -9,20 +9,11 @@ pub use milagro_bls::{ }; use scale_info::TypeInfo; use sp_core::H256; -use sp_runtime::RuntimeDebug; use sp_std::prelude::*; +use Debug; #[derive( - Copy, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - TypeInfo, - RuntimeDebug, - PalletError, + Copy, Clone, Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, TypeInfo, Debug, PalletError, )] pub enum BlsError { InvalidSignature, diff --git a/bridges/snowbridge/primitives/beacon/src/types.rs b/bridges/snowbridge/primitives/beacon/src/types.rs index 4863a70bb8d42..accb0e813b99c 100644 --- a/bridges/snowbridge/primitives/beacon/src/types.rs +++ b/bridges/snowbridge/primitives/beacon/src/types.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2023 Snowfork use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use frame_support::{CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound}; +use frame_support::{CloneNoBound, DebugNoBound, PartialEqNoBound}; use scale_info::TypeInfo; use sp_core::{H160, H256, U256}; -use sp_runtime::RuntimeDebug; use sp_std::{boxed::Box, iter::repeat, prelude::*}; +use Debug; use crate::config::{PUBKEY_SIZE, SIGNATURE_SIZE}; @@ -29,7 +29,7 @@ use milagro_bls::PublicKey as PublicKeyPrepared; pub type ValidatorIndex = u64; pub type ForkVersion = [u8; 4]; -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, PartialEq, Debug, TypeInfo)] pub struct ForkVersions { pub genesis: Fork, pub altair: Fork, @@ -40,13 +40,13 @@ pub struct ForkVersions { pub fulu: Fork, } -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, PartialEq, Debug, TypeInfo)] pub struct Fork { pub version: [u8; 4], pub epoch: u64, } -#[derive(Copy, Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Copy, Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Debug, TypeInfo)] pub struct PublicKey(pub [u8; PUBKEY_SIZE]); impl Default for PublicKey { @@ -87,7 +87,7 @@ impl Serialize for PublicKey { } } -#[derive(Copy, Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Copy, Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Debug, TypeInfo)] pub struct Signature(pub [u8; SIGNATURE_SIZE]); impl Default for Signature { @@ -118,7 +118,7 @@ pub struct FinalizedHeaderState { pub beacon_slot: u64, } -#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug)] +#[derive(Clone, Default, Encode, Decode, PartialEq, Debug)] pub struct ForkData { // 1 or 0 bit, indicates whether a sync committee participated in a vote pub current_version: [u8; 4], @@ -131,7 +131,7 @@ impl ForkData { } } -#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug)] +#[derive(Clone, Default, Encode, Decode, PartialEq, Debug)] pub struct SigningData { pub object_root: H256, pub domain: H256, @@ -150,7 +150,7 @@ impl SigningData { DecodeWithMemTracking, PartialEqNoBound, CloneNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, MaxEncodedLen, )] @@ -231,7 +231,7 @@ impl TryFrom<&SyncCommittee> Decode, DecodeWithMemTracking, PartialEq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -257,13 +257,7 @@ impl BeaconHeader { } #[derive( - Encode, - Decode, - DecodeWithMemTracking, - CloneNoBound, - PartialEqNoBound, - RuntimeDebugNoBound, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, CloneNoBound, PartialEqNoBound, DebugNoBound, TypeInfo, )] #[cfg_attr( feature = "std", @@ -335,7 +329,7 @@ impl DecodeWithMemTracking, CloneNoBound, PartialEqNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, )] #[cfg_attr( @@ -372,15 +366,7 @@ impl ExecutionPayloadHeader { } #[derive( - Default, - Encode, - Decode, - Copy, - Clone, - PartialEqNoBound, - RuntimeDebugNoBound, - TypeInfo, - MaxEncodedLen, + Default, Encode, Decode, Copy, Clone, PartialEqNoBound, DebugNoBound, TypeInfo, MaxEncodedLen, )] pub struct CompactBeaconState { #[codec(compact)] @@ -390,13 +376,7 @@ pub struct CompactBeaconState { /// VersionedExecutionPayloadHeader #[derive( - Encode, - Decode, - DecodeWithMemTracking, - CloneNoBound, - PartialEqNoBound, - RuntimeDebugNoBound, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, CloneNoBound, PartialEqNoBound, DebugNoBound, TypeInfo, )] #[cfg_attr( feature = "std", @@ -452,13 +432,7 @@ impl VersionedExecutionPayloadHeader { } #[derive( - Encode, - Decode, - DecodeWithMemTracking, - CloneNoBound, - PartialEqNoBound, - RuntimeDebugNoBound, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, CloneNoBound, PartialEqNoBound, DebugNoBound, TypeInfo, )] #[cfg_attr( feature = "std", @@ -477,13 +451,7 @@ pub struct ExecutionProof { } #[derive( - Encode, - Decode, - DecodeWithMemTracking, - CloneNoBound, - PartialEqNoBound, - RuntimeDebugNoBound, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, CloneNoBound, PartialEqNoBound, DebugNoBound, TypeInfo, )] #[cfg_attr( feature = "std", @@ -616,7 +584,7 @@ mod tests { } /// Operating modes for beacon client -#[derive(Encode, Decode, Copy, Clone, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Debug, TypeInfo)] pub enum Mode { Active, Blocked, @@ -624,7 +592,7 @@ pub enum Mode { pub mod deneb { use codec::{Decode, DecodeWithMemTracking, Encode}; - use frame_support::{CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound}; + use frame_support::{CloneNoBound, DebugNoBound, PartialEqNoBound}; use scale_info::TypeInfo; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; @@ -640,7 +608,7 @@ pub mod deneb { DecodeWithMemTracking, CloneNoBound, PartialEqNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, )] #[cfg_attr( diff --git a/bridges/snowbridge/primitives/beacon/src/updates.rs b/bridges/snowbridge/primitives/beacon/src/updates.rs index bcd371b6c77a0..9447461c7ae06 100644 --- a/bridges/snowbridge/primitives/beacon/src/updates.rs +++ b/bridges/snowbridge/primitives/beacon/src/updates.rs @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2023 Snowfork use codec::{Decode, DecodeWithMemTracking, Encode}; -use frame_support::{CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound}; +use frame_support::{CloneNoBound, DebugNoBound, PartialEqNoBound}; use scale_info::TypeInfo; use sp_core::H256; use sp_std::prelude::*; @@ -9,13 +9,7 @@ use sp_std::prelude::*; use crate::types::{BeaconHeader, SyncAggregate, SyncCommittee}; #[derive( - Encode, - Decode, - DecodeWithMemTracking, - CloneNoBound, - PartialEqNoBound, - RuntimeDebugNoBound, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, CloneNoBound, PartialEqNoBound, DebugNoBound, TypeInfo, )] #[cfg_attr( feature = "std", @@ -38,7 +32,7 @@ pub struct CheckpointUpdate { DecodeWithMemTracking, CloneNoBound, PartialEqNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, )] #[cfg_attr( @@ -75,7 +69,7 @@ pub struct Update DecodeWithMemTracking, CloneNoBound, PartialEqNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, )] #[cfg_attr( diff --git a/bridges/snowbridge/primitives/core/src/digest_item.rs b/bridges/snowbridge/primitives/core/src/digest_item.rs index fec6fa83a8bfa..0b493367abd44 100644 --- a/bridges/snowbridge/primitives/core/src/digest_item.rs +++ b/bridges/snowbridge/primitives/core/src/digest_item.rs @@ -15,11 +15,11 @@ //! Custom digest items use codec::{Decode, Encode}; -use sp_core::{RuntimeDebug, H256}; +use sp_core::H256; use sp_runtime::generic::DigestItem; /// Custom header digest items, inserted as DigestItem::Other -#[derive(Encode, Decode, Copy, Clone, Eq, PartialEq, RuntimeDebug)] +#[derive(Encode, Decode, Copy, Clone, Eq, PartialEq, Debug)] pub enum SnowbridgeDigestItem { #[codec(index = 0)] /// Merkle root of outbound Snowbridge messages. diff --git a/bridges/snowbridge/primitives/core/src/lib.rs b/bridges/snowbridge/primitives/core/src/lib.rs index 258fd1dcf01fa..b492cc74a7f26 100644 --- a/bridges/snowbridge/primitives/core/src/lib.rs +++ b/bridges/snowbridge/primitives/core/src/lib.rs @@ -29,7 +29,7 @@ use hex_literal::hex; use scale_info::TypeInfo; use sp_core::{ConstU32, H256}; use sp_io::hashing::keccak_256; -use sp_runtime::{traits::AccountIdConversion, RuntimeDebug}; +use sp_runtime::traits::AccountIdConversion; use sp_std::prelude::*; use xcm::latest::{Asset, Junction::Parachain, Location, Result as XcmResult, XcmContext}; use xcm_executor::traits::TransactAsset; @@ -77,7 +77,7 @@ pub const ROC: u128 = 1_000_000_000_000; PartialEq, Eq, Default, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, )] @@ -138,7 +138,7 @@ impl AsRef<[u8]> for ChannelId { } } -#[derive(Clone, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, MaxEncodedLen, TypeInfo)] pub struct Channel { /// ID of the agent contract deployed on Ethereum pub agent_id: AgentId, @@ -164,7 +164,7 @@ pub const SECONDARY_GOVERNANCE_CHANNEL: ChannelId = ChannelId::new(hex!("0000000000000000000000000000000000000000000000000000000000000002")); /// Metadata to include in the instantiated ERC20 token contract -#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Debug, TypeInfo)] pub struct AssetMetadata { pub name: BoundedVec>, pub symbol: BoundedVec>, diff --git a/bridges/snowbridge/primitives/core/src/operating_mode.rs b/bridges/snowbridge/primitives/core/src/operating_mode.rs index 29a473f31187d..2482661a10dfd 100644 --- a/bridges/snowbridge/primitives/core/src/operating_mode.rs +++ b/bridges/snowbridge/primitives/core/src/operating_mode.rs @@ -1,6 +1,6 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; +use Debug; /// Basic operating modes for a bridges module (Normal/Halted). #[derive( @@ -11,7 +11,7 @@ use sp_runtime::RuntimeDebug; Copy, PartialEq, Eq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] diff --git a/bridges/snowbridge/primitives/core/src/pricing.rs b/bridges/snowbridge/primitives/core/src/pricing.rs index 460c59e1f2cdf..e8a8bc703ec90 100644 --- a/bridges/snowbridge/primitives/core/src/pricing.rs +++ b/bridges/snowbridge/primitives/core/src/pricing.rs @@ -2,11 +2,11 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_arithmetic::traits::{BaseArithmetic, Unsigned, Zero}; use sp_core::U256; -use sp_runtime::{FixedU128, RuntimeDebug}; +use sp_runtime::FixedU128; use sp_std::prelude::*; #[derive( - Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo, + Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Debug, MaxEncodedLen, TypeInfo, )] pub struct PricingParameters { /// ETH/DOT exchange rate @@ -20,7 +20,7 @@ pub struct PricingParameters { } #[derive( - Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo, + Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Debug, MaxEncodedLen, TypeInfo, )] pub struct Rewards { /// Local reward in DOT @@ -29,7 +29,7 @@ pub struct Rewards { pub remote: U256, } -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct InvalidPricingParameters; impl PricingParameters @@ -57,7 +57,7 @@ where } /// Holder for fixed point number implemented in -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct UD60x18(U256); diff --git a/bridges/snowbridge/primitives/inbound-queue/src/v1.rs b/bridges/snowbridge/primitives/inbound-queue/src/v1.rs index 6eba682f72f74..7e3d59d2b742e 100644 --- a/bridges/snowbridge/primitives/inbound-queue/src/v1.rs +++ b/bridges/snowbridge/primitives/inbound-queue/src/v1.rs @@ -8,7 +8,7 @@ use core::marker::PhantomData; use frame_support::{traits::tokens::Balance as BalanceT, PalletError}; use scale_info::TypeInfo; use snowbridge_core::TokenId; -use sp_core::{Get, RuntimeDebug, H160, H256}; +use sp_core::{Get, H160, H256}; use sp_runtime::{traits::MaybeConvert, MultiAddress}; use sp_std::prelude::*; use xcm::prelude::{Junction::AccountKey20, *}; @@ -18,14 +18,14 @@ const MINIMUM_DEPOSIT: u128 = 1; /// Messages from Ethereum are versioned. This is because in future, /// we may want to evolve the protocol so that the ethereum side sends XCM messages directly. /// Instead having BridgeHub transcode the messages into XCM. -#[derive(Clone, Encode, Decode, RuntimeDebug)] +#[derive(Clone, Encode, Decode, Debug)] pub enum VersionedMessage { V1(MessageV1), } /// For V1, the ethereum side sends messages which are transcoded into XCM. These messages are /// self-contained, in that they can be transcoded using only information in the message. -#[derive(Clone, Encode, Decode, RuntimeDebug)] +#[derive(Clone, Encode, Decode, Debug)] pub struct MessageV1 { /// EIP-155 chain id of the origin Ethereum network pub chain_id: u64, @@ -33,7 +33,7 @@ pub struct MessageV1 { pub command: Command, } -#[derive(Clone, Encode, Decode, RuntimeDebug)] +#[derive(Clone, Encode, Decode, Debug)] pub enum Command { /// Register a wrapped token on the AssetHub `ForeignAssets` pallet RegisterToken { @@ -67,7 +67,7 @@ pub enum Command { } /// Destination for bridged tokens -#[derive(Clone, Encode, Decode, RuntimeDebug)] +#[derive(Clone, Encode, Decode, Debug)] pub enum Destination { /// The funds will be deposited into account `id` on AssetHub AccountId32 { id: [u8; 32] }, @@ -121,9 +121,7 @@ pub struct MessageToXcm< } /// Reason why a message conversion failed. -#[derive( - Copy, Clone, TypeInfo, PalletError, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, -)] +#[derive(Copy, Clone, TypeInfo, PalletError, Encode, Decode, DecodeWithMemTracking, Debug)] pub enum ConvertMessageError { /// The message version is not supported for conversion. UnsupportedVersion, diff --git a/bridges/snowbridge/primitives/inbound-queue/src/v2/converter.rs b/bridges/snowbridge/primitives/inbound-queue/src/v2/converter.rs index c96f3b8e63063..4d2b19e4feb1c 100644 --- a/bridges/snowbridge/primitives/inbound-queue/src/v2/converter.rs +++ b/bridges/snowbridge/primitives/inbound-queue/src/v2/converter.rs @@ -8,7 +8,7 @@ use codec::{Decode, DecodeLimit, Encode}; use core::marker::PhantomData; use frame_support::ensure; use snowbridge_core::{ParaId, TokenId}; -use sp_core::{Get, RuntimeDebug, H160}; +use sp_core::{Get, H160}; use sp_io::hashing::blake2_256; use sp_runtime::{traits::MaybeConvert, MultiAddress}; use sp_std::prelude::*; @@ -24,7 +24,7 @@ const INBOUND_QUEUE_TOPIC_PREFIX: &str = "SnowbridgeInboundQueueV2"; /// Representation of an intermediate parsed message, before final /// conversion to XCM. -#[derive(Clone, RuntimeDebug, Encode)] +#[derive(Clone, Debug, Encode)] pub struct PreparedMessage { /// Ethereum account that initiated this messaging operation pub origin: H160, @@ -39,13 +39,13 @@ pub struct PreparedMessage { } /// An asset transfer instruction -#[derive(Clone, RuntimeDebug, Encode)] +#[derive(Clone, Debug, Encode)] pub enum AssetTransfer { ReserveDeposit(Asset), ReserveWithdraw(Asset), } -#[derive(Clone, RuntimeDebug, Encode)] +#[derive(Clone, Debug, Encode)] pub struct CreateAssetCallInfo { pub create_call: CallIndex, pub deposit: u128, diff --git a/bridges/snowbridge/primitives/inbound-queue/src/v2/message.rs b/bridges/snowbridge/primitives/inbound-queue/src/v2/message.rs index 177f62ab0ef58..a903628d454cb 100644 --- a/bridges/snowbridge/primitives/inbound-queue/src/v2/message.rs +++ b/bridges/snowbridge/primitives/inbound-queue/src/v2/message.rs @@ -10,7 +10,7 @@ use alloy_core::{ }; use codec::{Decode, Encode}; use scale_info::TypeInfo; -use sp_core::{RuntimeDebug, H160, H256}; +use sp_core::{H160, H256}; use sp_std::prelude::*; sol! { @@ -80,7 +80,7 @@ impl core::fmt::Debug for IGatewayV2::Xcm { } } -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] pub enum XcmPayload { /// Represents raw XCM bytes Raw(Vec), @@ -97,7 +97,7 @@ pub enum Network { /// The ethereum side sends messages which are transcoded into XCM on BH. These messages are /// self-contained, in that they can be transcoded using only information in the message. -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] pub struct Message { /// The address of the outbound queue on Ethereum that emitted this message as an event log pub gateway: H160, @@ -122,7 +122,7 @@ pub struct Message { /// An asset that will be transacted on AH. The asset will be reserved/withdrawn and placed into /// the holding register. The user needs to provide additional xcm to deposit the asset /// in a beneficiary account. -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] pub enum EthereumAsset { NativeTokenERC20 { /// The native token ID @@ -138,7 +138,7 @@ pub enum EthereumAsset { }, } -#[derive(Copy, Clone, RuntimeDebug)] +#[derive(Copy, Clone, Debug)] pub struct MessageDecodeError; impl TryFrom<&Log> for Message { diff --git a/bridges/snowbridge/primitives/inbound-queue/src/v2/traits.rs b/bridges/snowbridge/primitives/inbound-queue/src/v2/traits.rs index 3ad07bd0d6f4f..e52225f0049d0 100644 --- a/bridges/snowbridge/primitives/inbound-queue/src/v2/traits.rs +++ b/bridges/snowbridge/primitives/inbound-queue/src/v2/traits.rs @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: 2025 Snowfork // SPDX-FileCopyrightText: 2021-2025 Parity Technologies (UK) Ltd. use super::Message; -use sp_core::RuntimeDebug; use xcm::latest::Xcm; +use Debug; /// Converts an inbound message from Ethereum to an XCM message that can be /// executed on a parachain. @@ -12,7 +12,7 @@ pub trait ConvertMessage { } /// Reason why a message conversion failed. -#[derive(Copy, Clone, RuntimeDebug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq)] pub enum ConvertMessageError { /// Invalid foreign ERC-20 token ID InvalidAsset, diff --git a/bridges/snowbridge/primitives/merkle-tree/src/lib.rs b/bridges/snowbridge/primitives/merkle-tree/src/lib.rs index c139eb288d2f4..6b9b5d076d3c3 100644 --- a/bridges/snowbridge/primitives/merkle-tree/src/lib.rs +++ b/bridges/snowbridge/primitives/merkle-tree/src/lib.rs @@ -26,7 +26,7 @@ use alloc::vec::Vec; use codec::{Decode, Encode}; use scale_info::TypeInfo; -use sp_core::{RuntimeDebug, H256}; +use sp_core::H256; use sp_runtime::traits::Hash; /// Construct a root hash of a Binary Merkle Tree created from given leaves. @@ -73,7 +73,7 @@ where /// A generated merkle proof. /// /// The structure contains all necessary data to later on verify the proof and the leaf itself. -#[derive(Encode, Decode, RuntimeDebug, PartialEq, Eq, TypeInfo)] +#[derive(Encode, Decode, Debug, PartialEq, Eq, TypeInfo)] pub struct MerkleProof { /// Root hash of generated merkle tree. pub root: H256, diff --git a/bridges/snowbridge/primitives/outbound-queue/src/lib.rs b/bridges/snowbridge/primitives/outbound-queue/src/lib.rs index fb8de96a3dcd9..c1d56802d17f4 100644 --- a/bridges/snowbridge/primitives/outbound-queue/src/lib.rs +++ b/bridges/snowbridge/primitives/outbound-queue/src/lib.rs @@ -11,14 +11,12 @@ use codec::{Decode, DecodeWithMemTracking, Encode}; use frame_support::PalletError; use scale_info::TypeInfo; use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; -use sp_core::RuntimeDebug; +use Debug; pub use snowbridge_verification_primitives::*; /// The operating mode of Channels and Gateway contract on Ethereum. -#[derive( - Copy, Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo, -)] +#[derive(Copy, Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, Debug, TypeInfo)] pub enum OperatingMode { /// Normal operations. Allow sending and receiving messages. Normal, @@ -38,16 +36,7 @@ pub trait SendMessageFeeProvider { /// Reasons why sending to Ethereum could not be initiated #[derive( - Copy, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - PartialEq, - Eq, - RuntimeDebug, - PalletError, - TypeInfo, + Copy, Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, Debug, PalletError, TypeInfo, )] pub enum SendError { /// Message is too large to be safely executed on Ethereum diff --git a/bridges/snowbridge/primitives/outbound-queue/src/v1/message.rs b/bridges/snowbridge/primitives/outbound-queue/src/v1/message.rs index c5a1ebb391072..ab3c43f10bab8 100644 --- a/bridges/snowbridge/primitives/outbound-queue/src/v1/message.rs +++ b/bridges/snowbridge/primitives/outbound-queue/src/v1/message.rs @@ -8,12 +8,12 @@ use ethabi::Token; use scale_info::TypeInfo; use snowbridge_core::{pricing::UD60x18, ChannelId}; use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; -use sp_core::{RuntimeDebug, H160, H256, U256}; +use sp_core::{H160, H256, U256}; use sp_std::{borrow::ToOwned, vec, vec::Vec}; /// Enqueued outbound messages need to be versioned to prevent data corruption /// or loss after forkless runtime upgrades -#[derive(Encode, Decode, TypeInfo, Clone, RuntimeDebug)] +#[derive(Encode, Decode, TypeInfo, Clone, Debug)] #[cfg_attr(feature = "std", derive(PartialEq))] pub enum VersionedQueuedMessage { V1(QueuedMessage), @@ -36,7 +36,7 @@ impl> From for VersionedQueuedMessage { } /// A message which can be accepted by implementations of `/[`SendMessage`\]` -#[derive(Encode, Decode, TypeInfo, Clone, RuntimeDebug)] +#[derive(Encode, Decode, TypeInfo, Clone, Debug)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct Message { /// ID for this message. One will be automatically generated if not provided. @@ -53,7 +53,7 @@ pub struct Message { } /// A command which is executable by the Gateway contract on Ethereum -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(PartialEq))] pub enum Command { /// Execute a sub-command within an agent for a consensus system in Polkadot @@ -201,7 +201,7 @@ impl Command { /// Representation of a call to the initializer of an implementation contract. /// The initializer has the following ABI signature: `initialize(bytes)`. -#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Debug, TypeInfo)] pub struct Initializer { /// ABI-encoded params of type `bytes` to pass to the initializer pub params: Vec, @@ -210,7 +210,7 @@ pub struct Initializer { } /// A Sub-command executable within an agent -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(PartialEq))] pub enum AgentExecuteCommand { /// Transfer ERC20 tokens @@ -247,7 +247,7 @@ impl AgentExecuteCommand { } /// Message which is awaiting processing in the MessageQueue pallet -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct QueuedMessage { /// Message ID @@ -258,7 +258,7 @@ pub struct QueuedMessage { pub command: Command, } -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(PartialEq))] /// Fee for delivering message pub struct Fee diff --git a/bridges/snowbridge/primitives/outbound-queue/src/v2/delivery_receipt.rs b/bridges/snowbridge/primitives/outbound-queue/src/v2/delivery_receipt.rs index ca4758334cad6..a01117a2d20fb 100644 --- a/bridges/snowbridge/primitives/outbound-queue/src/v2/delivery_receipt.rs +++ b/bridges/snowbridge/primitives/outbound-queue/src/v2/delivery_receipt.rs @@ -4,7 +4,7 @@ use crate::Log; use alloy_core::{primitives::B256, sol, sol_types::SolEvent}; use codec::Decode; use frame_support::pallet_prelude::{Encode, TypeInfo}; -use sp_core::{RuntimeDebug, H160, H256}; +use sp_core::{H160, H256}; use sp_std::prelude::*; sol! { @@ -12,7 +12,7 @@ sol! { } /// Delivery receipt -#[derive(Clone, RuntimeDebug)] +#[derive(Clone, Debug)] pub struct DeliveryReceipt { /// The address of the outbound queue on Ethereum that emitted this message as an event log pub gateway: H160, diff --git a/bridges/snowbridge/primitives/outbound-queue/src/v2/message.rs b/bridges/snowbridge/primitives/outbound-queue/src/v2/message.rs index 31abd5a5cb565..c2440b8f765b4 100644 --- a/bridges/snowbridge/primitives/outbound-queue/src/v2/message.rs +++ b/bridges/snowbridge/primitives/outbound-queue/src/v2/message.rs @@ -5,7 +5,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode}; use frame_support::{pallet_prelude::ConstU32, BoundedVec}; use scale_info::TypeInfo; -use sp_core::{RuntimeDebug, H160, H256}; +use sp_core::{H160, H256}; use sp_std::vec::Vec; use crate::{OperatingMode, SendError}; @@ -99,14 +99,14 @@ pub mod abi { } } -#[derive(Encode, Decode, TypeInfo, PartialEq, Clone, RuntimeDebug)] +#[derive(Encode, Decode, TypeInfo, PartialEq, Clone, Debug)] pub struct OutboundCommandWrapper { pub kind: u8, pub gas: u64, pub payload: Vec, } -#[derive(Encode, Decode, TypeInfo, PartialEq, Clone, RuntimeDebug)] +#[derive(Encode, Decode, TypeInfo, PartialEq, Clone, Debug)] pub struct OutboundMessage { /// Origin pub origin: H256, @@ -121,7 +121,7 @@ pub struct OutboundMessage { pub const MAX_COMMANDS: u32 = 8; /// A message which can be accepted by implementations of `/[`SendMessage`\]` -#[derive(Encode, Decode, DecodeWithMemTracking, TypeInfo, PartialEq, Clone, RuntimeDebug)] +#[derive(Encode, Decode, DecodeWithMemTracking, TypeInfo, PartialEq, Clone, Debug)] pub struct Message { /// Origin pub origin: H256, @@ -134,7 +134,7 @@ pub struct Message { } /// A command which is executable by the Gateway contract on Ethereum -#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Debug, TypeInfo)] pub enum Command { /// Upgrade the Gateway contract Upgrade { @@ -249,7 +249,7 @@ impl Command { /// Representation of a call to the initializer of an implementation contract. /// The initializer has the following ABI signature: `initialize(bytes)`. -#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Debug, TypeInfo)] pub struct Initializer { /// ABI-encoded params of type `bytes` to pass to the initializer pub params: Vec, diff --git a/bridges/snowbridge/primitives/outbound-queue/src/v2/mod.rs b/bridges/snowbridge/primitives/outbound-queue/src/v2/mod.rs index a6bb8c2839bd4..f53e30cb4df21 100644 --- a/bridges/snowbridge/primitives/outbound-queue/src/v2/mod.rs +++ b/bridges/snowbridge/primitives/outbound-queue/src/v2/mod.rs @@ -11,13 +11,13 @@ pub use message::*; use codec::{Decode, Encode}; use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; use sp_std::prelude::*; +use Debug; /// The `XCM::Transact` payload for calling arbitrary smart contracts on Ethereum. /// On Ethereum, this call will be dispatched by the agent contract acting as a proxy /// for the XCM origin. -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, PartialEq, Debug, TypeInfo)] pub enum ContractCall { V1 { /// Target contract address diff --git a/bridges/snowbridge/primitives/verification/src/lib.rs b/bridges/snowbridge/primitives/verification/src/lib.rs index 87a7376d3ff48..a081eb46736b2 100644 --- a/bridges/snowbridge/primitives/verification/src/lib.rs +++ b/bridges/snowbridge/primitives/verification/src/lib.rs @@ -6,7 +6,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode}; use frame_support::PalletError; use scale_info::TypeInfo; use snowbridge_beacon_primitives::{BeaconHeader, ExecutionProof}; -use sp_core::{RuntimeDebug, H160, H256}; +use sp_core::{H160, H256}; use sp_std::prelude::*; /// A trait for verifying inbound messages from Ethereum. @@ -14,7 +14,7 @@ pub trait Verifier { fn verify(event: &Log, proof: &Proof) -> Result<(), VerificationError>; } -#[derive(Clone, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, PalletError, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, Debug, PalletError, TypeInfo)] #[cfg_attr(feature = "std", derive(PartialEq))] pub enum VerificationError { /// Execution header is missing @@ -30,7 +30,7 @@ pub enum VerificationError { } /// A bridge message from the Gateway contract on Ethereum -#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Debug, TypeInfo)] pub struct EventProof { /// Event log emitted by Gateway contract pub event_log: Log, @@ -39,7 +39,7 @@ pub struct EventProof { } /// Event log -#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Debug, TypeInfo)] pub struct Log { pub address: H160, pub topics: Vec, @@ -47,7 +47,7 @@ pub struct Log { } /// Inclusion proof for a transaction receipt -#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Debug, TypeInfo)] pub struct Proof { // Proof keys and values (receipts tree) pub receipt_proof: (Vec>, Vec>), @@ -55,7 +55,7 @@ pub struct Proof { pub execution_proof: ExecutionProof, } -#[derive(Clone, RuntimeDebug)] +#[derive(Clone, Debug)] pub struct EventFixture { pub event: EventProof, pub finalized_header: BeaconHeader, diff --git a/bridges/snowbridge/test-utils/src/mock_origin.rs b/bridges/snowbridge/test-utils/src/mock_origin.rs index 063eee2b9bde0..7c4b43c3563b4 100644 --- a/bridges/snowbridge/test-utils/src/mock_origin.rs +++ b/bridges/snowbridge/test-utils/src/mock_origin.rs @@ -22,15 +22,7 @@ pub mod pallet_xcm_origin { // Insert this custom Origin into the aggregate RuntimeOrigin #[pallet::origin] #[derive( - PartialEq, - Eq, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, MaxEncodedLen, )] pub struct Origin(pub Location); diff --git a/cumulus/pallets/collator-selection/src/lib.rs b/cumulus/pallets/collator-selection/src/lib.rs index 1b21e85e9617a..ec5f3f6d0a955 100644 --- a/cumulus/pallets/collator-selection/src/lib.rs +++ b/cumulus/pallets/collator-selection/src/lib.rs @@ -118,7 +118,7 @@ pub mod pallet { use pallet_session::SessionManager; use sp_runtime::{ traits::{AccountIdConversion, CheckedSub, Convert, Saturating, Zero}, - RuntimeDebug, + Debug, }; use sp_staking::SessionIndex; @@ -198,9 +198,7 @@ pub mod pallet { } /// Basic information about a collation candidate. - #[derive( - PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, scale_info::TypeInfo, MaxEncodedLen, - )] + #[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, scale_info::TypeInfo, MaxEncodedLen)] pub struct CandidateInfo { /// Account identifier. pub who: AccountId, diff --git a/cumulus/pallets/dmp-queue/src/migration.rs b/cumulus/pallets/dmp-queue/src/migration.rs index dd2f2e386d208..015d73c81db76 100644 --- a/cumulus/pallets/dmp-queue/src/migration.rs +++ b/cumulus/pallets/dmp-queue/src/migration.rs @@ -24,7 +24,7 @@ use frame_support::{pallet_prelude::*, storage_alias, traits::HandleMessage}; pub(crate) const LOG: &str = "runtime::dmp-queue-export-xcms"; /// The old `PageIndexData` struct. -#[derive(Copy, Clone, Eq, PartialEq, Default, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Copy, Clone, Eq, PartialEq, Default, Encode, Decode, Debug, TypeInfo)] pub struct PageIndexData { /// The lowest used page index. pub begin_used: PageCounter, diff --git a/cumulus/pallets/parachain-system/src/lib.rs b/cumulus/pallets/parachain-system/src/lib.rs index 85d12ed473467..5ff4af131f565 100644 --- a/cumulus/pallets/parachain-system/src/lib.rs +++ b/cumulus/pallets/parachain-system/src/lib.rs @@ -57,7 +57,7 @@ use polkadot_runtime_parachains::{FeeTracker, GetMinFeeFactor}; use scale_info::TypeInfo; use sp_runtime::{ traits::{BlockNumberProvider, Hash}, - FixedU128, RuntimeDebug, SaturatedConversion, + Debug, FixedU128, SaturatedConversion, }; use xcm::{latest::XcmHash, VersionedLocation, VersionedXcm, MAX_XCM_DECODE_DEPTH}; use xcm_builder::InspectMessageQueues; @@ -1776,7 +1776,7 @@ pub trait OnSystemEvent { } /// Holds the most recent relay-parent state root and block number of the current parachain block. -#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, Default, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, Default, Debug)] pub struct RelayChainState { /// Current relay chain height. pub number: relay_chain::BlockNumber, diff --git a/cumulus/pallets/parachain-system/src/parachain_inherent.rs b/cumulus/pallets/parachain-system/src/parachain_inherent.rs index 04ec18004961d..3dd089a47fe5c 100644 --- a/cumulus/pallets/parachain-system/src/parachain_inherent.rs +++ b/cumulus/pallets/parachain-system/src/parachain_inherent.rs @@ -50,16 +50,7 @@ use sp_core::{bounded::BoundedSlice, Get}; /// `InboundMessageId {sent_at: 1, reverse_idx: 0}` points to `msgs[4]` /// `InboundMessageId {sent_at: 1, reverse_idx: 3}` points to `msgs[1]` /// `InboundMessageId {sent_at: 1, reverse_idx: 4}` points to `msgs[0]` -#[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - Default, - sp_runtime::RuntimeDebug, - PartialEq, - TypeInfo, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Default, Debug, PartialEq, TypeInfo)] pub struct InboundMessageId { /// The block number at which this message was added to the message passing queue /// on the relay chain. @@ -88,13 +79,7 @@ pub trait InboundMessage { /// A collection of inbound messages. #[derive( - codec::Encode, - codec::Decode, - codec::DecodeWithMemTracking, - sp_core::RuntimeDebug, - Clone, - PartialEq, - TypeInfo, + codec::Encode, codec::Decode, codec::DecodeWithMemTracking, Debug, Clone, PartialEq, TypeInfo, )] pub struct InboundMessagesCollection { messages: Vec, @@ -162,13 +147,7 @@ impl InboundMessagesCollection { /// The first messages in the collection (up to a limit) contain the full message data. /// The messages that exceed that limit are hashed. #[derive( - codec::Encode, - codec::Decode, - codec::DecodeWithMemTracking, - sp_core::RuntimeDebug, - Clone, - PartialEq, - TypeInfo, + codec::Encode, codec::Decode, codec::DecodeWithMemTracking, Debug, Clone, PartialEq, TypeInfo, )] pub struct AbridgedInboundMessagesCollection { full_messages: Vec, @@ -313,13 +292,7 @@ impl AbridgedInboundHrmpMessages { /// The basic inherent data that is passed by the collator to the parachain runtime. /// This data doesn't contain any messages. #[derive( - codec::Encode, - codec::Decode, - codec::DecodeWithMemTracking, - sp_core::RuntimeDebug, - Clone, - PartialEq, - TypeInfo, + codec::Encode, codec::Decode, codec::DecodeWithMemTracking, Debug, Clone, PartialEq, TypeInfo, )] pub struct BasicParachainInherentData { pub validation_data: PersistedValidationData, @@ -331,13 +304,7 @@ pub struct BasicParachainInherentData { /// The messages that are passed by the collator to the parachain runtime as part of the /// inherent data. #[derive( - codec::Encode, - codec::Decode, - codec::DecodeWithMemTracking, - sp_core::RuntimeDebug, - Clone, - PartialEq, - TypeInfo, + codec::Encode, codec::Decode, codec::DecodeWithMemTracking, Debug, Clone, PartialEq, TypeInfo, )] pub struct InboundMessagesData { pub downward_messages: AbridgedInboundDownwardMessages, diff --git a/cumulus/pallets/parachain-system/src/unincluded_segment.rs b/cumulus/pallets/parachain-system/src/unincluded_segment.rs index 98fc3733dbd14..be345f26d78f2 100644 --- a/cumulus/pallets/parachain-system/src/unincluded_segment.rs +++ b/cumulus/pallets/parachain-system/src/unincluded_segment.rs @@ -26,10 +26,10 @@ use codec::{Decode, Encode}; use core::marker::PhantomData; use cumulus_primitives_core::{relay_chain, ParaId}; use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; +use Debug; /// Constraints on outbound HRMP channel. -#[derive(Clone, RuntimeDebug)] +#[derive(Clone, Debug)] pub struct HrmpOutboundLimits { /// The maximum bytes that can be written to the channel. pub bytes_remaining: u32, @@ -38,7 +38,7 @@ pub struct HrmpOutboundLimits { } /// Limits on outbound message bandwidth. -#[derive(Clone, RuntimeDebug)] +#[derive(Clone, Debug)] pub struct OutboundBandwidthLimits { /// The amount of UMP messages remaining. pub ump_messages_remaining: u32, @@ -80,7 +80,7 @@ impl OutboundBandwidthLimits { } /// The error type for updating bandwidth used by a segment. -#[derive(RuntimeDebug)] +#[derive(Debug)] #[cfg_attr(test, derive(PartialEq))] pub enum BandwidthUpdateError { /// Too many messages submitted to HRMP channel. @@ -128,7 +128,7 @@ pub enum BandwidthUpdateError { } /// The number of messages and size in bytes submitted to HRMP channel. -#[derive(RuntimeDebug, Default, Copy, Clone, Encode, Decode, TypeInfo)] +#[derive(Debug, Default, Copy, Clone, Encode, Decode, TypeInfo)] pub struct HrmpChannelUpdate { /// The amount of messages submitted to the channel. pub msg_count: u32, @@ -187,7 +187,7 @@ impl HrmpChannelUpdate { /// /// This struct can be created with pub items, however, it should /// never hit the storage directly to avoid bypassing limitations checks. -#[derive(Default, Clone, Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(Default, Clone, Encode, Decode, TypeInfo, Debug)] pub struct UsedBandwidth { /// The amount of UMP messages sent. pub ump_msg_count: u32, @@ -248,7 +248,7 @@ impl UsedBandwidth { /// Ancestor of the block being currently executed, not yet included /// into the relay chain. -#[derive(Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(Encode, Decode, TypeInfo, Debug)] pub struct Ancestor { /// Bandwidth used by this block. used_bandwidth: UsedBandwidth, @@ -314,7 +314,7 @@ impl HrmpWatermarkUpdate { /// Struct that keeps track of bandwidth used by the unincluded part of the chain /// along with the latest HRMP watermark. -#[derive(Default, Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(Default, Encode, Decode, TypeInfo, Debug)] pub struct SegmentTracker { /// Bandwidth used by the segment. used_bandwidth: UsedBandwidth, diff --git a/cumulus/pallets/xcm/src/lib.rs b/cumulus/pallets/xcm/src/lib.rs index 2541bd947b853..521bf536b8a0d 100644 --- a/cumulus/pallets/xcm/src/lib.rs +++ b/cumulus/pallets/xcm/src/lib.rs @@ -24,7 +24,7 @@ use codec::{Decode, Encode}; use cumulus_primitives_core::ParaId; pub use pallet::*; use scale_info::TypeInfo; -use sp_runtime::{traits::BadOrigin, RuntimeDebug}; +use sp_runtime::traits::BadOrigin; use xcm::latest::{ExecuteXcm, Outcome}; #[frame_support::pallet] @@ -60,15 +60,7 @@ pub mod pallet { /// Origin for the parachains module. #[derive( - PartialEq, - Eq, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - RuntimeDebug, - MaxEncodedLen, + PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug, MaxEncodedLen, )] #[pallet::origin] pub enum Origin { diff --git a/cumulus/pallets/xcmp-queue/src/lib.rs b/cumulus/pallets/xcmp-queue/src/lib.rs index 408e177180004..acb7e8739aeaa 100644 --- a/cumulus/pallets/xcmp-queue/src/lib.rs +++ b/cumulus/pallets/xcmp-queue/src/lib.rs @@ -76,7 +76,7 @@ use polkadot_runtime_common::xcm_sender::PriceForMessageDelivery; use polkadot_runtime_parachains::{FeeTracker, GetMinFeeFactor}; use scale_info::TypeInfo; use sp_core::MAX_POSSIBLE_ALLOCATION; -use sp_runtime::{FixedU128, RuntimeDebug, SaturatedConversion, WeakBoundedVec}; +use sp_runtime::{FixedU128, SaturatedConversion, WeakBoundedVec}; use xcm::{latest::prelude::*, VersionedLocation, VersionedXcm, WrapVersion, MAX_XCM_DECODE_DEPTH}; use xcm_builder::InspectMessageQueues; use xcm_executor::traits::ConvertOrigin; @@ -367,14 +367,14 @@ pub mod pallet { StorageMap<_, Twox64Concat, ParaId, FixedU128, ValueQuery, GetMinFeeFactor>>; } -#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub enum OutboundState { Ok, Suspended, } /// Struct containing detailed information about the outbound channel. -#[derive(Clone, Eq, PartialEq, Encode, Decode, TypeInfo, RuntimeDebug, MaxEncodedLen)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, TypeInfo, Debug, MaxEncodedLen)] pub struct OutboundChannelDetails { /// The `ParaId` of the parachain that this channel is connected with. recipient: ParaId, @@ -410,7 +410,7 @@ impl OutboundChannelDetails { } } -#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub struct QueueConfigData { /// The number of pages which must be in the queue for the other side to be told to suspend /// their sending. diff --git a/cumulus/pallets/xcmp-queue/src/migration.rs b/cumulus/pallets/xcmp-queue/src/migration.rs index 7f04fdd3f580b..7046ec6ab05b3 100644 --- a/cumulus/pallets/xcmp-queue/src/migration.rs +++ b/cumulus/pallets/xcmp-queue/src/migration.rs @@ -69,7 +69,7 @@ pub mod v2 { #[frame_support::storage_alias] pub(crate) type QueueConfig = StorageValue, QueueConfigData, ValueQuery>; - #[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] + #[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] pub struct QueueConfigData { pub suspend_threshold: u32, pub drop_threshold: u32, @@ -179,9 +179,7 @@ pub mod v3 { pub message_metadata: Vec<(RelayBlockNumber, XcmpMessageFormat)>, } - #[derive( - Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, TypeInfo, - )] + #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, TypeInfo)] pub enum InboundState { Ok, Suspended, diff --git a/cumulus/parachains/common/src/pay.rs b/cumulus/parachains/common/src/pay.rs index 62b774f51900c..f9e6b94f9f0ec 100644 --- a/cumulus/parachains/common/src/pay.rs +++ b/cumulus/parachains/common/src/pay.rs @@ -20,7 +20,7 @@ use frame_support::traits::{ tokens::{PaymentStatus, Preservation}, }; use polkadot_runtime_common::impls::VersionedLocatableAsset; -use sp_runtime::{traits::TypedGet, DispatchError, RuntimeDebug}; +use sp_runtime::{traits::TypedGet, DispatchError}; use xcm::latest::prelude::*; use xcm_executor::traits::ConvertLocation; @@ -32,7 +32,7 @@ use xcm_executor::traits::ConvertLocation; Eq, PartialEq, Clone, - RuntimeDebug, + Debug, scale_info::TypeInfo, MaxEncodedLen, DecodeWithMemTracking, diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/bridge-primitives/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/bridge-primitives/src/lib.rs index 759972b62fd79..2f3f3d0cd38bf 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/bridge-primitives/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/bridge-primitives/src/lib.rs @@ -30,7 +30,7 @@ use bp_runtime::{ pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall; use frame_support::{ dispatch::DispatchClass, - sp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion}, + sp_runtime::{MultiAddress, MultiSigner, StateVersion}, }; use testnet_parachains_constants::rococo::currency::UNITS; use xcm::latest::prelude::*; @@ -84,7 +84,7 @@ pub fn build_congestion_message( pub const ASSET_HUB_ROCOCO_PARACHAIN_ID: u32 = 1000; /// AssetHubRococo parachain. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct AssetHubRococo; diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs index 811e119d6b89c..85386572af623 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs @@ -82,7 +82,7 @@ use parachains_common::{ AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, CollectionId, Hash, Header, ItemId, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, NORMAL_DISPATCH_RATIO, }; -use sp_runtime::{Perbill, RuntimeDebug}; +use sp_runtime::Perbill; use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee, time::*}; use xcm_config::{ ForeignAssetsConvertedConcreteId, GovernanceLocation, LocationToAccountId, @@ -569,7 +569,7 @@ parameter_types! { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/bridge-primitives/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/bridge-primitives/src/lib.rs index 77133c09b530c..9055b214d589f 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/bridge-primitives/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/bridge-primitives/src/lib.rs @@ -28,7 +28,7 @@ pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall; use codec::{Decode, Encode}; use frame_support::{ dispatch::DispatchClass, - sp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion}, + sp_runtime::{MultiAddress, MultiSigner, StateVersion}, }; use scale_info::TypeInfo; use testnet_parachains_constants::westend::currency::UNITS; @@ -84,7 +84,7 @@ pub fn build_congestion_message( pub const ASSET_HUB_WESTEND_PARACHAIN_ID: u32 = 1000; /// AssetHubWestend parachain. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct AssetHubWestend; impl Chain for AssetHubWestend { diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/governance/origins.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/governance/origins.rs index b389747f60d50..4717c5cbb0399 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/governance/origins.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/governance/origins.rs @@ -31,15 +31,7 @@ pub mod pallet_custom_origins { pub struct Pallet(_); #[derive( - PartialEq, - Eq, - Clone, - MaxEncodedLen, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - RuntimeDebug, + PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug, )] #[pallet::origin] pub enum Origin { diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 75c38fc9d1f36..9c54d7e9b8069 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -88,7 +88,7 @@ use sp_runtime::{ generic, impl_opaque_keys, traits::{AccountIdConversion, BlakeTwo256, Block as BlockT, ConvertInto, Saturating, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedU128, Perbill, Permill, RuntimeDebug, + ApplyExtrinsicResult, Debug, FixedU128, Perbill, Permill, }; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -664,7 +664,7 @@ parameter_types! { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/cumulus/parachains/runtimes/assets/common/src/runtime_api.rs b/cumulus/parachains/runtimes/assets/common/src/runtime_api.rs index 799b2f45b4dfb..2bf82db8a21c5 100644 --- a/cumulus/parachains/runtimes/assets/common/src/runtime_api.rs +++ b/cumulus/parachains/runtimes/assets/common/src/runtime_api.rs @@ -16,12 +16,12 @@ //! Runtime API definition for fungibles. use codec::{Codec, Decode, Encode}; -use sp_runtime::RuntimeDebug; +use Debug; #[cfg(feature = "std")] use {alloc::vec::Vec, xcm::latest::Asset}; /// The possible errors that can happen querying the storage of assets. -#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug, scale_info::TypeInfo)] +#[derive(Eq, PartialEq, Encode, Decode, Debug, scale_info::TypeInfo)] pub enum FungiblesAccessError { /// `Location` to `AssetId`/`ClassId` conversion failed. AssetIdConversionFailed, diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/bridge-primitives/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/bridge-primitives/src/lib.rs index 529982749b313..5196484400d8f 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/bridge-primitives/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/bridge-primitives/src/lib.rs @@ -27,11 +27,11 @@ use bp_runtime::{ use codec::{Decode, Encode}; use frame_support::{ dispatch::DispatchClass, - sp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion}, + sp_runtime::{MultiAddress, MultiSigner, StateVersion}, }; /// BridgeHubRococo parachain. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct BridgeHubRococo; impl Chain for BridgeHubRococo { diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/bridge-primitives/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/bridge-primitives/src/lib.rs index 090a9d9b9795e..c967d896c41b1 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/bridge-primitives/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/bridge-primitives/src/lib.rs @@ -25,10 +25,10 @@ use bp_runtime::{ }; use codec::{Decode, Encode}; use frame_support::dispatch::DispatchClass; -use sp_runtime::{RuntimeDebug, StateVersion}; +use sp_runtime::StateVersion; /// BridgeHubWestend parachain. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct BridgeHubWestend; impl Chain for BridgeHubWestend { diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/ambassador/origins.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/ambassador/origins.rs index 854280a55c596..7dbfb7b5e00de 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/ambassador/origins.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/ambassador/origins.rs @@ -29,15 +29,7 @@ pub mod pallet_origins { pub trait Config: frame_system::Config {} #[derive( - PartialEq, - Eq, - Clone, - MaxEncodedLen, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - RuntimeDebug, + PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug, )] #[pallet::origin] pub enum Origin { diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/fellowship/origins.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/fellowship/origins.rs index 551abb27ccf25..bb7ad0ceec2fb 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/fellowship/origins.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/fellowship/origins.rs @@ -32,15 +32,7 @@ pub mod pallet_origins { pub struct Pallet(_); #[derive( - PartialEq, - Eq, - Clone, - MaxEncodedLen, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - RuntimeDebug, + PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug, )] #[pallet::origin] pub enum Origin { diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs index 47e8e24a8efb9..d1f0577c70497 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs @@ -94,7 +94,6 @@ use parachains_common::{ AccountId, AuraId, Balance, BlockNumber, Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, NORMAL_DISPATCH_RATIO, }; -use sp_runtime::RuntimeDebug; use testnet_parachains_constants::westend::{ account::*, consensus::*, currency::*, fee::WeightToFee, time::*, }; @@ -102,6 +101,7 @@ use xcm_config::{ GovernanceLocation, LocationToAccountId, TreasurerBodyId, XcmConfig, XcmOriginToTransactDispatchOrigin, }; +use Debug; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -298,7 +298,7 @@ parameter_types! { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs index 040d99280605f..3edf3c43adef2 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs @@ -71,7 +71,7 @@ use sp_runtime::{ generic, impl_opaque_keys, traits::{BlakeTwo256, Block as BlockT, BlockNumberProvider}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, DispatchError, MultiAddress, Perbill, RuntimeDebug, + ApplyExtrinsicResult, Debug, DispatchError, MultiAddress, Perbill, }; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -476,7 +476,7 @@ impl pallet_multisig::Config for Runtime { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs index 153b4e01dc381..a652f560e06af 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs @@ -71,7 +71,7 @@ use sp_runtime::{ generic, impl_opaque_keys, traits::{BlakeTwo256, Block as BlockT, BlockNumberProvider}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, DispatchError, MultiAddress, Perbill, RuntimeDebug, + ApplyExtrinsicResult, Debug, DispatchError, MultiAddress, Perbill, }; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -476,7 +476,7 @@ impl pallet_multisig::Config for Runtime { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs index ccc1ae56c685f..6bca7ae65a65e 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs @@ -64,7 +64,7 @@ use sp_runtime::{ transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; -pub use sp_runtime::{MultiAddress, Perbill, Permill, RuntimeDebug}; +pub use sp_runtime::{MultiAddress, Perbill, Permill}; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; @@ -437,7 +437,7 @@ impl pallet_multisig::Config for Runtime { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/people.rs b/cumulus/parachains/runtimes/people/people-rococo/src/people.rs index 529a8fd223368..18bde8dc04fec 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/people.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/people.rs @@ -18,15 +18,14 @@ use crate::xcm_config::LocationToAccountId; use codec::{Decode, Encode, MaxEncodedLen}; use enumflags2::{bitflags, BitFlags}; use frame_support::{ - parameter_types, traits::ConstU32, CloneNoBound, EqNoBound, PartialEqNoBound, - RuntimeDebugNoBound, + parameter_types, traits::ConstU32, CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound, }; use pallet_identity::{Data, IdentityInformationProvider}; use parachains_common::{impls::ToParentTreasury, DAYS}; use scale_info::TypeInfo; use sp_runtime::{ traits::{AccountIdConversion, Verify}, - RuntimeDebug, + Debug, }; parameter_types! { @@ -71,7 +70,7 @@ impl pallet_identity::Config for Runtime { /// in the `IdentityInfo` struct. #[bitflags] #[repr(u64)] -#[derive(Clone, Copy, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, Copy, PartialEq, Eq, Debug)] pub enum IdentityField { Display, Legal, @@ -94,7 +93,7 @@ pub enum IdentityField { EqNoBound, MaxEncodedLen, PartialEqNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, )] #[codec(mel_bound())] diff --git a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs index 5e44d12b96e93..ec4cf642d8fef 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs @@ -64,7 +64,7 @@ use sp_runtime::{ transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; -pub use sp_runtime::{MultiAddress, Perbill, Permill, RuntimeDebug}; +pub use sp_runtime::{MultiAddress, Perbill, Permill}; use sp_statement_store::{ runtime_api::{InvalidStatement, StatementSource, ValidStatement}, SignatureVerificationResult, Statement, @@ -440,7 +440,7 @@ impl pallet_multisig::Config for Runtime { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/cumulus/parachains/runtimes/people/people-westend/src/people.rs b/cumulus/parachains/runtimes/people/people-westend/src/people.rs index 4d4c19d7f2d8e..0342bd19792af 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/people.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/people.rs @@ -18,15 +18,14 @@ use crate::xcm_config::LocationToAccountId; use codec::{Decode, Encode, MaxEncodedLen}; use enumflags2::{bitflags, BitFlags}; use frame_support::{ - parameter_types, traits::ConstU32, CloneNoBound, EqNoBound, PartialEqNoBound, - RuntimeDebugNoBound, + parameter_types, traits::ConstU32, CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound, }; use pallet_identity::{Data, IdentityInformationProvider}; use parachains_common::{impls::ToParentTreasury, DAYS}; use scale_info::TypeInfo; use sp_runtime::{ traits::{AccountIdConversion, Verify}, - RuntimeDebug, + Debug, }; parameter_types! { @@ -71,7 +70,7 @@ impl pallet_identity::Config for Runtime { /// in the `IdentityInfo` struct. #[bitflags] #[repr(u64)] -#[derive(Clone, Copy, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, Copy, PartialEq, Eq, Debug)] pub enum IdentityField { Display, Legal, @@ -94,7 +93,7 @@ pub enum IdentityField { EqNoBound, MaxEncodedLen, PartialEqNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, )] #[codec(mel_bound())] diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 59dca4342eda9..ba519a8920f8d 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -36,7 +36,7 @@ use sc_cli::{ use sc_service::{config::PrometheusConfig, BasePath}; use sc_storage_monitor::StorageMonitorParams; use std::{ - fmt::{Debug, Display, Formatter}, + fmt::{Display, Formatter}, marker::PhantomData, path::PathBuf, }; diff --git a/cumulus/primitives/core/src/lib.rs b/cumulus/primitives/core/src/lib.rs index 9fc245aab43f7..774961b6b7e6b 100644 --- a/cumulus/primitives/core/src/lib.rs +++ b/cumulus/primitives/core/src/lib.rs @@ -24,7 +24,7 @@ use alloc::vec::Vec; use codec::{Compact, Decode, DecodeAll, DecodeWithMemTracking, Encode, MaxEncodedLen}; use polkadot_parachain_primitives::primitives::HeadData; use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; +use Debug; /// The ref time per core in seconds. /// @@ -63,7 +63,7 @@ pub type InboundHrmpMessage = polkadot_primitives::InboundHrmpMessage; /// Error description of a message send failure. -#[derive(Eq, PartialEq, Copy, Clone, RuntimeDebug, Encode, Decode)] +#[derive(Eq, PartialEq, Copy, Clone, Debug, Encode, Decode)] pub enum MessageSendError { /// The dispatch queue is full. QueueFull, @@ -205,7 +205,7 @@ impl XcmpMessageSource for () { } /// The "quality of service" considerations for message sending. -#[derive(Eq, PartialEq, Clone, Copy, Encode, Decode, RuntimeDebug)] +#[derive(Eq, PartialEq, Clone, Copy, Encode, Decode, Debug)] pub enum ServiceQuality { /// Ensure that this message is dispatched in the same relative order as any other messages /// that were also sent with `Ordered`. This only guarantees message ordering on the dispatch diff --git a/cumulus/primitives/parachain-inherent/src/lib.rs b/cumulus/primitives/parachain-inherent/src/lib.rs index 3eec67f1adf78..b5b2783d697f5 100644 --- a/cumulus/primitives/parachain-inherent/src/lib.rs +++ b/cumulus/primitives/parachain-inherent/src/lib.rs @@ -59,7 +59,7 @@ pub mod v0 { codec::Encode, codec::Decode, codec::DecodeWithMemTracking, - sp_core::RuntimeDebug, + Debug, Clone, PartialEq, TypeInfo, @@ -87,13 +87,7 @@ pub mod v0 { /// The inherent data that is passed by the collator to the parachain runtime. #[derive( - codec::Encode, - codec::Decode, - codec::DecodeWithMemTracking, - sp_core::RuntimeDebug, - Clone, - PartialEq, - TypeInfo, + codec::Encode, codec::Decode, codec::DecodeWithMemTracking, Debug, Clone, PartialEq, TypeInfo, )] pub struct ParachainInherentData { pub validation_data: PersistedValidationData, @@ -172,13 +166,7 @@ impl sp_inherents::InherentDataProvider for ParachainInherentData { /// An inbound message whose content was hashed. #[derive( - codec::Encode, - codec::Decode, - codec::DecodeWithMemTracking, - sp_core::RuntimeDebug, - Clone, - PartialEq, - TypeInfo, + codec::Encode, codec::Decode, codec::DecodeWithMemTracking, Debug, Clone, PartialEq, TypeInfo, )] pub struct HashedMessage { pub sent_at: RelayChainBlockNumber, diff --git a/docs/sdk/src/reference_docs/frame_origin.rs b/docs/sdk/src/reference_docs/frame_origin.rs index 2856c7d707692..70ffb9fb86468 100644 --- a/docs/sdk/src/reference_docs/frame_origin.rs +++ b/docs/sdk/src/reference_docs/frame_origin.rs @@ -168,15 +168,7 @@ pub mod pallet_with_custom_origin { /// A dummy custom origin. #[pallet::origin] #[derive( - PartialEq, - Eq, - Clone, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - MaxEncodedLen, + PartialEq, Eq, Clone, Debug, Encode, Decode, DecodeWithMemTracking, TypeInfo, MaxEncodedLen, )] pub enum Origin { /// If all holders of a particular NFT have agreed upon this. diff --git a/docs/sdk/src/reference_docs/frame_runtime_types.rs b/docs/sdk/src/reference_docs/frame_runtime_types.rs index a248bc8fb2830..d0b786bbcdb83 100644 --- a/docs/sdk/src/reference_docs/frame_runtime_types.rs +++ b/docs/sdk/src/reference_docs/frame_runtime_types.rs @@ -169,15 +169,7 @@ pub mod pallet_foo { #[pallet::origin] #[derive( - PartialEq, - Eq, - Clone, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - MaxEncodedLen, + PartialEq, Eq, Clone, Debug, Encode, Decode, DecodeWithMemTracking, TypeInfo, MaxEncodedLen, )] pub enum Origin { A, diff --git a/polkadot/core-primitives/src/lib.rs b/polkadot/core-primitives/src/lib.rs index fc7db64ed430c..525c697776ec4 100644 --- a/polkadot/core-primitives/src/lib.rs +++ b/polkadot/core-primitives/src/lib.rs @@ -138,9 +138,7 @@ pub type DownwardMessage = alloc::vec::Vec; /// A wrapped version of `DownwardMessage`. The difference is that it has attached the block number /// when the message was sent. -#[derive( - Encode, Decode, DecodeWithMemTracking, Clone, sp_runtime::RuntimeDebug, PartialEq, TypeInfo, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Debug, PartialEq, TypeInfo)] pub struct InboundDownwardMessage { /// The block number at which these messages were put into the downward message queue. pub sent_at: BlockNumber, @@ -149,9 +147,7 @@ pub struct InboundDownwardMessage { } /// An HRMP message seen from the perspective of a recipient. -#[derive( - Encode, Decode, DecodeWithMemTracking, Clone, sp_runtime::RuntimeDebug, PartialEq, TypeInfo, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Debug, PartialEq, TypeInfo)] pub struct InboundHrmpMessage { /// The block number at which this message was sent. /// Specifically, it is the block number at which the candidate that sends this message was @@ -162,17 +158,7 @@ pub struct InboundHrmpMessage { } /// An HRMP message seen from the perspective of a sender. -#[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - sp_runtime::RuntimeDebug, - PartialEq, - Eq, - Hash, - TypeInfo, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Debug, PartialEq, Eq, Hash, TypeInfo)] pub struct OutboundHrmpMessage { /// The para that will get this message in its downward message queue. pub recipient: Id, diff --git a/polkadot/node/overseer/src/lib.rs b/polkadot/node/overseer/src/lib.rs index 83709e73027b9..faa5adf0b57b8 100644 --- a/polkadot/node/overseer/src/lib.rs +++ b/polkadot/node/overseer/src/lib.rs @@ -65,7 +65,7 @@ use std::{ collections::{hash_map, HashMap}, - fmt::{self, Debug}, + fmt::{self}, pin::Pin, sync::Arc, time::Duration, diff --git a/polkadot/parachain/src/primitives.rs b/polkadot/parachain/src/primitives.rs index 69f35e4fe267b..234510218a0de 100644 --- a/polkadot/parachain/src/primitives.rs +++ b/polkadot/parachain/src/primitives.rs @@ -23,7 +23,7 @@ use bounded_collections::{BoundedVec, ConstU32}; use codec::{CompactAs, Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; -use sp_core::{bytes, RuntimeDebug, TypeId}; +use sp_core::{bytes, TypeId}; use sp_runtime::traits::Hash as _; use sp_weights::Weight; @@ -154,7 +154,7 @@ impl core::fmt::LowerHex for ValidationCodeHash { /// Parachain block data. /// /// Contains everything required to validate para-block, may contain block and witness data. -#[derive(PartialEq, Eq, Clone, Encode, Decode, derive_more::From, TypeInfo, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, derive_more::From, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct BlockData(#[cfg_attr(feature = "std", serde(with = "bytes"))] pub Vec); @@ -277,9 +277,7 @@ impl core::ops::Sub for Id { } } -#[derive( - Clone, Copy, Default, Encode, Decode, Eq, PartialEq, Ord, PartialOrd, RuntimeDebug, TypeInfo, -)] +#[derive(Clone, Copy, Default, Encode, Decode, Eq, PartialEq, Ord, PartialOrd, Debug, TypeInfo)] pub struct Sibling(pub Id); impl From for Sibling { @@ -330,16 +328,7 @@ impl IsSystem for Sibling { /// different channels identified by `(A, B)`. A channel with the same para id in sender and /// recipient is invalid. That is, however, not enforced. #[derive( - Clone, - PartialEq, - Eq, - PartialOrd, - Ord, - Encode, - Decode, - DecodeWithMemTracking, - RuntimeDebug, - TypeInfo, + Clone, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, )] #[cfg_attr(feature = "std", derive(Hash))] pub struct HrmpChannelId { @@ -381,17 +370,7 @@ impl DmpMessageHandler for () { /// The aggregate XCMP message format. #[derive( - Copy, - Clone, - Eq, - PartialEq, - Ord, - PartialOrd, - Encode, - Decode, - TypeInfo, - RuntimeDebug, - MaxEncodedLen, + Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo, Debug, MaxEncodedLen, )] pub enum XcmpMessageFormat { /// Encoded `VersionedXcm` messages, all concatenated. diff --git a/polkadot/primitives/src/v9/async_backing.rs b/polkadot/primitives/src/v9/async_backing.rs index 0f0a484b8eb5b..691c3f6962ceb 100644 --- a/polkadot/primitives/src/v9/async_backing.rs +++ b/polkadot/primitives/src/v9/async_backing.rs @@ -21,13 +21,13 @@ use super::*; use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode}; use scale_info::TypeInfo; -use sp_core::RuntimeDebug; +use Debug; use crate::CandidateDescriptorV2; /// Candidate's acceptance limitations for asynchronous backing per relay parent. #[derive( - RuntimeDebug, + Debug, Copy, Clone, PartialEq, @@ -54,7 +54,7 @@ pub struct AsyncBackingParams { } /// Constraints on inbound HRMP channels. -#[derive(RuntimeDebug, Clone, PartialEq, Encode, Decode, TypeInfo)] +#[derive(Debug, Clone, PartialEq, Encode, Decode, TypeInfo)] pub struct InboundHrmpLimitations { /// An exhaustive set of all valid watermarks, sorted ascending. /// @@ -64,7 +64,7 @@ pub struct InboundHrmpLimitations { } /// Constraints on outbound HRMP channels. -#[derive(RuntimeDebug, Clone, PartialEq, Encode, Decode, TypeInfo)] +#[derive(Debug, Clone, PartialEq, Encode, Decode, TypeInfo)] pub struct OutboundHrmpChannelLimitations { /// The maximum bytes that can be written to the channel. pub bytes_remaining: u32, @@ -75,7 +75,7 @@ pub struct OutboundHrmpChannelLimitations { /// Constraints on the actions that can be taken by a new parachain /// block. These limitations are implicitly associated with some particular /// parachain, which should be apparent from usage. -#[derive(RuntimeDebug, Clone, PartialEq, Encode, Decode, TypeInfo)] +#[derive(Debug, Clone, PartialEq, Encode, Decode, TypeInfo)] pub struct Constraints { /// The minimum relay-parent number accepted under these constraints. pub min_relay_parent_number: N, @@ -116,7 +116,7 @@ impl Constraints { } /// A candidate pending availability. -#[derive(RuntimeDebug, Clone, PartialEq, Encode, Decode, TypeInfo)] +#[derive(Debug, Clone, PartialEq, Encode, Decode, TypeInfo)] pub struct CandidatePendingAvailability { /// The hash of the candidate. pub candidate_hash: CandidateHash, @@ -132,7 +132,7 @@ pub struct CandidatePendingAvailability { /// The per-parachain state of the backing system, including /// state-machine constraints and candidates pending availability. -#[derive(RuntimeDebug, Clone, PartialEq, Encode, Decode, TypeInfo)] +#[derive(Debug, Clone, PartialEq, Encode, Decode, TypeInfo)] pub struct BackingState { /// The state-machine constraints of the parachain. pub constraints: crate::async_backing::Constraints, diff --git a/polkadot/primitives/src/v9/mod.rs b/polkadot/primitives/src/v9/mod.rs index 360da8ff9b956..d3f1359fe0651 100644 --- a/polkadot/primitives/src/v9/mod.rs +++ b/polkadot/primitives/src/v9/mod.rs @@ -40,7 +40,7 @@ use sp_arithmetic::{ use bounded_collections::BoundedVec; use serde::{Deserialize, Serialize}; -use sp_core::{ConstU32, RuntimeDebug}; +use sp_core::ConstU32; use sp_inherents::InherentIdentifier; // ========== @@ -136,7 +136,7 @@ pub trait TypeIndex { Decode, DecodeWithMemTracking, TypeInfo, - RuntimeDebug, + Debug, )] #[cfg_attr(feature = "std", derive(Serialize, Deserialize, Hash))] pub struct ValidatorIndex(pub u32); @@ -147,7 +147,7 @@ pub struct ValidatorIndex(pub u32); /// the number of chunks will always be equal to the number of validators. /// However, the chunk index held by a validator may not always be equal to its `ValidatorIndex`, so /// we use a separate type to make code easier to read. -#[derive(Eq, Ord, PartialEq, PartialOrd, Copy, Clone, Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(Eq, Ord, PartialEq, PartialOrd, Copy, Clone, Encode, Decode, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize, Hash))] pub struct ChunkIndex(pub u32); @@ -522,7 +522,7 @@ pub type CandidateIndex = u32; /// The `PersistedValidationData` should be relatively lightweight primarily because it is /// constructed during inclusion for each candidate and therefore lies on the critical path of /// inclusion. -#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(Default))] pub struct PersistedValidationData { /// The parent head-data. @@ -543,7 +543,7 @@ impl PersistedValidationData { } /// Commitments made in a `CandidateReceipt`. Many of these are outputs of validation. -#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(Default, Hash))] pub struct CandidateCommitments { /// Messages destined to be interpreted by the Relay chain itself. @@ -571,7 +571,7 @@ impl CandidateCommitments { /// A bitfield concerning availability of backed candidates. /// /// Every bit refers to an availability core index. -#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo)] pub struct AvailabilityBitfield(pub BitVec); impl From> for AvailabilityBitfield { @@ -684,7 +684,7 @@ pub fn check_candidate_backing + Clone + Encode + core::fmt::Debu Clone, Copy, TypeInfo, - RuntimeDebug, + Debug, )] #[cfg_attr(feature = "std", derive(Hash))] pub struct CoreIndex(pub u32); @@ -732,11 +732,11 @@ impl TypeIndex for GroupIndex { } /// A claim on authoring the next block for a given parathread (on-demand parachain). -#[derive(Clone, Encode, Decode, TypeInfo, PartialEq, RuntimeDebug)] +#[derive(Clone, Encode, Decode, TypeInfo, PartialEq, Debug)] pub struct ParathreadClaim(pub Id, pub Option); /// An entry tracking a claim to ensure it does not pass the maximum number of retries. -#[derive(Clone, Encode, Decode, TypeInfo, PartialEq, RuntimeDebug)] +#[derive(Clone, Encode, Decode, TypeInfo, PartialEq, Debug)] pub struct ParathreadEntry { /// The claim. pub claim: ParathreadClaim, @@ -745,7 +745,7 @@ pub struct ParathreadEntry { } /// A helper data-type for tracking validator-group rotations. -#[derive(Clone, Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(Clone, Encode, Decode, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct GroupRotationInfo { /// The block number where the session started. @@ -833,7 +833,7 @@ impl GroupRotationInfo { } /// Information about a core which is currently occupied. -#[derive(Clone, Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(Clone, Encode, Decode, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct ScheduledCore { /// The ID of a para scheduled. @@ -845,7 +845,7 @@ pub struct ScheduledCore { } /// An assumption being made about the state of an occupied core. -#[derive(Clone, Copy, Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(Clone, Copy, Encode, Decode, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(PartialEq, Eq, Hash))] pub enum OccupiedCoreAssumption { /// The candidate occupying the core was made available and included to free the core. @@ -860,7 +860,7 @@ pub enum OccupiedCoreAssumption { } /// A vote of approval on a candidate. -#[derive(Clone, RuntimeDebug)] +#[derive(Clone, Debug)] pub struct ApprovalVote(pub CandidateHash); impl ApprovalVote { @@ -873,7 +873,7 @@ impl ApprovalVote { } /// A vote of approval for multiple candidates. -#[derive(Clone, RuntimeDebug)] +#[derive(Clone, Debug)] pub struct ApprovalVoteMultipleCandidates<'a>(pub &'a [CandidateHash]); impl<'a> ApprovalVoteMultipleCandidates<'a> { @@ -894,7 +894,7 @@ impl<'a> ApprovalVoteMultipleCandidates<'a> { /// Approval voting configuration parameters #[derive( - RuntimeDebug, + Debug, Copy, Clone, PartialEq, @@ -940,7 +940,7 @@ impl From for u8 { /// Abridged version of `HostConfiguration` (from the `Configuration` parachains host runtime /// module) meant to be used by a parachain or PDK such as cumulus. -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct AbridgedHostConfiguration { /// The maximum validation code size, in bytes. @@ -975,7 +975,7 @@ pub struct AbridgedHostConfiguration { /// Abridged version of `HrmpChannel` (from the `Hrmp` parachains host runtime module) meant to be /// used by a parachain or PDK such as cumulus. -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(Default, PartialEq))] pub struct AbridgedHrmpChannel { /// The maximum number of messages that can be pending in the channel at once. @@ -1001,7 +1001,7 @@ pub struct AbridgedHrmpChannel { } /// A possible upgrade restriction that prevents a parachain from performing an upgrade. -#[derive(Copy, Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Copy, Clone, Encode, Decode, PartialEq, Debug, TypeInfo)] pub enum UpgradeRestriction { /// There is an upgrade restriction and there are no details about its specifics nor how long /// it could last. @@ -1014,7 +1014,7 @@ pub enum UpgradeRestriction { /// /// This data type appears in the last step of the upgrade process. After the parachain observes it /// and reacts to it the upgrade process concludes. -#[derive(Copy, Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Copy, Clone, Encode, Decode, PartialEq, Debug, TypeInfo)] pub enum UpgradeGoAhead { /// Abort the upgrade process. There is something wrong with the validation code previously /// submitted by the parachain. This variant can also be used to prevent upgrades by the @@ -1083,7 +1083,7 @@ impl From for sp_runtime::DigestItem { /// A statement about a candidate, to be used within the dispute resolution process. /// /// Statements are either in favor of the candidate's validity or against it. -#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Debug, TypeInfo)] pub enum DisputeStatement { /// A valid statement, of the given kind. #[codec(index = 0)] @@ -1177,7 +1177,7 @@ impl DisputeStatement { } /// Different kinds of statements of validity on a candidate. -#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Debug, TypeInfo)] pub enum ValidDisputeStatementKind { /// An explicit statement issued as part of a dispute. #[codec(index = 0)] @@ -1213,7 +1213,7 @@ impl ValidDisputeStatementKind { } /// Different kinds of statements of invalidity on a candidate. -#[derive(Encode, Decode, DecodeWithMemTracking, Copy, Clone, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Copy, Clone, PartialEq, Debug, TypeInfo)] pub enum InvalidDisputeStatementKind { /// An explicit statement issued as part of a dispute. #[codec(index = 0)] @@ -1221,7 +1221,7 @@ pub enum InvalidDisputeStatementKind { } /// An explicit statement on a candidate issued as part of a dispute. -#[derive(Clone, PartialEq, RuntimeDebug)] +#[derive(Clone, PartialEq, Debug)] pub struct ExplicitDisputeStatement { /// Whether the candidate is valid pub valid: bool, @@ -1241,7 +1241,7 @@ impl ExplicitDisputeStatement { } /// A set of statements about a specific candidate. -#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Debug, TypeInfo)] pub struct DisputeStatementSet { /// The candidate referenced by this set. pub candidate_hash: CandidateHash, @@ -1267,7 +1267,7 @@ impl AsRef for DisputeStatementSet { pub type MultiDisputeStatementSet = Vec; /// A _checked_ set of dispute statements. -#[derive(Clone, PartialEq, RuntimeDebug, Encode)] +#[derive(Clone, PartialEq, Debug, Encode)] pub struct CheckedDisputeStatementSet(DisputeStatementSet); impl AsRef for CheckedDisputeStatementSet { @@ -1294,7 +1294,7 @@ impl CheckedDisputeStatementSet { pub type CheckedMultiDisputeStatementSet = Vec; /// The entire state of a dispute. -#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, TypeInfo)] +#[derive(Encode, Decode, Clone, Debug, PartialEq, TypeInfo)] pub struct DisputeState { /// A bitfield indicating all validators for the candidate. pub validators_for: BitVec, // one bit per validator. @@ -1308,7 +1308,7 @@ pub struct DisputeState { /// An either implicit or explicit attestation to the validity of a parachain /// candidate. -#[derive(Clone, Eq, PartialEq, Decode, DecodeWithMemTracking, Encode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Decode, DecodeWithMemTracking, Encode, Debug, TypeInfo)] pub enum ValidityAttestation { /// Implicit validity attestation by issuing. /// This corresponds to issuance of a `Candidate` statement. @@ -1358,7 +1358,7 @@ impl ValidityAttestation { } /// A type returned by runtime with current session index and a parent hash. -#[derive(Clone, Eq, PartialEq, Default, Decode, Encode, RuntimeDebug)] +#[derive(Clone, Eq, PartialEq, Default, Decode, Encode, Debug)] pub struct SigningContext { /// Current session index. pub session_index: sp_staking::SessionIndex, @@ -1370,7 +1370,7 @@ const BACKING_STATEMENT_MAGIC: [u8; 4] = *b"BKNG"; /// Statements that can be made about parachain candidates. These are the /// actual values that are signed. -#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, RuntimeDebug)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)] #[cfg_attr(feature = "std", derive(Hash))] pub enum CompactStatement { /// Proposal of a parachain candidate. @@ -1439,7 +1439,7 @@ impl codec::Decode for CompactStatement { } /// `IndexedVec` struct indexed by type specific indices. -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct IndexedVec(Vec, PhantomData K>); @@ -1537,7 +1537,7 @@ pub fn effective_minimum_backing_votes( /// /// NOTE: `SessionInfo` is frozen. Do not include new fields, consider creating a separate runtime /// API. Reasoning and further outlook [here](https://github.com/paritytech/polkadot/issues/6586). -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct SessionInfo { /****** New in v2 ****** */ @@ -1597,7 +1597,7 @@ pub struct SessionInfo { /// A statement from the specified validator whether the given validation code passes PVF /// pre-checking or not anchored to the given session index. -#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Debug, TypeInfo)] pub struct PvfCheckStatement { /// `true` if the subject passed pre-checking and `false` otherwise. pub accept: bool, @@ -1735,7 +1735,7 @@ pub mod node_features { /// Scheduler configuration parameters. All coretime/ondemand parameters are here. #[derive( - RuntimeDebug, + Debug, Copy, Clone, PartialEq, @@ -1813,13 +1813,11 @@ impl> Default for SchedulerParams } /// A type representing the version of the candidate descriptor and internal version number. -#[derive( - PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, Clone, TypeInfo, RuntimeDebug, Copy, -)] +#[derive(PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, Clone, TypeInfo, Debug, Copy)] pub struct InternalVersion(pub u8); /// A type representing the version of the candidate descriptor. -#[derive(PartialEq, Eq, Clone, TypeInfo, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, TypeInfo, Debug)] pub enum CandidateDescriptorVersion { /// The old candidate descriptor version. V1, @@ -2138,7 +2136,7 @@ impl MutateDescriptorV2 for CandidateDescriptorV2 { } /// A candidate-receipt at version 2. -#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug)] pub struct CandidateReceiptV2 { /// The descriptor of the candidate. pub descriptor: CandidateDescriptorV2, @@ -2147,7 +2145,7 @@ pub struct CandidateReceiptV2 { } /// A candidate-receipt with commitments directly included. -#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug)] pub struct CommittedCandidateReceiptV2 { /// The descriptor of the candidate. pub descriptor: CandidateDescriptorV2, @@ -2156,7 +2154,7 @@ pub struct CommittedCandidateReceiptV2 { } /// An event concerning a candidate. -#[derive(Clone, Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(Clone, Encode, Decode, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(PartialEq))] pub enum CandidateEvent { /// This candidate receipt was backed in the most recent block. @@ -2262,7 +2260,7 @@ pub const DEFAULT_CLAIM_QUEUE_OFFSET: u8 = 0; /// it's too generic and extensible. pub type ApprovedPeerId = BoundedVec>; -#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, RuntimeDebug, Default)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, Debug, Default)] /// User-friendly representation of a candidate's UMP signals. pub struct CandidateUMPSignals { pub(super) select_core: Option<(CoreSelector, ClaimQueueOffset)>, @@ -2359,7 +2357,7 @@ impl CandidateCommitments { } /// CommittedCandidateReceiptError construction errors. -#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(thiserror::Error))] pub enum CommittedCandidateReceiptError { /// The specified core index is invalid. @@ -2503,7 +2501,7 @@ impl CommittedCandidateReceiptV2 { } /// A backed (or backable, depending on context) candidate. -#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo)] pub struct BackedCandidate { /// The candidate referred to. candidate: CommittedCandidateReceiptV2, @@ -2516,7 +2514,7 @@ pub struct BackedCandidate { } /// Parachains inherent-data passed into the runtime by a block author -#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Debug, TypeInfo)] pub struct InherentData { /// Signed bitfields by validators about availability. pub bitfields: UncheckedSignedAvailabilityBitfields, @@ -2632,7 +2630,7 @@ impl BackedCandidate { } /// Scraped runtime backing votes and resolved disputes. -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct ScrapedOnChainVotes { /// The session in which the block was included. @@ -2648,7 +2646,7 @@ pub struct ScrapedOnChainVotes { } /// Information about a core which is currently occupied. -#[derive(Clone, Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(Clone, Encode, Decode, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct OccupiedCore { // NOTE: this has no ParaId as it can be deduced from the candidate descriptor. @@ -2683,7 +2681,7 @@ impl OccupiedCore { } /// The state of a particular availability core. -#[derive(Clone, Encode, Decode, TypeInfo, RuntimeDebug)] +#[derive(Clone, Encode, Decode, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(PartialEq))] pub enum CoreState { /// The core is currently occupied. diff --git a/polkadot/primitives/src/v9/signed.rs b/polkadot/primitives/src/v9/signed.rs index 4c617155fa80a..9b8f162ea2831 100644 --- a/polkadot/primitives/src/v9/signed.rs +++ b/polkadot/primitives/src/v9/signed.rs @@ -23,8 +23,8 @@ use sp_application_crypto::AppCrypto; #[cfg(feature = "std")] use sp_keystore::{Error as KeystoreError, KeystorePtr}; -use sp_core::RuntimeDebug; use sp_runtime::traits::AppVerify; +use Debug; use super::{SigningContext, ValidatorId, ValidatorIndex, ValidatorSignature}; @@ -36,7 +36,7 @@ use super::{SigningContext, ValidatorId, ValidatorIndex, ValidatorSignature}; /// /// `Signed` can easily be converted into `UncheckedSigned` and conversion back via `into_signed` /// enforces a valid signature again. -#[derive(Clone, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub struct Signed(UncheckedSigned); impl Signed { @@ -47,7 +47,7 @@ impl Signed { } /// Unchecked signed data, can be converted to `Signed` by checking the signature. -#[derive(Clone, PartialEq, Eq, RuntimeDebug, Encode, Decode, DecodeWithMemTracking, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, TypeInfo)] pub struct UncheckedSigned { /// The payload is part of the signed data. The rest is the signing context, /// which is known both at signing and at validation. diff --git a/polkadot/runtime/common/src/assigned_slots/mod.rs b/polkadot/runtime/common/src/assigned_slots/mod.rs index b0c445bb7a6e2..b48e512431d6a 100644 --- a/polkadot/runtime/common/src/assigned_slots/mod.rs +++ b/polkadot/runtime/common/src/assigned_slots/mod.rs @@ -46,16 +46,14 @@ use sp_runtime::traits::{One, Saturating, Zero}; const LOG_TARGET: &str = "runtime::assigned_slots"; /// Lease period an assigned slot should start from (current, or next one). -#[derive( - Encode, Decode, DecodeWithMemTracking, Clone, Copy, Eq, PartialEq, RuntimeDebug, TypeInfo, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Copy, Eq, PartialEq, Debug, TypeInfo)] pub enum SlotLeasePeriodStart { Current, Next, } /// Information about a temporary parachain slot. -#[derive(Encode, Decode, Clone, PartialEq, Eq, Default, MaxEncodedLen, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Default, MaxEncodedLen, Debug, TypeInfo)] pub struct ParachainTemporarySlot { /// Manager account of the para. pub manager: AccountId, diff --git a/polkadot/runtime/common/src/claims/mod.rs b/polkadot/runtime/common/src/claims/mod.rs index 409391473c70e..9549d35b7ec50 100644 --- a/polkadot/runtime/common/src/claims/mod.rs +++ b/polkadot/runtime/common/src/claims/mod.rs @@ -42,7 +42,6 @@ use sp_runtime::{ InvalidTransaction, TransactionSource, TransactionValidity, TransactionValidityError, ValidTransaction, }, - RuntimeDebug, }; type CurrencyOf = <::VestingSchedule as VestingSchedule< @@ -90,7 +89,7 @@ impl WeightInfo for TestWeightInfo { Copy, Eq, PartialEq, - RuntimeDebug, + Debug, TypeInfo, Serialize, Deserialize, @@ -137,7 +136,7 @@ impl Default for StatementKind { Decode, DecodeWithMemTracking, Default, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] diff --git a/polkadot/runtime/common/src/crowdloan/mod.rs b/polkadot/runtime/common/src/crowdloan/mod.rs index 19594b07d5e82..b36c0aabb2128 100644 --- a/polkadot/runtime/common/src/crowdloan/mod.rs +++ b/polkadot/runtime/common/src/crowdloan/mod.rs @@ -76,7 +76,7 @@ use sp_runtime::{ traits::{ AccountIdConversion, CheckedAdd, Hash, IdentifyAccount, One, Saturating, Verify, Zero, }, - MultiSignature, MultiSigner, RuntimeDebug, + Debug, MultiSignature, MultiSigner, }; type CurrencyOf = <::Auctioneer as Auctioneer>>::Currency; @@ -128,7 +128,7 @@ impl WeightInfo for TestWeightInfo { } } -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo)] pub enum LastContribution { Never, PreEnding(u32), @@ -137,7 +137,7 @@ pub enum LastContribution { /// Information on a funding effort for a pre-existing parachain. We assume that the parachain ID /// is known as it's used for the key of the storage item for which this is the value (`Funds`). -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo)] #[codec(dumb_trait_bound)] pub struct FundInfo { /// The owning account who placed the deposit. diff --git a/polkadot/runtime/common/src/impls.rs b/polkadot/runtime/common/src/impls.rs index f596a03d66a8f..53229495dd588 100644 --- a/polkadot/runtime/common/src/impls.rs +++ b/polkadot/runtime/common/src/impls.rs @@ -24,7 +24,7 @@ use frame_support::traits::{ }; use pallet_treasury::TreasuryAccountId; use polkadot_primitives::Balance; -use sp_runtime::{traits::TryConvert, Perquintill, RuntimeDebug}; +use sp_runtime::{traits::TryConvert, Perquintill}; use xcm::VersionedLocation; /// Logic for the author to get a portion of fees. @@ -137,7 +137,7 @@ pub fn relay_era_payout(params: EraPayoutParams) -> (Balance, Balance) { Eq, PartialEq, Clone, - RuntimeDebug, + Debug, scale_info::TypeInfo, MaxEncodedLen, )] diff --git a/polkadot/runtime/common/src/paras_registrar/mod.rs b/polkadot/runtime/common/src/paras_registrar/mod.rs index f889aa8e7bd5c..a778a1631afd1 100644 --- a/polkadot/runtime/common/src/paras_registrar/mod.rs +++ b/polkadot/runtime/common/src/paras_registrar/mod.rs @@ -44,7 +44,7 @@ use polkadot_runtime_parachains::paras::{OnNewHead, ParaKind}; use scale_info::TypeInfo; use sp_runtime::{ traits::{CheckedSub, Saturating}, - RuntimeDebug, + Debug, }; #[derive( @@ -54,7 +54,7 @@ use sp_runtime::{ PartialEq, Eq, Default, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, DecodeWithMemTracking, diff --git a/polkadot/runtime/common/src/purchase/mod.rs b/polkadot/runtime/common/src/purchase/mod.rs index e734ec1c734b9..c4575663b8fdb 100644 --- a/polkadot/runtime/common/src/purchase/mod.rs +++ b/polkadot/runtime/common/src/purchase/mod.rs @@ -28,16 +28,14 @@ use scale_info::TypeInfo; use sp_core::sr25519; use sp_runtime::{ traits::{CheckedAdd, Saturating, Verify, Zero}, - AnySignature, DispatchError, DispatchResult, Permill, RuntimeDebug, + AnySignature, Debug, DispatchError, DispatchResult, Permill, }; type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; /// The kind of statement an account needs to make for a claim to be valid. -#[derive( - Encode, Decode, DecodeWithMemTracking, Clone, Copy, Eq, PartialEq, RuntimeDebug, TypeInfo, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Copy, Eq, PartialEq, Debug, TypeInfo)] pub enum AccountValidity { /// Account is not valid. Invalid, @@ -73,7 +71,7 @@ impl AccountValidity { } /// All information about an account regarding the purchase of DOTs. -#[derive(Encode, Decode, Default, Clone, Eq, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Default, Clone, Eq, PartialEq, Debug, TypeInfo)] pub struct AccountStatus { /// The current validity status of the user. Will denote if the user has passed KYC, /// how much they are able to purchase, and when their purchase process has completed. diff --git a/polkadot/runtime/parachains/src/assigner_coretime/mod.rs b/polkadot/runtime/parachains/src/assigner_coretime/mod.rs index 980fff08cce37..51988b964881b 100644 --- a/polkadot/runtime/parachains/src/assigner_coretime/mod.rs +++ b/polkadot/runtime/parachains/src/assigner_coretime/mod.rs @@ -45,7 +45,7 @@ pub use pallet::*; /// Fraction expressed as a nominator with an assumed denominator of 57,600. #[derive( - RuntimeDebug, + Debug, Clone, Copy, PartialEq, @@ -98,7 +98,7 @@ impl PartsOf57600 { /// /// for a particular core. #[derive(Encode, Decode, TypeInfo)] -#[cfg_attr(test, derive(PartialEq, RuntimeDebug))] +#[cfg_attr(test, derive(PartialEq, Debug))] struct Schedule { // Original assignments assignments: Vec<(CoreAssignment, PartsOf57600)>, @@ -120,7 +120,7 @@ struct Schedule { /// Contains pointers to first and last schedule into `CoreSchedules` for that core and keeps track /// of the currently active work as well. #[derive(Encode, Decode, TypeInfo, Default)] -#[cfg_attr(test, derive(PartialEq, RuntimeDebug, Clone))] +#[cfg_attr(test, derive(PartialEq, Debug, Clone))] struct CoreDescriptor { /// Meta data about the queued schedules for this core. queue: Option>, @@ -133,7 +133,7 @@ struct CoreDescriptor { /// Schedules in `CoreSchedules` form a queue. `Schedule::next_schedule` always pointing to the next /// item. #[derive(Encode, Decode, TypeInfo, Copy, Clone)] -#[cfg_attr(test, derive(PartialEq, RuntimeDebug))] +#[cfg_attr(test, derive(PartialEq, Debug))] struct QueueDescriptor { /// First scheduled item, that is not yet active. first: N, @@ -142,7 +142,7 @@ struct QueueDescriptor { } #[derive(Encode, Decode, TypeInfo)] -#[cfg_attr(test, derive(PartialEq, RuntimeDebug, Clone))] +#[cfg_attr(test, derive(PartialEq, Debug, Clone))] struct WorkState { /// Assignments with current state. /// @@ -167,7 +167,7 @@ struct WorkState { } #[derive(Encode, Decode, TypeInfo)] -#[cfg_attr(test, derive(PartialEq, RuntimeDebug, Clone, Copy))] +#[cfg_attr(test, derive(PartialEq, Debug, Clone, Copy))] struct AssignmentState { /// Ratio of the core this assignment has. /// diff --git a/polkadot/runtime/parachains/src/configuration.rs b/polkadot/runtime/parachains/src/configuration.rs index c424cd51c0b44..573f911d4e68a 100644 --- a/polkadot/runtime/parachains/src/configuration.rs +++ b/polkadot/runtime/parachains/src/configuration.rs @@ -59,7 +59,7 @@ pub(crate) const MAX_VALIDATION_CODE_COMPRESSION_RATIO: u32 = 10; Encode, Decode, PartialEq, - sp_core::RuntimeDebug, + Debug, scale_info::TypeInfo, serde::Serialize, serde::Deserialize, diff --git a/polkadot/runtime/parachains/src/disputes.rs b/polkadot/runtime/parachains/src/disputes.rs index 6f0aca0ff66e0..0e092f17fa9b5 100644 --- a/polkadot/runtime/parachains/src/disputes.rs +++ b/polkadot/runtime/parachains/src/disputes.rs @@ -36,7 +36,7 @@ use polkadot_runtime_metrics::get_current_time; use scale_info::TypeInfo; use sp_runtime::{ traits::{AppVerify, One, Saturating, Zero}, - DispatchError, RuntimeDebug, SaturatedConversion, + Debug, DispatchError, SaturatedConversion, }; #[cfg(test)] @@ -55,14 +55,14 @@ pub mod migration; const LOG_TARGET: &str = "runtime::disputes"; /// Whether the dispute is local or remote. -#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo)] pub enum DisputeLocation { Local, Remote, } /// The result of a dispute, whether the candidate is deemed valid (for) or invalid (against). -#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo)] pub enum DisputeResult { Valid, Invalid, @@ -546,7 +546,7 @@ struct ImportSummary { new_flags: DisputeStateFlags, } -#[derive(RuntimeDebug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq)] enum VoteImportError { /// Validator index was outside the range of valid validator indices in the given session. ValidatorIndexOutOfBounds, @@ -558,7 +558,7 @@ enum VoteImportError { MaliciousBacker, } -#[derive(RuntimeDebug, Copy, Clone, PartialEq, Eq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] enum VoteKind { /// A backing vote that is counted as "for" vote in dispute resolution. Backing, @@ -607,7 +607,7 @@ impl From for Error { } /// A transport statement bit change for a single validator. -#[derive(RuntimeDebug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq)] struct ImportUndo { /// The validator index to which to associate the statement import. validator_index: ValidatorIndex, diff --git a/polkadot/runtime/parachains/src/inclusion/mod.rs b/polkadot/runtime/parachains/src/inclusion/mod.rs index dbfa71403b1df..3c77275ca7312 100644 --- a/polkadot/runtime/parachains/src/inclusion/mod.rs +++ b/polkadot/runtime/parachains/src/inclusion/mod.rs @@ -219,15 +219,7 @@ impl QueueFootprinter for () { /// Can be extended to serve further use-cases besides just UMP. Is stored in storage, so any change /// to existing values will require a migration. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - MaxEncodedLen, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, Clone, MaxEncodedLen, Eq, PartialEq, Debug, TypeInfo, )] pub enum AggregateMessageOrigin { /// Inbound upward message. @@ -240,15 +232,7 @@ pub enum AggregateMessageOrigin { /// It is written in verbose form since future variants like `Here` and `Bridged` are already /// foreseeable. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - MaxEncodedLen, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, Clone, MaxEncodedLen, Eq, PartialEq, Debug, TypeInfo, )] pub enum UmpQueueId { /// The message originated from this parachain. diff --git a/polkadot/runtime/parachains/src/on_demand/types.rs b/polkadot/runtime/parachains/src/on_demand/types.rs index c87e7abaf8607..db3d750301b10 100644 --- a/polkadot/runtime/parachains/src/on_demand/types.rs +++ b/polkadot/runtime/parachains/src/on_demand/types.rs @@ -20,7 +20,7 @@ use super::{alloc, pallet::Config}; use alloc::collections::BinaryHeap; use core::cmp::{Ord, Ordering, PartialOrd}; use frame_support::{ - pallet_prelude::{Decode, Encode, RuntimeDebug, TypeInfo}, + pallet_prelude::{Debug, Decode, Encode, TypeInfo}, traits::Currency, }; use polkadot_primitives::{CoreIndex, Id as ParaId, ON_DEMAND_MAX_QUEUE_MAX_SIZE}; @@ -213,21 +213,21 @@ impl Ord for EnqueuedOrder { /// Keeps track of how many assignments a scheduler currently has at a specific `CoreIndex` for a /// specific `ParaId`. #[derive(Encode, Decode, Default, Clone, Copy, TypeInfo)] -#[cfg_attr(test, derive(PartialEq, RuntimeDebug))] +#[cfg_attr(test, derive(PartialEq, Debug))] pub struct CoreAffinityCount { pub core_index: CoreIndex, pub count: u32, } /// An indicator as to which end of the `OnDemandQueue` an assignment will be placed. -#[cfg_attr(test, derive(RuntimeDebug))] +#[cfg_attr(test, derive(Debug))] pub enum QueuePushDirection { Back, Front, } /// Errors that can happen during spot traffic calculation. -#[derive(PartialEq, RuntimeDebug)] +#[derive(PartialEq, Debug)] pub enum SpotTrafficCalculationErr { /// The order queue capacity is at 0. QueueCapacityIsZero, diff --git a/polkadot/runtime/parachains/src/paras/mod.rs b/polkadot/runtime/parachains/src/paras/mod.rs index 2c521dab614c6..8eb5530362856 100644 --- a/polkadot/runtime/parachains/src/paras/mod.rs +++ b/polkadot/runtime/parachains/src/paras/mod.rs @@ -128,11 +128,11 @@ use polkadot_primitives::{ UpgradeRestriction, ValidationCode, ValidationCodeHash, ValidatorSignature, MIN_CODE_SIZE, }; use scale_info::{Type, TypeInfo}; -use sp_core::RuntimeDebug; use sp_runtime::{ traits::{AppVerify, One, Saturating}, DispatchResult, SaturatedConversion, }; +use Debug; use serde::{Deserialize, Serialize}; @@ -183,7 +183,7 @@ pub struct ParaPastCodeMeta { /// If the para is in a "transition state", it is expected that the parachain is /// queued in the `ActionsQueue` to transition it into a stable state. Its lifecycle /// state will be used to determine the state transition to apply to the para. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo)] pub enum ParaLifecycle { /// Para is new and is onboarding as an on-demand or lease holding Parachain. Onboarding, @@ -301,7 +301,7 @@ impl ParaPastCodeMeta { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, Serialize, Deserialize, @@ -317,7 +317,7 @@ pub struct ParaGenesisArgs { } /// Distinguishes between lease holding Parachain and Parathread (on-demand parachain) -#[derive(DecodeWithMemTracking, PartialEq, Eq, Clone, RuntimeDebug)] +#[derive(DecodeWithMemTracking, PartialEq, Eq, Clone, Debug)] pub enum ParaKind { Parathread, Parachain, @@ -439,7 +439,7 @@ impl PvfCheckCause { } /// Specifies what was the outcome of a PVF pre-checking vote. -#[derive(Copy, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Copy, Clone, Encode, Decode, Debug, TypeInfo)] enum PvfCheckOutcome { Accepted, Rejected, diff --git a/polkadot/runtime/parachains/src/paras_inherent/mod.rs b/polkadot/runtime/parachains/src/paras_inherent/mod.rs index a78c6fc22102e..5c8e7ca82a1f8 100644 --- a/polkadot/runtime/parachains/src/paras_inherent/mod.rs +++ b/polkadot/runtime/parachains/src/paras_inherent/mod.rs @@ -84,7 +84,7 @@ const LOG_TARGET: &str = "runtime::inclusion-inherent"; /// A bitfield concerning concluded disputes for candidates /// associated to the core index equivalent to the bit position. -#[derive(Default, PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Default, PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo)] pub(crate) struct DisputedBitfield(pub(crate) BitVec); impl From> for DisputedBitfield { diff --git a/polkadot/runtime/parachains/src/scheduler/common.rs b/polkadot/runtime/parachains/src/scheduler/common.rs index bf8a2bee74e3c..96a96aed8ee0f 100644 --- a/polkadot/runtime/parachains/src/scheduler/common.rs +++ b/polkadot/runtime/parachains/src/scheduler/common.rs @@ -19,13 +19,13 @@ use scale_info::TypeInfo; use sp_runtime::{ codec::{Decode, Encode}, - RuntimeDebug, + Debug, }; use polkadot_primitives::{CoreIndex, Id as ParaId}; /// Assignment (ParaId -> CoreIndex). -#[derive(Encode, Decode, TypeInfo, RuntimeDebug, Clone, PartialEq)] +#[derive(Encode, Decode, TypeInfo, Debug, Clone, PartialEq)] pub enum Assignment { /// A pool assignment. Pool { diff --git a/polkadot/runtime/parachains/src/scheduler/migration.rs b/polkadot/runtime/parachains/src/scheduler/migration.rs index e741711cad6d8..c3a61fa685422 100644 --- a/polkadot/runtime/parachains/src/scheduler/migration.rs +++ b/polkadot/runtime/parachains/src/scheduler/migration.rs @@ -27,7 +27,7 @@ use frame_support::{ /// /// `Assignment` used to be a concrete type with the same layout V0Assignment, identical on all /// assignment providers. This can be removed once storage has been migrated. -#[derive(Encode, Decode, RuntimeDebug, TypeInfo, PartialEq, Clone)] +#[derive(Encode, Decode, Debug, TypeInfo, PartialEq, Clone)] struct V0Assignment { pub para_id: ParaId, } @@ -76,7 +76,7 @@ mod v0 { pub(super) type ParathreadClaimIndex = StorageValue, (), ValueQuery>; /// The assignment type. - #[derive(Clone, Encode, Decode, TypeInfo, RuntimeDebug)] + #[derive(Clone, Encode, Decode, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(PartialEq))] pub enum AssignmentKind { /// A parachain. @@ -86,7 +86,7 @@ mod v0 { } /// How a free core is scheduled to be assigned. - #[derive(Clone, Encode, Decode, TypeInfo, RuntimeDebug)] + #[derive(Clone, Encode, Decode, TypeInfo, Debug)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct CoreAssignment { /// The core that is assigned. @@ -125,7 +125,7 @@ mod v1 { pub(super) type AvailabilityCores = StorageValue, Vec>>, ValueQuery>; - #[derive(Encode, Decode, TypeInfo, RuntimeDebug, PartialEq)] + #[derive(Encode, Decode, TypeInfo, Debug, PartialEq)] pub(super) enum CoreOccupied { /// No candidate is waiting availability on this core right now (the core is not occupied). Free, @@ -133,7 +133,7 @@ mod v1 { Paras(ParasEntry), } - #[derive(Encode, Decode, TypeInfo, RuntimeDebug, PartialEq)] + #[derive(Encode, Decode, TypeInfo, Debug, PartialEq)] pub(super) struct ParasEntry { /// The underlying `Assignment` pub(super) assignment: V0Assignment, @@ -272,13 +272,13 @@ pub(crate) mod v2 { use super::*; use crate::scheduler; - #[derive(Encode, Decode, TypeInfo, RuntimeDebug, PartialEq)] + #[derive(Encode, Decode, TypeInfo, Debug, PartialEq)] pub(crate) enum CoreOccupied { Free, Paras(ParasEntry), } - #[derive(Encode, Decode, TypeInfo, RuntimeDebug, PartialEq)] + #[derive(Encode, Decode, TypeInfo, Debug, PartialEq)] pub(crate) struct ParasEntry { pub assignment: Assignment, pub availability_timeouts: u32, diff --git a/polkadot/runtime/rococo/src/governance/origins.rs b/polkadot/runtime/rococo/src/governance/origins.rs index 46d50bf5887ce..b2ad7f32dfa02 100644 --- a/polkadot/runtime/rococo/src/governance/origins.rs +++ b/polkadot/runtime/rococo/src/governance/origins.rs @@ -30,15 +30,7 @@ pub mod pallet_custom_origins { pub struct Pallet(_); #[derive( - PartialEq, - Eq, - Clone, - MaxEncodedLen, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - RuntimeDebug, + PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug, )] #[pallet::origin] pub enum Origin { diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index 80426212d4c29..c715980bcb0af 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -116,7 +116,7 @@ use sp_runtime::{ Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, + ApplyExtrinsicResult, Debug, FixedU128, KeyTypeId, Perbill, Percent, Permill, }; use sp_staking::SessionIndex; #[cfg(any(feature = "std", test))] @@ -892,7 +892,7 @@ parameter_types! { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, )] diff --git a/polkadot/runtime/westend/src/governance/origins.rs b/polkadot/runtime/westend/src/governance/origins.rs index 46d50bf5887ce..b2ad7f32dfa02 100644 --- a/polkadot/runtime/westend/src/governance/origins.rs +++ b/polkadot/runtime/westend/src/governance/origins.rs @@ -30,15 +30,7 @@ pub mod pallet_custom_origins { pub struct Pallet(_); #[derive( - PartialEq, - Eq, - Clone, - MaxEncodedLen, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - RuntimeDebug, + PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug, )] #[pallet::origin] pub enum Origin { diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index b39e53ad75e91..13808c1219346 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -97,7 +97,7 @@ use sp_consensus_beefy::{ ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature}, mmr::{BeefyDataProvider, MmrLeafVersion}, }; -use sp_core::{ConstBool, ConstU8, ConstUint, OpaqueMetadata, RuntimeDebug, H256}; +use sp_core::{ConstBool, ConstU8, ConstUint, OpaqueMetadata, H256}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; use sp_runtime::{ @@ -1248,7 +1248,7 @@ parameter_types! { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, )] diff --git a/polkadot/xcm/pallet-xcm/src/lib.rs b/polkadot/xcm/pallet-xcm/src/lib.rs index 7d286b88493ea..116fb44adaef2 100644 --- a/polkadot/xcm/pallet-xcm/src/lib.rs +++ b/polkadot/xcm/pallet-xcm/src/lib.rs @@ -55,7 +55,7 @@ use sp_runtime::{ AccountIdConversion, BadOrigin, BlakeTwo256, BlockNumberProvider, Dispatchable, Hash, Saturating, Zero, }, - Either, RuntimeDebug, SaturatedConversion, + Debug, Either, SaturatedConversion, }; use storage::{with_transaction, TransactionOutcome}; use xcm::{latest::QueryResponseInfo, prelude::*}; @@ -636,15 +636,7 @@ pub mod pallet { #[pallet::origin] #[derive( - PartialEq, - Eq, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, MaxEncodedLen, )] pub enum Origin { /// It comes from somewhere in the XCM space wanting to transact. @@ -757,7 +749,7 @@ pub mod pallet { } /// The status of a query. - #[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] + #[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub enum QueryStatus { /// The query was sent but no response has yet been received. Pending { @@ -1048,7 +1040,7 @@ pub mod pallet { use super::*; use frame_support::traits::{PalletInfoAccess, StorageVersion}; - #[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] + #[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] enum QueryStatusV0 { Pending { responder: VersionedLocation, diff --git a/polkadot/xcm/xcm-executor/src/assets.rs b/polkadot/xcm/xcm-executor/src/assets.rs index e9425f2944bfc..7f3e6fd0b2135 100644 --- a/polkadot/xcm/xcm-executor/src/assets.rs +++ b/polkadot/xcm/xcm-executor/src/assets.rs @@ -19,7 +19,7 @@ use alloc::{ vec::Vec, }; use core::mem; -use sp_runtime::{traits::Saturating, RuntimeDebug}; +use sp_runtime::traits::Saturating; use xcm::latest::{ Asset, AssetFilter, AssetId, AssetInstance, Assets, Fungibility::{Fungible, NonFungible}, @@ -29,7 +29,7 @@ use xcm::latest::{ }; /// Map of non-wildcard fungible and non-fungible assets held in the holding register. -#[derive(Default, Clone, RuntimeDebug, Eq, PartialEq)] +#[derive(Default, Clone, Debug, Eq, PartialEq)] pub struct AssetsInHolding { /// The fungible assets. pub fungible: BTreeMap, diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index 8eb710dfa99e4..fc9d3b9d1a44d 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -110,8 +110,8 @@ use sp_runtime::{ MaybeConvert, NumberFor, OpaqueKeys, SaturatedConversion, StaticLookup, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedPointNumber, FixedU128, MultiSignature, MultiSigner, Perbill, - Percent, Permill, Perquintill, RuntimeDebug, + ApplyExtrinsicResult, Debug, FixedPointNumber, FixedU128, MultiSignature, MultiSigner, Perbill, + Percent, Permill, Perquintill, }; use sp_std::{borrow::Cow, prelude::*}; #[cfg(any(feature = "std", test))] @@ -422,7 +422,7 @@ parameter_types! { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/substrate/client/transaction-pool/src/graph/base_pool.rs b/substrate/client/transaction-pool/src/graph/base_pool.rs index 27d7878eff1a5..72ec19264ec26 100644 --- a/substrate/client/transaction-pool/src/graph/base_pool.rs +++ b/substrate/client/transaction-pool/src/graph/base_pool.rs @@ -1169,7 +1169,7 @@ mod tests { ), "Transaction { \ hash: 4, priority: 1000, valid_till: 64, bytes: 1, propagate: true, \ -source: TimedTransactionSource { source: TransactionSource::External, timestamp: None }, requires: [03, 02], provides: [04], data: [4]}" +source: TimedTransactionSource { source: External, timestamp: None }, requires: [03, 02], provides: [04], data: [4]}" .to_owned() ); } diff --git a/substrate/frame/alliance/src/lib.rs b/substrate/frame/alliance/src/lib.rs index 8db503b3a441e..4258c419d516e 100644 --- a/substrate/frame/alliance/src/lib.rs +++ b/substrate/frame/alliance/src/lib.rs @@ -102,7 +102,7 @@ use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; use sp_runtime::{ traits::{Dispatchable, Saturating, StaticLookup, Zero}, - DispatchError, RuntimeDebug, + Debug, DispatchError, }; use frame_support::{ @@ -196,7 +196,7 @@ pub trait ProposalProvider { } /// The various roles that a member can hold. -#[derive(Copy, Clone, PartialEq, Eq, RuntimeDebug, Encode, Decode, TypeInfo, MaxEncodedLen)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)] pub enum MemberRole { Fellow, Ally, @@ -205,15 +205,7 @@ pub enum MemberRole { /// The type of item that may be deemed unscrupulous. #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - MaxEncodedLen, + Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, TypeInfo, MaxEncodedLen, )] pub enum UnscrupulousItem { AccountId(AccountId), diff --git a/substrate/frame/alliance/src/types.rs b/substrate/frame/alliance/src/types.rs index 2c7112652d664..d2bd479b7437e 100644 --- a/substrate/frame/alliance/src/types.rs +++ b/substrate/frame/alliance/src/types.rs @@ -19,7 +19,7 @@ use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use frame_support::{traits::ConstU32, BoundedVec}; use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; +use Debug; /// A Multihash instance that only supports the basic functionality and no hashing. #[derive( @@ -28,7 +28,7 @@ use sp_runtime::RuntimeDebug; Eq, PartialOrd, Ord, - RuntimeDebug, + Debug, Encode, Decode, DecodeWithMemTracking, @@ -57,7 +57,7 @@ impl Multihash { Eq, PartialOrd, Ord, - RuntimeDebug, + Debug, Encode, Decode, DecodeWithMemTracking, @@ -80,7 +80,7 @@ pub enum Version { Eq, PartialOrd, Ord, - RuntimeDebug, + Debug, Encode, Decode, DecodeWithMemTracking, @@ -124,7 +124,7 @@ impl Cid { DecodeWithMemTracking, Eq, PartialEq, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, Default, diff --git a/substrate/frame/assets/src/types.rs b/substrate/frame/assets/src/types.rs index baa530565bcea..1c61132e00ed5 100644 --- a/substrate/frame/assets/src/types.rs +++ b/substrate/frame/assets/src/types.rs @@ -37,7 +37,7 @@ pub type ExistenceReasonOf = /// AssetStatus holds the current state of the asset. It could either be Live and available for use, /// or in a Destroying state. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, MaxEncodedLen, TypeInfo)] pub enum AssetStatus { /// The asset is active and able to be used. Live, @@ -48,7 +48,7 @@ pub enum AssetStatus { Destroying, } -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, MaxEncodedLen, TypeInfo)] pub struct AssetDetails { /// Can change `owner`, `issuer`, `freezer` and `admin` accounts. pub owner: AccountId, @@ -78,7 +78,7 @@ pub struct AssetDetails { } /// Data concerning an approval. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, Default, MaxEncodedLen, TypeInfo)] pub struct Approval { /// The amount of funds approved for the balance transfer from the owner to some delegated /// target. @@ -94,7 +94,7 @@ fn ensure_bool_decodes_to_consumer_or_sufficient() { } /// The reason for an account's existence within an asset class. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, MaxEncodedLen, TypeInfo)] pub enum ExistenceReason { /// A consumer reference was used to create this account. #[codec(index = 0)] @@ -152,7 +152,7 @@ fn ensure_bool_decodes_to_liquid_or_frozen() { } /// The status of an asset account. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, MaxEncodedLen, TypeInfo)] pub enum AccountStatus { /// Asset account can receive and transfer the assets. Liquid, @@ -172,7 +172,7 @@ impl AccountStatus { } } -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, MaxEncodedLen, TypeInfo)] pub struct AssetAccount { /// The account's balance. /// @@ -187,7 +187,7 @@ pub struct AssetAccount { pub extra: Extra, } -#[derive(Clone, Encode, Decode, Eq, PartialEq, Default, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Default, Debug, MaxEncodedLen, TypeInfo)] pub struct AssetMetadata { /// The balance deposited for this metadata. /// @@ -306,7 +306,7 @@ impl From for DebitFlags { } /// Possible errors when converting between external and asset balances. -#[derive(Eq, PartialEq, Copy, Clone, RuntimeDebug, Encode, Decode)] +#[derive(Eq, PartialEq, Copy, Clone, Debug, Encode, Decode)] pub enum ConversionError { /// The external minimum balance must not be zero. MinBalanceZero, diff --git a/substrate/frame/atomic-swap/src/lib.rs b/substrate/frame/atomic-swap/src/lib.rs index bc3359e4e9bc0..fdc9c29bb1b65 100644 --- a/substrate/frame/atomic-swap/src/lib.rs +++ b/substrate/frame/atomic-swap/src/lib.rs @@ -61,7 +61,7 @@ use scale_info::TypeInfo; Clone, Eq, PartialEq, - RuntimeDebugNoBound, + DebugNoBound, Encode, Decode, DecodeWithMemTracking, @@ -103,15 +103,7 @@ pub trait SwapAction { /// A swap action that only allows transferring balances. #[derive( - Clone, - RuntimeDebug, - Eq, - PartialEq, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - MaxEncodedLen, + Clone, Debug, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, TypeInfo, MaxEncodedLen, )] #[scale_info(skip_type_params(C))] #[codec(mel_bound())] diff --git a/substrate/frame/bags-list/src/list/mod.rs b/substrate/frame/bags-list/src/list/mod.rs index e32908b0630ac..648ad2b30c48a 100644 --- a/substrate/frame/bags-list/src/list/mod.rs +++ b/substrate/frame/bags-list/src/list/mod.rs @@ -35,7 +35,7 @@ use frame_election_provider_support::ScoreProvider; use frame_support::{ defensive, ensure, traits::{Defensive, DefensiveOption, Get}, - CloneNoBound, DefaultNoBound, EqNoBound, PalletError, PartialEqNoBound, RuntimeDebugNoBound, + CloneNoBound, DebugNoBound, DefaultNoBound, EqNoBound, PalletError, PartialEqNoBound, }; use scale_info::TypeInfo; use sp_runtime::traits::{Bounded, Zero}; @@ -643,7 +643,7 @@ impl, I: 'static> List { Decode, MaxEncodedLen, TypeInfo, - RuntimeDebugNoBound, + DebugNoBound, CloneNoBound, PartialEqNoBound, EqNoBound, @@ -847,14 +847,7 @@ impl, I: 'static> Bag { /// A Node is the fundamental element comprising the doubly-linked list described by `Bag`. #[derive( - Encode, - Decode, - MaxEncodedLen, - TypeInfo, - CloneNoBound, - PartialEqNoBound, - EqNoBound, - RuntimeDebugNoBound, + Encode, Decode, MaxEncodedLen, TypeInfo, CloneNoBound, PartialEqNoBound, EqNoBound, DebugNoBound, )] #[codec(mel_bound())] #[scale_info(skip_type_params(T, I))] diff --git a/substrate/frame/balances/src/impl_currency.rs b/substrate/frame/balances/src/impl_currency.rs index f0558d26f94a5..fa35f207c9030 100644 --- a/substrate/frame/balances/src/impl_currency.rs +++ b/substrate/frame/balances/src/impl_currency.rs @@ -46,7 +46,7 @@ mod imbalances { /// Opaque, move-only struct with private fields that serves as a token denoting that /// funds have been created without any equal and opposite accounting. #[must_use] - #[derive(RuntimeDebug, PartialEq, Eq)] + #[derive(Debug, PartialEq, Eq)] pub struct PositiveImbalance, I: 'static = ()>(T::Balance); impl, I: 'static> PositiveImbalance { @@ -59,7 +59,7 @@ mod imbalances { /// Opaque, move-only struct with private fields that serves as a token denoting that /// funds have been destroyed without any equal and opposite accounting. #[must_use] - #[derive(RuntimeDebug, PartialEq, Eq)] + #[derive(Debug, PartialEq, Eq)] pub struct NegativeImbalance, I: 'static = ()>(T::Balance); impl, I: 'static> NegativeImbalance { diff --git a/substrate/frame/balances/src/lib.rs b/substrate/frame/balances/src/lib.rs index ebdb70f83dace..0342b3d958a9e 100644 --- a/substrate/frame/balances/src/lib.rs +++ b/substrate/frame/balances/src/lib.rs @@ -183,7 +183,7 @@ use sp_runtime::{ AtLeast32BitUnsigned, CheckedAdd, CheckedSub, MaybeSerializeDeserialize, Saturating, StaticLookup, Zero, }, - ArithmeticError, DispatchError, FixedPointOperand, Perbill, RuntimeDebug, TokenError, + ArithmeticError, DispatchError, FixedPointOperand, Perbill, TokenError, }; pub use types::{ @@ -428,7 +428,7 @@ pub mod pallet { /// Defensive/unexpected errors/events. /// /// In case of observation in explorers, report it as an issue in polkadot-sdk. - #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, RuntimeDebug)] + #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, Debug)] pub enum UnexpectedKind { /// Balance was altered/dusted during an operation that should have NOT done so. BalanceUpdated, diff --git a/substrate/frame/balances/src/tests/mod.rs b/substrate/frame/balances/src/tests/mod.rs index 155f78884d122..1c31d3b0cfe49 100644 --- a/substrate/frame/balances/src/tests/mod.rs +++ b/substrate/frame/balances/src/tests/mod.rs @@ -41,7 +41,7 @@ use sp_core::{hexdisplay::HexDisplay, sr25519::Pair as SrPair, Pair}; use sp_io; use sp_runtime::{ traits::{BadOrigin, Zero}, - ArithmeticError, BuildStorage, DispatchError, DispatchResult, FixedPointNumber, RuntimeDebug, + ArithmeticError, BuildStorage, Debug, DispatchError, DispatchResult, FixedPointNumber, TokenError, }; use std::collections::BTreeSet; @@ -69,7 +69,7 @@ type Block = frame_system::mocking::MockBlock; PartialOrd, MaxEncodedLen, TypeInfo, - RuntimeDebug, + Debug, )] pub enum TestId { Foo, diff --git a/substrate/frame/balances/src/types.rs b/substrate/frame/balances/src/types.rs index 9157217c19fb6..f8f3e36e191d9 100644 --- a/substrate/frame/balances/src/types.rs +++ b/substrate/frame/balances/src/types.rs @@ -22,7 +22,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::ops::BitOr; use frame_support::traits::{Imbalance, LockIdentifier, OnUnbalanced, WithdrawReasons}; use scale_info::TypeInfo; -use sp_runtime::{RuntimeDebug, Saturating}; +use sp_runtime::Saturating; /// Simplified reasons for withdrawing balance. #[derive( @@ -33,7 +33,7 @@ use sp_runtime::{RuntimeDebug, Saturating}; Copy, PartialEq, Eq, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, )] @@ -71,15 +71,7 @@ impl BitOr for Reasons { /// A single lock on a balance. There can be many of these on an account and they "overlap", so the /// same balance is frozen by multiple locks. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - MaxEncodedLen, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, MaxEncodedLen, TypeInfo, )] pub struct BalanceLock { /// An identifier for this lock. Only one lock may be in existence for each identifier. @@ -92,15 +84,7 @@ pub struct BalanceLock { /// Store named reserved balance. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - MaxEncodedLen, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, MaxEncodedLen, TypeInfo, )] pub struct ReserveData { /// The identifier for the named reserve. @@ -118,7 +102,7 @@ pub struct ReserveData { PartialEq, Eq, Default, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, )] @@ -144,15 +128,7 @@ pub struct AccountData { const IS_NEW_LOGIC: u128 = 0x80000000_00000000_00000000_00000000u128; #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - MaxEncodedLen, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, MaxEncodedLen, TypeInfo, )] pub struct ExtraFlags(pub(crate) u128); impl Default for ExtraFlags { @@ -198,15 +174,7 @@ impl, I: 'static> Drop for DustCleaner { /// Whether something should be interpreted as an increase or a decrease. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - MaxEncodedLen, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, MaxEncodedLen, TypeInfo, )] pub enum AdjustmentDirection { /// Increase the amount. diff --git a/substrate/frame/bounties/src/lib.rs b/substrate/frame/bounties/src/lib.rs index 42b52d062d7a7..323ad3db72b82 100644 --- a/substrate/frame/bounties/src/lib.rs +++ b/substrate/frame/bounties/src/lib.rs @@ -100,7 +100,7 @@ use frame_support::traits::{ use sp_runtime::{ traits::{AccountIdConversion, BadOrigin, BlockNumberProvider, Saturating, StaticLookup, Zero}, - DispatchResult, Permill, RuntimeDebug, + Debug, DispatchResult, Permill, }; use frame_support::{dispatch::DispatchResultWithPostInfo, traits::EnsureOrigin}; @@ -128,15 +128,7 @@ type BlockNumberFor = /// A bounty proposal. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, )] pub struct Bounty { /// The account proposing it. @@ -164,15 +156,7 @@ impl /// The status of a bounty proposal. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, )] pub enum BountyStatus { /// The bounty is proposed and waiting for approval. diff --git a/substrate/frame/broker/src/adapt_price.rs b/substrate/frame/broker/src/adapt_price.rs index 47823b3c09193..737f6a57582ad 100644 --- a/substrate/frame/broker/src/adapt_price.rs +++ b/substrate/frame/broker/src/adapt_price.rs @@ -19,7 +19,7 @@ use crate::{CoreIndex, SaleInfoRecord}; use sp_arithmetic::{traits::One, FixedU64}; -use sp_core::{Get, RuntimeDebug}; +use sp_core::Get; use sp_runtime::{FixedPointNumber, FixedPointOperand, Saturating}; /// Performance of a past sale. @@ -44,7 +44,7 @@ pub struct SalePerformance { } /// Result of `AdaptPrice::adapt_price`. -#[derive(Copy, Clone, RuntimeDebug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] pub struct AdaptedPrices { /// New minimum price to use. pub end_price: Balance, diff --git a/substrate/frame/broker/src/core_mask.rs b/substrate/frame/broker/src/core_mask.rs index 0ce3186b916dd..07b5c1e165942 100644 --- a/substrate/frame/broker/src/core_mask.rs +++ b/substrate/frame/broker/src/core_mask.rs @@ -18,7 +18,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not}; use scale_info::TypeInfo; -use sp_core::RuntimeDebug; +use Debug; /// The number of bits in the `CoreMask`. pub const CORE_MASK_BITS: usize = 80; @@ -33,7 +33,7 @@ pub const CORE_MASK_BITS: usize = 80; Clone, PartialEq, Eq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] diff --git a/substrate/frame/broker/src/coretime_interface.rs b/substrate/frame/broker/src/coretime_interface.rs index a78efb0e20852..661a070a37ee4 100644 --- a/substrate/frame/broker/src/coretime_interface.rs +++ b/substrate/frame/broker/src/coretime_interface.rs @@ -23,7 +23,6 @@ use core::fmt::Debug; use frame_support::Parameter; use scale_info::TypeInfo; use sp_arithmetic::traits::AtLeast32BitUnsigned; -use sp_core::RuntimeDebug; use sp_runtime::traits::BlockNumberProvider; use crate::Timeslice; @@ -47,7 +46,7 @@ pub type PartsOf57600 = u16; PartialEq, Ord, PartialOrd, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] diff --git a/substrate/frame/broker/src/migration.rs b/substrate/frame/broker/src/migration.rs index f19b1e19bdd17..2614e5d43ffdf 100644 --- a/substrate/frame/broker/src/migration.rs +++ b/substrate/frame/broker/src/migration.rs @@ -132,7 +132,7 @@ mod v3 { use super::*; use codec::MaxEncodedLen; use frame_support::{ - pallet_prelude::{OptionQuery, RuntimeDebug, TypeInfo}, + pallet_prelude::{Debug, OptionQuery, TypeInfo}, storage_alias, }; use frame_system::Pallet as System; @@ -169,7 +169,7 @@ mod v3 { ConfigRecord, RelayBlockNumberOf>; // types added here for v4 migration - #[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] + #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct ConfigRecord { /// The number of Relay-chain blocks in advance which scheduling should be fixed and the /// `Coretime::assign` API used to inform the Relay-chain. @@ -198,7 +198,7 @@ mod v3 { SaleInfoRecord, frame_system::pallet_prelude::BlockNumberFor>; /// The status of a Bulk Coretime Sale. - #[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] + #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct SaleInfoRecord { /// The relay block number at which the sale will/did start. pub sale_start: BlockNumber, diff --git a/substrate/frame/broker/src/types.rs b/substrate/frame/broker/src/types.rs index ca53fd57b5bf4..208c36c23a321 100644 --- a/substrate/frame/broker/src/types.rs +++ b/substrate/frame/broker/src/types.rs @@ -24,7 +24,7 @@ use frame_support::traits::fungible::Inspect; use frame_system::Config as SConfig; use scale_info::TypeInfo; use sp_arithmetic::Perbill; -use sp_core::{ConstU32, RuntimeDebug}; +use sp_core::ConstU32; use sp_runtime::BoundedVec; pub type BalanceOf = <::Currency as Inspect<::AccountId>>::Balance; @@ -50,7 +50,7 @@ pub type SignedCoreMaskBitCount = i32; Clone, PartialEq, Eq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -70,7 +70,7 @@ pub enum Finality { Clone, PartialEq, Eq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -101,7 +101,7 @@ fn region_id_converts_u128() { } /// The rest of the information describing a Region. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct RegionRecord { /// The end of the Region. pub end: Timeslice, @@ -114,15 +114,7 @@ pub type RegionRecordOf = RegionRecord<::AccountId, BalanceOf /// The record body of a Region which was contributed to the Instantaneous Coretime Pool. This helps /// with making pro rata payments to contributors. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct ContributionRecord { /// The end of the Region contributed. pub length: Timeslice, @@ -145,7 +137,7 @@ pub type ContributionRecordOf = ContributionRecord<::AccountId> /// A per-timeslice bookkeeping record for tracking Instantaneous Coretime Pool activity and /// making proper payments to contributors. -#[derive(Encode, Decode, Clone, Default, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, Default, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct InstaPoolHistoryRecord { /// The total amount of Coretime (measured in Core Mask Bits minus any contributions which have /// already been paid out. @@ -160,7 +152,7 @@ pub struct InstaPoolHistoryRecord { pub type InstaPoolHistoryRecordOf = InstaPoolHistoryRecord>; /// How much of a core has been assigned or, if completely assigned, the workload itself. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub enum CompletionStatus { /// The core is not fully assigned; the inner is the parts which have. Partial(CoreMask), @@ -185,7 +177,7 @@ impl CompletionStatus { } /// The identity of a possibly renewable Core workload. -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct PotentialRenewalId { /// The core whose workload at the sale ending with `when` may be renewed to begin at `when`. pub core: CoreIndex, @@ -197,7 +189,7 @@ pub struct PotentialRenewalId { /// /// The renewal will only actually be allowed if `CompletionStatus` is `Complete` at the time of /// renewal. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct PotentialRenewalRecord { /// The price for which the next renewal can be made. pub price: Balance, @@ -208,7 +200,7 @@ pub struct PotentialRenewalRecord { pub type PotentialRenewalRecordOf = PotentialRenewalRecord>; /// General status of the system. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct StatusRecord { /// The total number of cores which can be assigned (one plus the maximum index which can /// be used in `Coretime::assign`). @@ -226,9 +218,7 @@ pub struct StatusRecord { } /// A record of flux in the InstaPool. -#[derive( - Encode, Decode, Clone, Copy, Default, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen, -)] +#[derive(Encode, Decode, Clone, Copy, Default, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct PoolIoRecord { /// The total change of the portion of the pool supplied by purchased Bulk Coretime, measured /// in Core Mask Bits. @@ -239,7 +229,7 @@ pub struct PoolIoRecord { } /// The status of a Bulk Coretime Sale. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct SaleInfoRecord { /// The relay block number at which the sale will/did start. pub sale_start: RelayBlockNumber, @@ -275,7 +265,7 @@ pub type ReservationsRecord = BoundedVec; pub type ReservationsRecordOf = ReservationsRecord<::MaxReservedCores>; /// Information on a single legacy lease. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct LeaseRecordItem { /// The timeslice until the lease is valid. pub until: Timeslice, @@ -292,15 +282,7 @@ pub type LeasesRecordOf = LeasesRecord<::MaxLeasedCores>; /// The blocknumber is the relay chain block height `until` which the original request /// for revenue was made. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, )] pub struct OnDemandRevenueRecord { /// The height of the Relay-chain at the time the revenue request was made. @@ -314,15 +296,7 @@ pub type OnDemandRevenueRecordOf = /// Configuration of this pallet. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, )] pub struct ConfigRecord { /// The number of Relay-chain blocks in advance which scheduling should be fixed and the @@ -365,7 +339,7 @@ where } /// A record containing information regarding auto-renewal for a specific core. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct AutoRenewalRecord { /// The core for which auto renewal is enabled. pub core: CoreIndex, diff --git a/substrate/frame/child-bounties/src/lib.rs b/substrate/frame/child-bounties/src/lib.rs index 1ac1a2bdd5f05..0053c72e1a791 100644 --- a/substrate/frame/child-bounties/src/lib.rs +++ b/substrate/frame/child-bounties/src/lib.rs @@ -75,7 +75,7 @@ use sp_runtime::{ AccountIdConversion, BadOrigin, BlockNumberProvider, CheckedSub, Saturating, StaticLookup, Zero, }, - DispatchResult, RuntimeDebug, + Debug, DispatchResult, }; use frame_support::pallet_prelude::*; @@ -96,7 +96,7 @@ pub type BlockNumberFor = <::BlockNumberProvider as BlockNumberProvider>::BlockNumber; /// A child bounty proposal. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct ChildBounty { /// The parent of this child-bounty. pub parent_bounty: BountyIndex, @@ -111,7 +111,7 @@ pub struct ChildBounty { } /// The status of a child-bounty. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub enum ChildBountyStatus { /// The child-bounty is added and waiting for curator assignment. Added, diff --git a/substrate/frame/collective/src/lib.rs b/substrate/frame/collective/src/lib.rs index 54144836f1708..019292ad2ecd5 100644 --- a/substrate/frame/collective/src/lib.rs +++ b/substrate/frame/collective/src/lib.rs @@ -50,7 +50,7 @@ use scale_info::TypeInfo; use sp_io::storage; use sp_runtime::{ traits::{Dispatchable, Hash}, - DispatchError, RuntimeDebug, + Debug, DispatchError, }; use frame_support::{ @@ -138,15 +138,7 @@ impl DefaultVote for MoreThanMajorityThenPrimeDefaultVote { /// Origin for the collective module. #[derive( - PartialEq, - Eq, - Clone, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - MaxEncodedLen, + PartialEq, Eq, Clone, Debug, Encode, Decode, DecodeWithMemTracking, TypeInfo, MaxEncodedLen, )] #[scale_info(skip_type_params(I))] #[codec(mel_bound(AccountId: MaxEncodedLen))] @@ -169,7 +161,7 @@ impl GetBacking for RawOrigin { } /// Info for keeping track of a motion being voted on. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo)] pub struct Votes { /// The proposal's unique index. index: ProposalIndex, diff --git a/substrate/frame/contracts/src/exec.rs b/substrate/frame/contracts/src/exec.rs index 2f8ca721fe763..d9060b75c2c83 100644 --- a/substrate/frame/contracts/src/exec.rs +++ b/substrate/frame/contracts/src/exec.rs @@ -405,7 +405,7 @@ pub trait Ext: sealing::Sealed { Clone, PartialEq, Eq, - sp_core::RuntimeDebug, + Debug, codec::Decode, codec::Encode, codec::MaxEncodedLen, diff --git a/substrate/frame/contracts/src/lib.rs b/substrate/frame/contracts/src/lib.rs index 152b89853ed68..a7b810574b452 100644 --- a/substrate/frame/contracts/src/lib.rs +++ b/substrate/frame/contracts/src/lib.rs @@ -127,7 +127,7 @@ use frame_support::{ ConstU32, Contains, Get, Randomness, Time, }, weights::{Weight, WeightMeter}, - BoundedVec, DefaultNoBound, RuntimeDebugNoBound, + BoundedVec, DebugNoBound, DefaultNoBound, }; use frame_system::{ ensure_signed, @@ -138,7 +138,7 @@ use scale_info::TypeInfo; use smallvec::Array; use sp_runtime::{ traits::{BadOrigin, Convert, Dispatchable, Saturating, StaticLookup, Zero}, - DispatchError, RuntimeDebug, + DispatchError, }; pub use crate::{ @@ -1383,9 +1383,7 @@ pub mod pallet { } /// The type of origins supported by the contracts pallet. -#[derive( - Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, RuntimeDebugNoBound, -)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, DebugNoBound)] pub enum Origin { Root, Signed(T::AccountId), @@ -1443,7 +1441,7 @@ struct InstantiateInput { /// Determines whether events should be collected during execution. #[derive( - Copy, Clone, PartialEq, Eq, RuntimeDebug, Decode, Encode, MaxEncodedLen, scale_info::TypeInfo, + Copy, Clone, PartialEq, Eq, Debug, Decode, Encode, MaxEncodedLen, scale_info::TypeInfo, )] pub enum CollectEvents { /// Collect events. @@ -1461,7 +1459,7 @@ pub enum CollectEvents { /// Determines whether debug messages will be collected. #[derive( - Copy, Clone, PartialEq, Eq, RuntimeDebug, Decode, Encode, MaxEncodedLen, scale_info::TypeInfo, + Copy, Clone, PartialEq, Eq, Debug, Decode, Encode, MaxEncodedLen, scale_info::TypeInfo, )] pub enum DebugInfo { /// Collect debug messages. diff --git a/substrate/frame/contracts/src/migration/v10.rs b/substrate/frame/contracts/src/migration/v10.rs index 23e7fd238bb7c..1d43d2630447c 100644 --- a/substrate/frame/contracts/src/migration/v10.rs +++ b/substrate/frame/contracts/src/migration/v10.rs @@ -57,7 +57,7 @@ mod v9 { ::AccountId, >>::Balance; - #[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] + #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T, OldCurrency))] pub struct ContractInfo where @@ -100,7 +100,7 @@ pub fn store_old_contract_info( v9::ContractInfoOf::::insert(account, info); } -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebugNoBound, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, DebugNoBound, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub struct DepositAccount(AccountIdOf); @@ -112,7 +112,7 @@ impl Deref for DepositAccount { } } -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T, OldCurrency))] pub struct ContractInfo where diff --git a/substrate/frame/contracts/src/migration/v13.rs b/substrate/frame/contracts/src/migration/v13.rs index d1888b338dac7..3da763e4d540c 100644 --- a/substrate/frame/contracts/src/migration/v13.rs +++ b/substrate/frame/contracts/src/migration/v13.rs @@ -30,7 +30,7 @@ use sp_runtime::BoundedBTreeMap; mod v12 { use super::*; - #[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] + #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub struct ContractInfo { pub trie_id: TrieId, @@ -75,7 +75,7 @@ pub fn store_old_contract_info(account: T::AccountId, info: crate::Co pub type ContractInfoOf = StorageMap, Twox64Concat, ::AccountId, ContractInfo>; -#[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub struct ContractInfo { trie_id: TrieId, diff --git a/substrate/frame/contracts/src/migration/v15.rs b/substrate/frame/contracts/src/migration/v15.rs index 11f07282d5614..de1d94ba1c3c5 100644 --- a/substrate/frame/contracts/src/migration/v15.rs +++ b/substrate/frame/contracts/src/migration/v15.rs @@ -50,9 +50,7 @@ use sp_runtime::{traits::Zero, Saturating}; mod v14 { use super::*; - #[derive( - Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen, - )] + #[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub struct ContractInfo { pub trie_id: TrieId, @@ -96,7 +94,7 @@ pub fn store_old_contract_info(account: T::AccountId, info: crate::Co v14::ContractInfoOf::::insert(account, info); } -#[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] struct ContractInfo { pub trie_id: TrieId, diff --git a/substrate/frame/contracts/src/migration/v16.rs b/substrate/frame/contracts/src/migration/v16.rs index 3d5b2d2a85fcd..e6b49ad21e4cc 100644 --- a/substrate/frame/contracts/src/migration/v16.rs +++ b/substrate/frame/contracts/src/migration/v16.rs @@ -54,7 +54,7 @@ pub fn store_old_contract_info( pub type ContractInfoOf = StorageMap, Twox64Concat, ::AccountId, ContractInfo>; -#[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub struct ContractInfo { trie_id: TrieId, diff --git a/substrate/frame/contracts/src/primitives.rs b/substrate/frame/contracts/src/primitives.rs index 622a69f529fb5..5501826636591 100644 --- a/substrate/frame/contracts/src/primitives.rs +++ b/substrate/frame/contracts/src/primitives.rs @@ -24,7 +24,7 @@ use pallet_contracts_uapi::ReturnFlags; use scale_info::TypeInfo; use sp_runtime::{ traits::{Saturating, Zero}, - DispatchError, RuntimeDebug, + Debug, DispatchError, }; /// Result type of a `bare_call` or `bare_instantiate` call as well as `ContractsApi::call` and @@ -37,7 +37,7 @@ use sp_runtime::{ /// It has been extended to include `events` at the end of the struct while not bumping the /// `ContractsApi` version. Therefore when SCALE decoding a `ContractResult` its trailing data /// should be ignored to avoid any potential compatibility issues. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] pub struct ContractResult { /// How much weight was consumed during execution. pub gas_consumed: Weight, @@ -97,7 +97,7 @@ pub type CodeUploadResult = pub type GetStorageResult = Result>, ContractAccessError>; /// The possible errors that can happen querying the storage of a contract. -#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo)] +#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, MaxEncodedLen, Debug, TypeInfo)] pub enum ContractAccessError { /// The given address doesn't point to a contract. DoesntExist, @@ -108,7 +108,7 @@ pub enum ContractAccessError { } /// Output of a contract call or instantiation which ran to completion. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug, TypeInfo)] pub struct ExecReturnValue { /// Flags passed along by `seal_return`. Empty when `seal_return` was never called. pub flags: ReturnFlags, @@ -124,7 +124,7 @@ impl ExecReturnValue { } /// The result of a successful contract instantiation. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug, TypeInfo)] pub struct InstantiateReturnValue { /// The output of the called constructor. pub result: ExecReturnValue, @@ -133,7 +133,7 @@ pub struct InstantiateReturnValue { } /// The result of successfully uploading a contract. -#[derive(Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen, Debug, TypeInfo)] pub struct CodeUploadReturnValue { /// The key under which the new code is stored. pub code_hash: CodeHash, @@ -142,7 +142,7 @@ pub struct CodeUploadReturnValue { } /// Reference to an existing code hash or a new wasm module. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] pub enum Code { /// A wasm module as raw bytes. Upload(Vec), @@ -151,9 +151,7 @@ pub enum Code { } /// The amount of balance that was either charged or refunded in order to pay for storage. -#[derive( - Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo, -)] +#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, MaxEncodedLen, Debug, TypeInfo)] pub enum StorageDeposit { /// The transaction reduced storage consumption. /// diff --git a/substrate/frame/contracts/src/storage.rs b/substrate/frame/contracts/src/storage.rs index 4f643266df7b0..4c64857366eb8 100644 --- a/substrate/frame/contracts/src/storage.rs +++ b/substrate/frame/contracts/src/storage.rs @@ -38,14 +38,14 @@ use sp_core::Get; use sp_io::KillStorageResult; use sp_runtime::{ traits::{Hash, Saturating, Zero}, - BoundedBTreeMap, DispatchError, DispatchResult, RuntimeDebug, + BoundedBTreeMap, Debug, DispatchError, DispatchResult, }; use self::meter::Diff; /// Information for managing an account and its sub trie abstraction. /// This is the required info to cache for an account. -#[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub struct ContractInfo { /// Unique ID for the subtree encoded as a bytes vector. diff --git a/substrate/frame/contracts/src/storage/meter.rs b/substrate/frame/contracts/src/storage/meter.rs index 951cb25994e1f..f95207227a091 100644 --- a/substrate/frame/contracts/src/storage/meter.rs +++ b/substrate/frame/contracts/src/storage/meter.rs @@ -33,7 +33,7 @@ use frame_support::{ }, Get, }, - DefaultNoBound, RuntimeDebugNoBound, + DebugNoBound, DefaultNoBound, }; use sp_runtime::{ traits::{Saturating, Zero}, @@ -105,7 +105,7 @@ pub struct Root; /// State parameter that constitutes a meter that is in its nested state. /// Its value indicates whether the nested meter has its own limit. -#[derive(DefaultNoBound, RuntimeDebugNoBound)] +#[derive(DefaultNoBound, DebugNoBound)] pub enum Nested { #[default] DerivedLimit, @@ -116,7 +116,7 @@ impl State for Root {} impl State for Nested {} /// A type that allows the metering of consumed or freed storage of a single contract call stack. -#[derive(DefaultNoBound, RuntimeDebugNoBound)] +#[derive(DefaultNoBound, DebugNoBound)] pub struct RawMeter { /// The limit of how much balance this meter is allowed to consume. limit: BalanceOf, @@ -136,7 +136,7 @@ pub struct RawMeter { } /// This type is used to describe a storage change when charging from the meter. -#[derive(Default, RuntimeDebugNoBound)] +#[derive(Default, DebugNoBound)] pub struct Diff { /// How many bytes were added to storage. pub bytes_added: u32, @@ -224,7 +224,7 @@ impl Diff { /// The state of a contract. /// /// In case of termination the beneficiary is indicated. -#[derive(RuntimeDebugNoBound, Clone, PartialEq, Eq)] +#[derive(DebugNoBound, Clone, PartialEq, Eq)] pub enum ContractState { Alive, Terminated { beneficiary: AccountIdOf }, @@ -239,7 +239,7 @@ pub enum ContractState { /// The only exception is when a special (tougher) deposit limit is specified for a cross-contract /// call. In that case the limit is enforced once the call is returned, rolling it back if /// exhausted. -#[derive(RuntimeDebugNoBound, Clone)] +#[derive(DebugNoBound, Clone)] struct Charge { contract: T::AccountId, amount: DepositOf, @@ -247,7 +247,7 @@ struct Charge { } /// Records the storage changes of a storage meter. -#[derive(RuntimeDebugNoBound)] +#[derive(DebugNoBound)] enum Contribution { /// The contract the meter belongs to is alive and accumulates changes using a [`Diff`]. Alive(Diff), diff --git a/substrate/frame/contracts/src/wasm/mod.rs b/substrate/frame/contracts/src/wasm/mod.rs index 399ed1ccded75..7c39c3ae25827 100644 --- a/substrate/frame/contracts/src/wasm/mod.rs +++ b/substrate/frame/contracts/src/wasm/mod.rs @@ -56,7 +56,7 @@ use frame_support::{ traits::{fungible::MutateHold, tokens::Precision::BestEffort}, }; use sp_core::Get; -use sp_runtime::{DispatchError, RuntimeDebug}; +use sp_runtime::DispatchError; use wasmi::{CompilationMode, InstancePre, Linker, Memory, MemoryType, StackLimits, Store}; const BYTES_PER_PAGE: usize = 64 * 1024; @@ -113,7 +113,7 @@ pub struct CodeInfo { DecodeWithMemTracking, scale_info::TypeInfo, MaxEncodedLen, - RuntimeDebug, + Debug, PartialEq, Eq, )] diff --git a/substrate/frame/contracts/src/wasm/runtime.rs b/substrate/frame/contracts/src/wasm/runtime.rs index 39f846ac43197..a87ee2202660e 100644 --- a/substrate/frame/contracts/src/wasm/runtime.rs +++ b/substrate/frame/contracts/src/wasm/runtime.rs @@ -36,7 +36,7 @@ use pallet_contracts_uapi::{CallFlags, ReturnFlags}; use sp_io::hashing::{blake2_128, blake2_256, keccak_256, sha2_256}; use sp_runtime::{ traits::{Bounded, Zero}, - DispatchError, RuntimeDebug, + Debug, DispatchError, }; use wasmi::{core::HostError, errors::LinkerError, Linker, Memory, Store}; @@ -103,7 +103,7 @@ impl From for ReturnErrorCode { } /// The data passed through when a contract uses `seal_return`. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct ReturnData { /// The flags as passed through by the contract. They are still unchecked and /// will later be parsed into a `ReturnFlags` bitflags struct. @@ -118,7 +118,7 @@ pub struct ReturnData { /// occurred (the SupervisorError variant). /// The other case is where the trap does not constitute an error but rather was invoked /// as a quick way to terminate the application (all other variants). -#[derive(RuntimeDebug)] +#[derive(Debug)] pub enum TrapReason { /// The supervisor trapped the contract because of an error condition occurred during /// execution in privileged code. diff --git a/substrate/frame/conviction-voting/src/conviction.rs b/substrate/frame/conviction-voting/src/conviction.rs index 4332c8e4a0a7c..72e64603f511b 100644 --- a/substrate/frame/conviction-voting/src/conviction.rs +++ b/substrate/frame/conviction-voting/src/conviction.rs @@ -21,7 +21,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::{ traits::{Bounded, CheckedDiv, CheckedMul, Zero}, - RuntimeDebug, + Debug, }; use crate::types::Delegations; @@ -37,7 +37,7 @@ use crate::types::Delegations; PartialEq, Ord, PartialOrd, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] diff --git a/substrate/frame/conviction-voting/src/traits.rs b/substrate/frame/conviction-voting/src/traits.rs index 1e93c03b88237..6b493054c0e45 100644 --- a/substrate/frame/conviction-voting/src/traits.rs +++ b/substrate/frame/conviction-voting/src/traits.rs @@ -21,7 +21,7 @@ use crate::AccountVote; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use frame_support::dispatch::DispatchResult; use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; +use Debug; /// Represents the differents states of a referendum. #[derive( @@ -32,7 +32,7 @@ use sp_runtime::RuntimeDebug; Clone, Eq, PartialEq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] diff --git a/substrate/frame/conviction-voting/src/types.rs b/substrate/frame/conviction-voting/src/types.rs index 0100f0d38ab36..11ab98adebc25 100644 --- a/substrate/frame/conviction-voting/src/types.rs +++ b/substrate/frame/conviction-voting/src/types.rs @@ -19,14 +19,9 @@ use codec::{Codec, Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::{fmt::Debug, marker::PhantomData}; -use frame_support::{ - traits::VoteTally, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, -}; +use frame_support::{traits::VoteTally, CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound}; use scale_info::TypeInfo; -use sp_runtime::{ - traits::{Saturating, Zero}, - RuntimeDebug, -}; +use sp_runtime::traits::{Saturating, Zero}; use super::*; use crate::{AccountVote, Conviction, Vote}; @@ -36,7 +31,7 @@ use crate::{AccountVote, Conviction, Vote}; CloneNoBound, PartialEqNoBound, EqNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, Encode, Decode, @@ -222,7 +217,7 @@ impl< Clone, PartialEq, Eq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] diff --git a/substrate/frame/conviction-voting/src/vote.rs b/substrate/frame/conviction-voting/src/vote.rs index b408af3b473f2..419231f0b3ace 100644 --- a/substrate/frame/conviction-voting/src/vote.rs +++ b/substrate/frame/conviction-voting/src/vote.rs @@ -23,13 +23,11 @@ use frame_support::{pallet_prelude::Get, BoundedVec}; use scale_info::TypeInfo; use sp_runtime::{ traits::{Saturating, Zero}, - RuntimeDebug, + Debug, }; /// A number of lock periods, plus a vote, one way or the other. -#[derive( - DecodeWithMemTracking, Copy, Clone, Eq, PartialEq, Default, RuntimeDebug, MaxEncodedLen, -)] +#[derive(DecodeWithMemTracking, Copy, Clone, Eq, PartialEq, Default, Debug, MaxEncodedLen)] pub struct Vote { pub aye: bool, pub conviction: Conviction, @@ -76,7 +74,7 @@ impl TypeInfo for Vote { Clone, Eq, PartialEq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -93,7 +91,7 @@ pub enum AccountVote { } /// Present the conditions under which an account's Funds are locked after a voting action. -#[derive(Copy, Clone, Eq, PartialEq, RuntimeDebug)] +#[derive(Copy, Clone, Eq, PartialEq, Debug)] pub enum LockedIf { /// Lock the funds if the outcome of the referendum matches the voting behavior of the user. /// @@ -159,7 +157,7 @@ impl AccountVote { PartialEq, Ord, PartialOrd, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -186,15 +184,7 @@ impl PriorLock { /// The amount of balance delegated. @@ -212,15 +202,7 @@ pub struct Delegating { /// Information concerning the direct vote-casting of some voting power. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen, )] #[scale_info(skip_type_params(MaxVotes))] #[codec(mel_bound(Balance: MaxEncodedLen, BlockNumber: MaxEncodedLen, PollIndex: MaxEncodedLen))] @@ -238,15 +220,7 @@ where /// An indicator for what an account is doing; it can either be delegating or voting. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen, )] #[scale_info(skip_type_params(MaxVotes))] #[codec(mel_bound( diff --git a/substrate/frame/core-fellowship/src/lib.rs b/substrate/frame/core-fellowship/src/lib.rs index 2192ec61ceba4..8db762ec2194e 100644 --- a/substrate/frame/core-fellowship/src/lib.rs +++ b/substrate/frame/core-fellowship/src/lib.rs @@ -66,7 +66,6 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::{fmt::Debug, marker::PhantomData}; use scale_info::TypeInfo; use sp_arithmetic::traits::{Saturating, Zero}; -use sp_runtime::RuntimeDebug; use frame_support::{ defensive, @@ -76,7 +75,7 @@ use frame_support::{ tokens::Balance as BalanceTrait, EnsureOrigin, EnsureOriginWithArg, Get, RankedMembers, RankedMembersSwapHandler, }, - BoundedVec, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, + BoundedVec, CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound, }; #[cfg(test)] @@ -101,7 +100,7 @@ pub use weights::*; Clone, TypeInfo, MaxEncodedLen, - RuntimeDebug, + Debug, )] pub enum Wish { /// Member wishes only to retain their current rank. @@ -124,7 +123,7 @@ pub type Evidence = BoundedVec>::EvidenceSize>; CloneNoBound, EqNoBound, PartialEqNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, MaxEncodedLen, )] @@ -171,7 +170,7 @@ impl> Get for ConvertU16ToU32 { } /// The status of a single member. -#[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, RuntimeDebug)] +#[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, Debug)] pub struct MemberStatus { /// Are they currently active? is_active: bool, diff --git a/substrate/frame/core-fellowship/src/migration.rs b/substrate/frame/core-fellowship/src/migration.rs index 216523f0c7364..8e150f19fa718 100644 --- a/substrate/frame/core-fellowship/src/migration.rs +++ b/substrate/frame/core-fellowship/src/migration.rs @@ -34,7 +34,7 @@ mod v0 { use super::*; - #[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, RuntimeDebug)] + #[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, Debug)] pub struct ParamsType { pub active_salary: [Balance; RANKS], pub passive_salary: [Balance; RANKS], diff --git a/substrate/frame/delegated-staking/src/lib.rs b/substrate/frame/delegated-staking/src/lib.rs index e12b61d6ddd0c..cb41f8dd8b81d 100644 --- a/substrate/frame/delegated-staking/src/lib.rs +++ b/substrate/frame/delegated-staking/src/lib.rs @@ -156,7 +156,7 @@ use frame_support::{ use sp_io::hashing::blake2_256; use sp_runtime::{ traits::{CheckedAdd, CheckedSub, TrailingZeroInput, Zero}, - ArithmeticError, DispatchResult, Perbill, RuntimeDebug, Saturating, + ArithmeticError, Debug, DispatchResult, Perbill, Saturating, }; use sp_staking::{Agent, Delegator, EraIndex, StakingInterface, StakingUnchecked}; diff --git a/substrate/frame/delegated-staking/src/types.rs b/substrate/frame/delegated-staking/src/types.rs index 781df77e71682..fad44d40f209a 100644 --- a/substrate/frame/delegated-staking/src/types.rs +++ b/substrate/frame/delegated-staking/src/types.rs @@ -30,7 +30,7 @@ pub(crate) enum AccountType { } /// Information about delegation of a `delegator`. -#[derive(Default, Encode, Clone, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Default, Encode, Clone, Decode, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub struct Delegation { /// The target of delegation. @@ -90,7 +90,7 @@ impl Delegation { /// This keeps track of the active balance of the `Agent` that is made up from the funds that /// are currently delegated to this `Agent`. It also tracks the pending slashes yet to be /// applied among other things. -#[derive(Default, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Default, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub struct AgentLedger { /// Where the reward should be paid out. diff --git a/substrate/frame/democracy/src/conviction.rs b/substrate/frame/democracy/src/conviction.rs index 64c062ce9434c..1aa2b9316a0e7 100644 --- a/substrate/frame/democracy/src/conviction.rs +++ b/substrate/frame/democracy/src/conviction.rs @@ -23,7 +23,7 @@ use core::result::Result; use scale_info::TypeInfo; use sp_runtime::{ traits::{Bounded, CheckedDiv, CheckedMul, Zero}, - RuntimeDebug, + Debug, }; /// A value denoting the strength of conviction of a vote. @@ -38,7 +38,7 @@ use sp_runtime::{ PartialEq, Ord, PartialOrd, - RuntimeDebug, + Debug, TypeInfo, )] pub enum Conviction { diff --git a/substrate/frame/democracy/src/types.rs b/substrate/frame/democracy/src/types.rs index 99b806300f711..f5a66abfc32a1 100644 --- a/substrate/frame/democracy/src/types.rs +++ b/substrate/frame/democracy/src/types.rs @@ -22,7 +22,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::{ traits::{Bounded, CheckedAdd, CheckedDiv, CheckedMul, CheckedSub, Saturating, Zero}, - RuntimeDebug, + Debug, }; /// A proposal index. @@ -32,7 +32,7 @@ pub type PropIndex = u32; pub type ReferendumIndex = u32; /// Info regarding an ongoing referendum. -#[derive(Encode, MaxEncodedLen, Decode, Default, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, MaxEncodedLen, Decode, Default, Clone, PartialEq, Eq, Debug, TypeInfo)] pub struct Tally { /// The number of aye votes, expressed in terms of post-conviction lock-vote. pub ayes: Balance, @@ -43,9 +43,7 @@ pub struct Tally { } /// Amount of votes and capital placed in delegation for an account. -#[derive( - Encode, MaxEncodedLen, Decode, Default, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, -)] +#[derive(Encode, MaxEncodedLen, Decode, Default, Copy, Clone, PartialEq, Eq, Debug, TypeInfo)] pub struct Delegations { /// The number of votes (this is post-conviction). pub votes: Balance, @@ -169,15 +167,7 @@ impl< /// Info regarding an ongoing referendum. #[derive( - Encode, - MaxEncodedLen, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, + Encode, MaxEncodedLen, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo, )] pub struct ReferendumStatus { /// When voting on this referendum will end. @@ -194,15 +184,7 @@ pub struct ReferendumStatus { /// Info regarding a referendum, present or past. #[derive( - Encode, - MaxEncodedLen, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, + Encode, MaxEncodedLen, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo, )] pub enum ReferendumInfo { /// Referendum is happening, the arg is the block number at which it will end. @@ -235,15 +217,7 @@ pub enum UnvoteScope { /// Identifies an owner of a metadata. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, )] pub enum MetadataOwner { /// External proposal. diff --git a/substrate/frame/democracy/src/vote.rs b/substrate/frame/democracy/src/vote.rs index c1103d4da32e5..379363ff514f7 100644 --- a/substrate/frame/democracy/src/vote.rs +++ b/substrate/frame/democracy/src/vote.rs @@ -23,11 +23,11 @@ use frame_support::traits::Get; use scale_info::TypeInfo; use sp_runtime::{ traits::{Saturating, Zero}, - BoundedVec, RuntimeDebug, + BoundedVec, Debug, }; /// A number of lock periods, plus a vote, one way or the other. -#[derive(DecodeWithMemTracking, Copy, Clone, Eq, PartialEq, Default, RuntimeDebug)] +#[derive(DecodeWithMemTracking, Copy, Clone, Eq, PartialEq, Default, Debug)] pub struct Vote { pub aye: bool, pub conviction: Conviction, @@ -81,7 +81,7 @@ impl TypeInfo for Vote { Clone, Eq, PartialEq, - RuntimeDebug, + Debug, TypeInfo, )] pub enum AccountVote { @@ -134,7 +134,7 @@ impl AccountVote { PartialEq, Ord, PartialOrd, - RuntimeDebug, + Debug, TypeInfo, )] pub struct PriorLock(BlockNumber, Balance); @@ -159,7 +159,7 @@ impl PriorLock> { diff --git a/substrate/frame/democracy/src/vote_threshold.rs b/substrate/frame/democracy/src/vote_threshold.rs index 9e4e66897a06a..8611c2a08efcb 100644 --- a/substrate/frame/democracy/src/vote_threshold.rs +++ b/substrate/frame/democracy/src/vote_threshold.rs @@ -35,7 +35,7 @@ use sp_runtime::traits::{IntegerSquareRoot, Zero}; DecodeWithMemTracking, MaxEncodedLen, Decode, - sp_runtime::RuntimeDebug, + Debug, TypeInfo, )] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] diff --git a/substrate/frame/dummy-dim/src/lib.rs b/substrate/frame/dummy-dim/src/lib.rs index 1db32c7026c4e..1070cb2fa4dbb 100644 --- a/substrate/frame/dummy-dim/src/lib.rs +++ b/substrate/frame/dummy-dim/src/lib.rs @@ -70,15 +70,7 @@ pub mod pallet { /// The record of recognized people. #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - MaxEncodedLen, - TypeInfo, - DecodeWithMemTracking, + Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo, DecodeWithMemTracking, )] pub struct Record { /// The key of the person. diff --git a/substrate/frame/election-provider-multi-phase/src/lib.rs b/substrate/frame/election-provider-multi-phase/src/lib.rs index dd20da476aac8..356f10c309a0d 100644 --- a/substrate/frame/election-provider-multi-phase/src/lib.rs +++ b/substrate/frame/election-provider-multi-phase/src/lib.rs @@ -269,7 +269,7 @@ use sp_runtime::{ InvalidTransaction, TransactionPriority, TransactionSource, TransactionValidity, TransactionValidityError, ValidTransaction, }, - DispatchError, ModuleError, PerThing, Perbill, RuntimeDebug, SaturatedConversion, + Debug, DispatchError, ModuleError, PerThing, Perbill, SaturatedConversion, }; #[cfg(feature = "try-runtime")] @@ -427,16 +427,7 @@ impl Default for ElectionCompute { /// Such a solution should never become effective in anyway before being checked by the /// `Pallet::feasibility_check`. #[derive( - PartialEq, - Eq, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - RuntimeDebug, - PartialOrd, - Ord, - TypeInfo, + PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, Debug, PartialOrd, Ord, TypeInfo, )] pub struct RawSolution { /// the solution itself. @@ -456,14 +447,7 @@ impl Default for RawSolution { /// A checked solution, ready to be enacted. #[derive( - PartialEqNoBound, - EqNoBound, - Clone, - Encode, - Decode, - RuntimeDebug, - DefaultNoBound, - scale_info::TypeInfo, + PartialEqNoBound, EqNoBound, Clone, Encode, Decode, Debug, DefaultNoBound, scale_info::TypeInfo, )] #[scale_info(skip_type_params(AccountId, MaxWinners, MaxBackersPerWinner))] pub struct ReadySolution @@ -489,7 +473,7 @@ where /// [`ElectionDataProvider`] and are kept around until the round is finished. /// /// These are stored together because they are often accessed together. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, Default, TypeInfo)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, Default, TypeInfo)] #[scale_info(skip_type_params(T))] pub struct RoundSnapshot { /// All of the voters. diff --git a/substrate/frame/election-provider-multi-phase/src/signed.rs b/substrate/frame/election-provider-multi-phase/src/signed.rs index 5efe848c0e626..243c461811405 100644 --- a/substrate/frame/election-provider-multi-phase/src/signed.rs +++ b/substrate/frame/election-provider-multi-phase/src/signed.rs @@ -40,13 +40,13 @@ use sp_core::bounded::BoundedVec; use sp_npos_elections::ElectionScore; use sp_runtime::{ traits::{Convert, Saturating, Zero}, - FixedPointNumber, FixedPointOperand, FixedU128, Percent, RuntimeDebug, + Debug, FixedPointNumber, FixedPointOperand, FixedU128, Percent, }; /// A raw, unchecked signed submission. /// /// This is just a wrapper around [`RawSolution`] and some additional info. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, scale_info::TypeInfo)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, scale_info::TypeInfo)] pub struct SignedSubmission { /// Who submitted this solution. pub who: AccountId, diff --git a/substrate/frame/election-provider-support/src/lib.rs b/substrate/frame/election-provider-support/src/lib.rs index 86ded57e103ef..f9e8c7fbb9f9f 100644 --- a/substrate/frame/election-provider-support/src/lib.rs +++ b/substrate/frame/election-provider-support/src/lib.rs @@ -209,10 +209,7 @@ use alloc::{boxed::Box, vec::Vec}; use core::fmt::Debug; use frame_support::traits::{Defensive, DefensiveResult}; use sp_core::ConstU32; -use sp_runtime::{ - traits::{Bounded, Saturating, Zero}, - RuntimeDebug, -}; +use sp_runtime::traits::{Bounded, Saturating, Zero}; pub use bounds::DataProviderBounds; pub use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; @@ -275,7 +272,7 @@ pub type PageIndex = u32; /// The voter and target identifiers have already been replaced with appropriate indices, /// making it fast to repeatedly encode into a `SolutionOf`. This property turns out /// to be important when trimming for solution length. -#[derive(RuntimeDebug, Clone, Default)] +#[derive(Debug, Clone, Default)] #[cfg_attr(feature = "std", derive(PartialEq, Eq, Encode, Decode))] pub struct IndexAssignment { /// Index of the voter among the voters list. diff --git a/substrate/frame/elections-phragmen/src/lib.rs b/substrate/frame/elections-phragmen/src/lib.rs index 689c99f2a2f22..d284269445d98 100644 --- a/substrate/frame/elections-phragmen/src/lib.rs +++ b/substrate/frame/elections-phragmen/src/lib.rs @@ -116,7 +116,7 @@ use scale_info::TypeInfo; use sp_npos_elections::{ElectionResult, ExtendedBalance}; use sp_runtime::{ traits::{Saturating, StaticLookup, Zero}, - DispatchError, Perbill, RuntimeDebug, + Debug, DispatchError, Perbill, }; use sp_staking::currency_to_vote::CurrencyToVote; @@ -139,7 +139,7 @@ type NegativeImbalanceOf = <::Currency as Currency< >>::NegativeImbalance; /// An indication that the renouncing account currently has which of the below roles. -#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Debug, TypeInfo)] pub enum Renouncing { /// A member is renouncing. Member, @@ -150,7 +150,7 @@ pub enum Renouncing { } /// An active voter. -#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, TypeInfo)] +#[derive(Encode, Decode, Clone, Debug, PartialEq, TypeInfo)] pub struct Voter { /// The members being backed. pub votes: Vec, @@ -169,7 +169,7 @@ impl Default for Voter { } /// A holder of a seat as either a member or a runner-up. -#[derive(Encode, Decode, Clone, Default, RuntimeDebug, PartialEq, TypeInfo)] +#[derive(Encode, Decode, Clone, Default, Debug, PartialEq, TypeInfo)] pub struct SeatHolder { /// The holder. pub who: AccountId, diff --git a/substrate/frame/elections-phragmen/src/migrations/v3.rs b/substrate/frame/elections-phragmen/src/migrations/v3.rs index 82f82f23e712f..1fd1de16e5d12 100644 --- a/substrate/frame/elections-phragmen/src/migrations/v3.rs +++ b/substrate/frame/elections-phragmen/src/migrations/v3.rs @@ -24,16 +24,16 @@ use codec::{Decode, Encode, FullCodec}; use frame_support::{ pallet_prelude::ValueQuery, traits::StorageVersion, weights::Weight, Twox64Concat, }; -use sp_runtime::RuntimeDebug; +use Debug; -#[derive(Encode, Decode, Clone, Default, RuntimeDebug, PartialEq)] +#[derive(Encode, Decode, Clone, Default, Debug, PartialEq)] struct SeatHolder { who: AccountId, stake: Balance, deposit: Balance, } -#[derive(Encode, Decode, Clone, Default, RuntimeDebug, PartialEq)] +#[derive(Encode, Decode, Clone, Default, Debug, PartialEq)] struct Voter { votes: Vec, stake: Balance, diff --git a/substrate/frame/examples/authorization-tx-extension/src/lib.rs b/substrate/frame/examples/authorization-tx-extension/src/lib.rs index 8b878fcbf3c60..408ccf5786352 100644 --- a/substrate/frame/examples/authorization-tx-extension/src/lib.rs +++ b/substrate/frame/examples/authorization-tx-extension/src/lib.rs @@ -98,15 +98,7 @@ pub mod pallet_coownership { /// accounts that own something together. #[pallet::origin] #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, + Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, )] pub enum Origin { Coowners(T::AccountId, T::AccountId), @@ -120,7 +112,7 @@ pub mod pallet_assets { pub type AssetId = u32; /// Type that describes possible owners of a particular asset. - #[derive(Clone, PartialEq, Eq, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)] + #[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)] pub enum Owner { Single(AccountId), Double(AccountId, AccountId), diff --git a/substrate/frame/examples/offchain-worker/src/lib.rs b/substrate/frame/examples/offchain-worker/src/lib.rs index ee0a52eea4451..58a21a8395b4a 100644 --- a/substrate/frame/examples/offchain-worker/src/lib.rs +++ b/substrate/frame/examples/offchain-worker/src/lib.rs @@ -74,7 +74,7 @@ use sp_runtime::{ }, traits::Zero, transaction_validity::{InvalidTransaction, TransactionValidity, ValidTransaction}, - RuntimeDebug, + Debug, }; #[cfg(test)] @@ -181,7 +181,7 @@ pub mod pallet { /// You can use `Local Storage` API to coordinate runs of the worker. fn offchain_worker(block_number: BlockNumberFor) { // Note that having logs compiled to WASM may cause the size of the blob to increase - // significantly. You can use `RuntimeDebug` custom derive to hide details of the types + // significantly. You can use `Debug` custom derive to hide details of the types // in WASM. The `sp-api` crate also provides a feature `disable-logging` to disable // all logging and thus, remove any logging from the WASM. log::info!("Hello World from offchain workers!"); @@ -353,7 +353,7 @@ pub mod pallet { /// Payload used by this example crate to hold price /// data required to submit a transaction. #[derive( - Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, RuntimeDebug, scale_info::TypeInfo, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, scale_info::TypeInfo, )] pub struct PricePayload { block_number: BlockNumber, diff --git a/substrate/frame/examples/single-block-migrations/src/lib.rs b/substrate/frame/examples/single-block-migrations/src/lib.rs index e6983ee4d9af7..5bbc0a78dcfdd 100644 --- a/substrate/frame/examples/single-block-migrations/src/lib.rs +++ b/substrate/frame/examples/single-block-migrations/src/lib.rs @@ -167,14 +167,11 @@ extern crate alloc; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::traits::StorageVersion; -use sp_runtime::RuntimeDebug; /// Example struct holding the most recently set [`u32`] and the /// second most recently set [`u32`] (if one existed). #[docify::export] -#[derive( - Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, scale_info::TypeInfo, MaxEncodedLen, -)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, scale_info::TypeInfo, MaxEncodedLen)] pub struct CurrentAndPreviousValue { /// The most recently set value. pub current: u32, diff --git a/substrate/frame/executive/src/tests.rs b/substrate/frame/executive/src/tests.rs index 0569f8eb52bf0..97c54ff46f1a4 100644 --- a/substrate/frame/executive/src/tests.rs +++ b/substrate/frame/executive/src/tests.rs @@ -368,7 +368,7 @@ impl frame_system::Config for Runtime { PartialEq, MaxEncodedLen, TypeInfo, - RuntimeDebug, + Debug, )] pub enum FreezeReasonId { Foo, diff --git a/substrate/frame/fast-unstake/src/types.rs b/substrate/frame/fast-unstake/src/types.rs index 518840a16a303..61855eb73b6cb 100644 --- a/substrate/frame/fast-unstake/src/types.rs +++ b/substrate/frame/fast-unstake/src/types.rs @@ -20,7 +20,7 @@ use crate::Config; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{ - traits::Currency, BoundedVec, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, + traits::Currency, BoundedVec, CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound, }; use scale_info::TypeInfo; use sp_staking::{EraIndex, StakingInterface}; @@ -46,14 +46,7 @@ pub type BalanceOf = /// This is stored in [`crate::Head`] storage item and points to the current unstake request that is /// being processed. #[derive( - Encode, - Decode, - EqNoBound, - PartialEqNoBound, - CloneNoBound, - TypeInfo, - RuntimeDebugNoBound, - MaxEncodedLen, + Encode, Decode, EqNoBound, PartialEqNoBound, CloneNoBound, TypeInfo, DebugNoBound, MaxEncodedLen, )] #[scale_info(skip_type_params(T))] pub struct UnstakeRequest { diff --git a/substrate/frame/honzon/oracle/src/lib.rs b/substrate/frame/honzon/oracle/src/lib.rs index b440574828c2c..a9c40a5deda96 100644 --- a/substrate/frame/honzon/oracle/src/lib.rs +++ b/substrate/frame/honzon/oracle/src/lib.rs @@ -89,7 +89,7 @@ use frame_system::pallet_prelude::*; use scale_info::TypeInfo; use sp_runtime::{ traits::{AccountIdConversion, Member}, - DispatchResult, RuntimeDebug, + Debug, DispatchResult, }; use sp_std::{prelude::*, vec}; @@ -139,7 +139,7 @@ pub mod pallet { #[derive( Encode, Decode, - RuntimeDebug, + Debug, Eq, PartialEq, Clone, diff --git a/substrate/frame/identity/src/legacy.rs b/substrate/frame/identity/src/legacy.rs index a5ef069f9268c..630b4780f608d 100644 --- a/substrate/frame/identity/src/legacy.rs +++ b/substrate/frame/identity/src/legacy.rs @@ -21,9 +21,9 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; #[cfg(feature = "runtime-benchmarks")] use enumflags2::BitFlag; use enumflags2::{bitflags, BitFlags}; -use frame_support::{traits::Get, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound}; +use frame_support::{traits::Get, CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound}; use scale_info::{build::Variants, Path, Type, TypeInfo}; -use sp_runtime::{BoundedVec, RuntimeDebug}; +use sp_runtime::BoundedVec; use crate::types::{Data, IdentityInformationProvider}; @@ -31,7 +31,7 @@ use crate::types::{Data, IdentityInformationProvider}; /// in the `IdentityInfo` struct. #[bitflags] #[repr(u64)] -#[derive(Clone, Copy, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, Copy, PartialEq, Eq, Debug)] pub enum IdentityField { Display, Legal, @@ -73,7 +73,7 @@ impl TypeInfo for IdentityField { EqNoBound, MaxEncodedLen, PartialEqNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, )] #[codec(mel_bound())] diff --git a/substrate/frame/identity/src/types.rs b/substrate/frame/identity/src/types.rs index 85f2f8f8597bc..0cb5e9068da54 100644 --- a/substrate/frame/identity/src/types.rs +++ b/substrate/frame/identity/src/types.rs @@ -21,16 +21,13 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::{fmt::Debug, iter::once, ops::Add}; use frame_support::{ traits::{ConstU32, Get}, - BoundedVec, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, + BoundedVec, CloneNoBound, DebugNoBound, PartialEqNoBound, }; use scale_info::{ build::{Fields, Variants}, Path, Type, TypeInfo, }; -use sp_runtime::{ - traits::{Member, Zero}, - RuntimeDebug, -}; +use sp_runtime::traits::{Member, Zero}; /// An identifier for a single name registrar/identity verification service. pub type RegistrarIndex = u32; @@ -39,7 +36,7 @@ pub type RegistrarIndex = u32; /// than 32-bytes then it will be truncated when encoding. /// /// Can also be `None`. -#[derive(Clone, DecodeWithMemTracking, Eq, PartialEq, RuntimeDebug, MaxEncodedLen)] +#[derive(Clone, DecodeWithMemTracking, Eq, PartialEq, Debug, MaxEncodedLen)] pub enum Data { /// No data here. None, @@ -198,7 +195,7 @@ impl Default for Data { DecodeWithMemTracking, Eq, PartialEq, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, )] @@ -265,9 +262,7 @@ pub trait IdentityInformationProvider: /// /// NOTE: This is stored separately primarily to facilitate the addition of extra fields in a /// backwards compatible way through a specialized `Decode` impl. -#[derive( - CloneNoBound, Encode, Eq, MaxEncodedLen, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo, -)] +#[derive(CloneNoBound, Encode, Eq, MaxEncodedLen, PartialEqNoBound, DebugNoBound, TypeInfo)] #[codec(mel_bound())] #[scale_info(skip_type_params(MaxJudgements))] pub struct Registration< @@ -314,7 +309,7 @@ impl< } /// Information concerning a registrar. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, MaxEncodedLen, TypeInfo)] pub struct RegistrarInfo< Balance: Encode + Decode + Clone + Debug + Eq + PartialEq, AccountId: Encode + Decode + Clone + Debug + Eq + PartialEq, diff --git a/substrate/frame/im-online/src/lib.rs b/substrate/frame/im-online/src/lib.rs index 6358fc600a36b..a83fa1b076ea3 100644 --- a/substrate/frame/im-online/src/lib.rs +++ b/substrate/frame/im-online/src/lib.rs @@ -104,7 +104,7 @@ use sp_application_crypto::RuntimeAppPublic; use sp_runtime::{ offchain::storage::{MutateStorageError, StorageRetrievalError, StorageValueRef}, traits::{AtLeast32BitUnsigned, Convert, Saturating, TrailingZeroInput}, - PerThing, Perbill, Permill, RuntimeDebug, SaturatedConversion, + Debug, PerThing, Perbill, Permill, SaturatedConversion, }; use sp_staking::{ offence::{Kind, Offence, ReportOffence}, @@ -158,7 +158,7 @@ const INCLUDE_THRESHOLD: u32 = 3; /// This stores the block number at which heartbeat was requested and when the worker /// has actually managed to produce it. /// Note we store such status for every `authority_index` separately. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo)] struct HeartbeatStatus { /// An index of the session that we are supposed to send heartbeat for. pub session_index: SessionIndex, @@ -218,7 +218,7 @@ impl core::fmt::Debug for OffchainErr where BlockNumber: PartialEq + Eq + Decode + Encode, @@ -817,7 +817,7 @@ impl OneSessionHandler for Pallet { } /// An offence that is filed if a validator didn't send a heartbeat message. -#[derive(RuntimeDebug, TypeInfo)] +#[derive(Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(Clone, PartialEq, Eq))] pub struct UnresponsivenessOffence { /// The current session index in which we report the unresponsive validators. diff --git a/substrate/frame/lottery/src/lib.rs b/substrate/frame/lottery/src/lib.rs index e8eb7a815205b..4a9f8e7dcf89f 100644 --- a/substrate/frame/lottery/src/lib.rs +++ b/substrate/frame/lottery/src/lib.rs @@ -69,7 +69,7 @@ use frame_support::{ pub use pallet::*; use sp_runtime::{ traits::{AccountIdConversion, Dispatchable, Saturating, Zero}, - ArithmeticError, DispatchError, RuntimeDebug, + ArithmeticError, Debug, DispatchError, }; pub use weights::WeightInfo; @@ -80,9 +80,7 @@ type BalanceOf = // We use this to uniquely match someone's incoming call with the calls configured for the lottery. type CallIndex = (u8, u8); -#[derive( - Encode, Decode, Default, Eq, PartialEq, RuntimeDebug, scale_info::TypeInfo, MaxEncodedLen, -)] +#[derive(Encode, Decode, Default, Eq, PartialEq, Debug, scale_info::TypeInfo, MaxEncodedLen)] pub struct LotteryConfig { /// Price per entry. price: Balance, diff --git a/substrate/frame/message-queue/src/lib.rs b/substrate/frame/message-queue/src/lib.rs index f87d931933624..1f49ca8fa9843 100644 --- a/substrate/frame/message-queue/src/lib.rs +++ b/substrate/frame/message-queue/src/lib.rs @@ -246,9 +246,7 @@ pub struct ItemHeader { impl ConstEncodedLen for ItemHeader {} // marker /// A page of messages. Pages always contain at least one item. -#[derive( - CloneNoBound, Encode, Decode, RuntimeDebugNoBound, DefaultNoBound, TypeInfo, MaxEncodedLen, -)] +#[derive(CloneNoBound, Encode, Decode, DebugNoBound, DefaultNoBound, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(HeapSize))] #[codec(mel_bound(Size: MaxEncodedLen))] pub struct Page + Debug + Clone + Default, HeapSize: Get> { @@ -423,7 +421,7 @@ where } /// A single link in the double-linked Ready Ring list. -#[derive(Clone, Encode, Decode, MaxEncodedLen, TypeInfo, RuntimeDebug, PartialEq)] +#[derive(Clone, Encode, Decode, MaxEncodedLen, TypeInfo, Debug, PartialEq)] pub struct Neighbours { /// The previous queue. prev: MessageOrigin, @@ -436,7 +434,7 @@ pub struct Neighbours { /// Each queue has exactly one book which holds all of its pages. All pages of a book combined /// contain all of the messages of its queue; hence the name *Book*. /// Books can be chained together in a double-linked fashion through their `ready_neighbours` field. -#[derive(Clone, Encode, Decode, MaxEncodedLen, TypeInfo, RuntimeDebug)] +#[derive(Clone, Encode, Decode, MaxEncodedLen, TypeInfo, Debug)] pub struct BookState { /// The first page with some items to be processed in it. If this is `>= end`, then there are /// no pages with items to be processing in them. diff --git a/substrate/frame/meta-tx/src/lib.rs b/substrate/frame/meta-tx/src/lib.rs index e77b24d18804d..320a8bdbd77bf 100644 --- a/substrate/frame/meta-tx/src/lib.rs +++ b/substrate/frame/meta-tx/src/lib.rs @@ -82,7 +82,7 @@ use sp_std::prelude::*; /// Meta Transaction type. /// /// The data that is provided and signed by the signer and shared with the relayer. -#[derive(Encode, Decode, PartialEq, Eq, TypeInfo, Clone, RuntimeDebug, DecodeWithMemTracking)] +#[derive(Encode, Decode, PartialEq, Eq, TypeInfo, Clone, Debug, DecodeWithMemTracking)] pub struct MetaTx { /// The target call to be executed on behalf of the signer. call: Call, diff --git a/substrate/frame/mixnet/src/lib.rs b/substrate/frame/mixnet/src/lib.rs index 401f42fc8b08f..51cf96e32a43a 100644 --- a/substrate/frame/mixnet/src/lib.rs +++ b/substrate/frame/mixnet/src/lib.rs @@ -59,7 +59,7 @@ pub type AuthorityIndex = u32; MaxEncodedLen, PartialEq, TypeInfo, - RuntimeDebug, + Debug, Serialize, Deserialize, )] @@ -130,7 +130,7 @@ pub type BoundedMixnodeFor = BoundedMixnode< /// A mixnode registration. A registration transaction is formed from one of these plus an /// [`AuthoritySignature`]. -#[derive(Clone, Decode, DecodeWithMemTracking, Encode, PartialEq, TypeInfo, RuntimeDebug)] +#[derive(Clone, Decode, DecodeWithMemTracking, Encode, PartialEq, TypeInfo, Debug)] pub struct Registration { /// Block number at the time of creation. When a registration transaction fails to make it on /// to the chain for whatever reason, we send out another one. We want this one to have a diff --git a/substrate/frame/multi-asset-bounties/src/lib.rs b/substrate/frame/multi-asset-bounties/src/lib.rs index ded80311374b8..299f623a12715 100644 --- a/substrate/frame/multi-asset-bounties/src/lib.rs +++ b/substrate/frame/multi-asset-bounties/src/lib.rs @@ -99,7 +99,7 @@ use frame_system::pallet_prelude::{ use scale_info::TypeInfo; use sp_runtime::{ traits::{AccountIdConversion, BadOrigin, Convert, Saturating, StaticLookup, TryConvert, Zero}, - Permill, RuntimeDebug, + Debug, Permill, }; pub type BalanceOf = <>::Paymaster as PayWithSource>::Balance; @@ -127,7 +127,7 @@ pub type ChildBountyOf = ChildBounty< >; /// A funded bounty. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct Bounty { /// The kind of asset this bounty is rewarded in. pub asset_kind: AssetKind, @@ -146,7 +146,7 @@ pub struct Bounty { } /// A funded child-bounty. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct ChildBounty { /// The parent bounty index of this child-bounty. pub parent_bounty: BountyIndex, @@ -164,7 +164,7 @@ pub struct ChildBounty { } /// The status of a child-/bounty proposal. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub enum BountyStatus { /// The child-/bounty funding has been attempted and is waiting to confirm the funds /// allocation. @@ -229,7 +229,7 @@ pub enum BountyStatus { /// When a payment is initiated via `Paymaster::pay`, it begins in the `Pending` state. The /// `check_status` call updates the payment state and advances the child-/bounty status. The /// `retry_payment` call can be used to reattempt payments in either `Pending` or `Failed` states. -#[derive(Encode, Decode, Clone, PartialEq, Eq, MaxEncodedLen, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, MaxEncodedLen, Debug, TypeInfo)] pub enum PaymentState { /// Pending claim. Pending, diff --git a/substrate/frame/multisig/src/lib.rs b/substrate/frame/multisig/src/lib.rs index c95dbaaac303d..c31489fc60c57 100644 --- a/substrate/frame/multisig/src/lib.rs +++ b/substrate/frame/multisig/src/lib.rs @@ -92,7 +92,7 @@ pub type BlockNumberFor = Decode, DecodeWithMemTracking, Default, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -111,7 +111,7 @@ pub struct Timepoint { Encode, Decode, Default, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, DecodeWithMemTracking, diff --git a/substrate/frame/nfts/src/lib.rs b/substrate/frame/nfts/src/lib.rs index 7a2a0d7765235..4c3a4cea0810c 100644 --- a/substrate/frame/nfts/src/lib.rs +++ b/substrate/frame/nfts/src/lib.rs @@ -59,7 +59,7 @@ use frame_support::traits::{ use frame_system::Config as SystemConfig; use sp_runtime::{ traits::{BlockNumberProvider, IdentifyAccount, Saturating, StaticLookup, Verify, Zero}, - RuntimeDebug, + Debug, }; pub use pallet::*; diff --git a/substrate/frame/nfts/src/tests.rs b/substrate/frame/nfts/src/tests.rs index e1b598ca4261c..0d4b203128f58 100644 --- a/substrate/frame/nfts/src/tests.rs +++ b/substrate/frame/nfts/src/tests.rs @@ -1027,7 +1027,7 @@ fn set_collection_system_attributes_should_work() { // test typed system attribute let typed_attribute_key = [0u8; 32]; - #[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)] + #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug)] struct TypedAttributeValue(u32); let typed_attribute_value = TypedAttributeValue(42); diff --git a/substrate/frame/nfts/src/types.rs b/substrate/frame/nfts/src/types.rs index b263cc0b9f16b..af4a1b5fe2455 100644 --- a/substrate/frame/nfts/src/types.rs +++ b/substrate/frame/nfts/src/types.rs @@ -90,7 +90,7 @@ pub type PreSignedAttributesOf = PreSignedAttributes< >; /// Information about a collection. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen)] pub struct CollectionDetails { /// Collection's owner. pub owner: AccountId, @@ -116,7 +116,7 @@ pub struct CollectionDetails { DecodeWithMemTracking, Eq, PartialEq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -143,9 +143,7 @@ impl CollectionDetails { } /// Witness data for items mint transactions. -#[derive( - Clone, Encode, Decode, DecodeWithMemTracking, Default, Eq, PartialEq, RuntimeDebug, TypeInfo, -)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, Default, Eq, PartialEq, Debug, TypeInfo)] pub struct MintWitness { /// Provide the id of the item in a required collection. pub owned_item: Option, @@ -154,7 +152,7 @@ pub struct MintWitness { } /// Information concerning the ownership of a single unique item. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, Default, TypeInfo, MaxEncodedLen)] pub struct ItemDetails { /// The owner of this item. pub owner: AccountId, @@ -166,7 +164,7 @@ pub struct ItemDetails { } /// Information about the reserved item deposit. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen)] pub struct ItemDeposit { /// A depositor account. pub account: AccountId, @@ -175,7 +173,7 @@ pub struct ItemDeposit { } /// Information about the collection's metadata. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, Default, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(StringLimit))] #[codec(mel_bound(Deposit: MaxEncodedLen))] pub struct CollectionMetadata> { @@ -190,7 +188,7 @@ pub struct CollectionMetadata> { } /// Information about the item's metadata. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, Default, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(StringLimit))] pub struct ItemMetadata> { /// The balance deposited for this metadata. @@ -205,15 +203,7 @@ pub struct ItemMetadata> { /// Information about the tip. #[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Clone, Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen, )] pub struct ItemTip { /// The collection of the item. @@ -227,7 +217,7 @@ pub struct ItemTip { } /// Information about the pending swap. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, Default, TypeInfo, MaxEncodedLen)] pub struct PendingSwap { /// The collection that contains the item that the user wants to receive. pub desired_collection: CollectionId, @@ -240,7 +230,7 @@ pub struct PendingSwap { } /// Information about the reserved attribute deposit. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen)] pub struct AttributeDeposit { /// A depositor account. pub account: Option, @@ -249,7 +239,7 @@ pub struct AttributeDeposit { } /// Information about the reserved item's metadata deposit. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen)] pub struct ItemMetadataDeposit { /// A depositor account, None means the deposit is collection's owner. pub account: Option, @@ -259,15 +249,7 @@ pub struct ItemMetadataDeposit { /// Specifies whether the tokens will be sent or received. #[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Clone, Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen, )] pub enum PriceDirection { /// Tokens will be sent. @@ -278,15 +260,7 @@ pub enum PriceDirection { /// Holds the details about the price. #[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Clone, Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen, )] pub struct PriceWithDirection { /// An amount. @@ -298,7 +272,7 @@ pub struct PriceWithDirection { /// Support for up to 64 user-enabled features on a collection. #[bitflags] #[repr(u64)] -#[derive(Copy, Clone, RuntimeDebug, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] pub enum CollectionSetting { /// Items in this collection are transferable. TransferableItems, @@ -313,7 +287,7 @@ pub enum CollectionSetting { } /// Wrapper type for `BitFlags` that implements `Codec`. -#[derive(Clone, Copy, PartialEq, Eq, Default, RuntimeDebug)] +#[derive(Clone, Copy, PartialEq, Eq, Default, Debug)] pub struct CollectionSettings(pub BitFlags); impl CollectionSettings { @@ -347,7 +321,7 @@ impl DecodeWithMemTracking for CollectionSettings {} DecodeWithMemTracking, Eq, PartialEq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -369,7 +343,7 @@ pub enum MintType { DecodeWithMemTracking, Eq, PartialEq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -406,7 +380,7 @@ impl Default for MintSettings { } /// A witness data to cancel attributes approval operation. -#[derive(Clone, Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, Debug, TypeInfo)] pub struct CancelAttributesApprovalWitness { /// An amount of attributes previously created by account. pub account_attributes: u32, @@ -430,15 +404,7 @@ pub struct CancelAttributesApprovalWitness { /// A list of possible pallet-level attributes. #[derive( - Clone, - Encode, - Decode, - DecodeWithMemTracking, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Clone, Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen, )] pub enum PalletAttributes { /// Marks an item as being used in order to claim another item. @@ -457,7 +423,7 @@ pub enum PalletAttributes { Encode, MaxEncodedLen, PartialEq, - RuntimeDebug, + Debug, TypeInfo, )] pub struct CollectionConfig { @@ -487,7 +453,7 @@ impl CollectionConfig` that implements `Codec`. -#[derive(Clone, Copy, PartialEq, Eq, Default, RuntimeDebug)] +#[derive(Clone, Copy, PartialEq, Eq, Default, Debug)] pub struct ItemSettings(pub BitFlags); impl ItemSettings { @@ -528,7 +494,7 @@ impl DecodeWithMemTracking for ItemSettings {} DecodeWithMemTracking, Default, PartialEq, - RuntimeDebug, + Debug, Clone, Copy, MaxEncodedLen, @@ -560,7 +526,7 @@ impl ItemConfig { /// Support for up to 64 system-enabled features on a collection. #[bitflags] #[repr(u64)] -#[derive(Copy, Clone, RuntimeDebug, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] pub enum PalletFeature { /// Enable/disable trading operations. Trading, @@ -573,7 +539,7 @@ pub enum PalletFeature { } /// Wrapper type for `BitFlags` that implements `Codec`. -#[derive(Default, RuntimeDebug)] +#[derive(Default, Debug)] pub struct PalletFeatures(pub BitFlags); impl PalletFeatures { @@ -592,7 +558,7 @@ impl_codec_bitflags!(PalletFeatures, u64, PalletFeature); /// Support for up to 8 different roles for collections. #[bitflags] #[repr(u8)] -#[derive(Copy, Clone, RuntimeDebug, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] pub enum CollectionRole { /// Can mint items. Issuer, @@ -603,7 +569,7 @@ pub enum CollectionRole { } /// A wrapper type that implements `Codec`. -#[derive(Clone, Copy, PartialEq, Eq, Default, RuntimeDebug)] +#[derive(Clone, Copy, PartialEq, Eq, Default, Debug)] pub struct CollectionRoles(pub BitFlags); impl CollectionRoles { @@ -623,7 +589,7 @@ impl CollectionRoles { } impl_codec_bitflags!(CollectionRoles, u8, CollectionRole); -#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo)] pub struct PreSignedMint { /// A collection of the item to be minted. pub collection: CollectionId, @@ -641,7 +607,7 @@ pub struct PreSignedMint { pub mint_price: Option, } -#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo)] pub struct PreSignedAttributes { /// Collection's ID. pub collection: CollectionId, diff --git a/substrate/frame/nis/src/lib.rs b/substrate/frame/nis/src/lib.rs index 00fc3105dfe78..d2ff9cd92774f 100644 --- a/substrate/frame/nis/src/lib.rs +++ b/substrate/frame/nis/src/lib.rs @@ -302,9 +302,7 @@ pub mod pallet { pub struct Pallet(_); /// A single bid, an item of a *queue* in `Queues`. - #[derive( - Clone, Eq, PartialEq, Default, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen, - )] + #[derive(Clone, Eq, PartialEq, Default, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub struct Bid { /// The amount bid. pub amount: Balance, @@ -313,9 +311,7 @@ pub mod pallet { } /// Information representing a receipt. - #[derive( - Clone, Eq, PartialEq, Default, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen, - )] + #[derive(Clone, Eq, PartialEq, Default, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub struct ReceiptRecord { /// The proportion of the effective total issuance. pub proportion: Perquintill, @@ -338,9 +334,7 @@ pub mod pallet { /// `issuance - frozen + proportion * issuance` /// /// where `issuance = active_issuance - IgnoredIssuance` - #[derive( - Clone, Eq, PartialEq, Default, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen, - )] + #[derive(Clone, Eq, PartialEq, Default, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub struct SummaryRecord { /// The total proportion over all outstanding receipts. pub proportion_owed: Perquintill, diff --git a/substrate/frame/nomination-pools/src/adapter.rs b/substrate/frame/nomination-pools/src/adapter.rs index f1c68af4ea6ad..184aff02f787d 100644 --- a/substrate/frame/nomination-pools/src/adapter.rs +++ b/substrate/frame/nomination-pools/src/adapter.rs @@ -22,7 +22,7 @@ use sp_staking::{Agent, DelegationInterface, DelegationMigrator, Delegator}; /// Types of stake strategies. /// /// Useful for determining current staking strategy of a runtime and enforce integrity tests. -#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, RuntimeDebugNoBound, PartialEq)] +#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, DebugNoBound, PartialEq)] pub enum StakeStrategyType { /// Member funds are transferred to pool account and staked. /// diff --git a/substrate/frame/nomination-pools/src/lib.rs b/substrate/frame/nomination-pools/src/lib.rs index 88849a0bb9f1a..434ca6960ff9b 100644 --- a/substrate/frame/nomination-pools/src/lib.rs +++ b/substrate/frame/nomination-pools/src/lib.rs @@ -423,14 +423,7 @@ pub const POINTS_TO_BALANCE_INIT_RATIO: u32 = 1; /// Possible operations on the configuration values of this pallet. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, - RuntimeDebugNoBound, - PartialEq, - Clone, + Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, DebugNoBound, PartialEq, Clone, )] pub enum ConfigOp { /// Don't change. @@ -516,7 +509,7 @@ impl ClaimPermission { DecodeWithMemTracking, MaxEncodedLen, TypeInfo, - RuntimeDebugNoBound, + DebugNoBound, CloneNoBound, PartialEqNoBound, EqNoBound, @@ -699,7 +692,7 @@ impl PoolMember { MaxEncodedLen, TypeInfo, PartialEq, - RuntimeDebugNoBound, + DebugNoBound, Clone, Copy, )] @@ -745,7 +738,7 @@ pub struct PoolRoles { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -1004,7 +997,7 @@ pub struct BondedPoolInner { /// /// The main purpose of this is to wrap a [`BondedPoolInner`], with the account /// + id of the pool, for easier access. -#[derive(RuntimeDebugNoBound)] +#[derive(DebugNoBound)] #[cfg_attr(feature = "std", derive(Clone, PartialEq))] pub struct BondedPool { /// The identifier of the pool. @@ -1362,7 +1355,7 @@ impl BondedPool { CloneNoBound, PartialEqNoBound, EqNoBound, - RuntimeDebugNoBound, + DebugNoBound, )] #[cfg_attr(feature = "std", derive(DefaultNoBound))] #[codec(mel_bound(T: Config))] @@ -1530,7 +1523,7 @@ impl RewardPool { DecodeWithMemTracking, TypeInfo, DefaultNoBound, - RuntimeDebugNoBound, + DebugNoBound, CloneNoBound, PartialEqNoBound, EqNoBound, @@ -1583,7 +1576,7 @@ impl UnbondPool { DecodeWithMemTracking, TypeInfo, DefaultNoBound, - RuntimeDebugNoBound, + DebugNoBound, CloneNoBound, PartialEqNoBound, EqNoBound, @@ -2075,9 +2068,7 @@ pub mod pallet { Restricted, } - #[derive( - Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, PalletError, RuntimeDebug, - )] + #[derive(Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, PalletError, Debug)] pub enum DefensiveError { /// There isn't enough space in the unbond pool. NotEnoughSpaceInUnbondPool, diff --git a/substrate/frame/nomination-pools/src/migration.rs b/substrate/frame/nomination-pools/src/migration.rs index a0e5b45b88cf7..25b80d41c4bcb 100644 --- a/substrate/frame/nomination-pools/src/migration.rs +++ b/substrate/frame/nomination-pools/src/migration.rs @@ -320,7 +320,7 @@ pub(crate) mod v7 { } #[allow(dead_code)] - #[derive(RuntimeDebugNoBound)] + #[derive(DebugNoBound)] #[cfg_attr(feature = "std", derive(Clone, PartialEq))] pub struct V7BondedPool { /// The identifier of the pool. diff --git a/substrate/frame/origin-restriction/src/lib.rs b/substrate/frame/origin-restriction/src/lib.rs index c0550f66353aa..79c73410ae654 100644 --- a/substrate/frame/origin-restriction/src/lib.rs +++ b/substrate/frame/origin-restriction/src/lib.rs @@ -58,7 +58,7 @@ use frame_support::{ pallet_prelude::{Pays, Zero}, traits::{ContainsPair, OriginTrait}, weights::WeightToFee, - Parameter, RuntimeDebugNoBound, + DebugNoBound, Parameter, }; use frame_system::pallet_prelude::BlockNumberFor; use pallet_transaction_payment::OnChargeTransaction; @@ -71,8 +71,9 @@ use sp_runtime::{ transaction_validity::{ InvalidTransaction, TransactionSource, TransactionValidityError, ValidTransaction, }, + Debug, DispatchError::BadOrigin, - DispatchResult, RuntimeDebug, SaturatedConversion, Saturating, Weight, + DispatchResult, SaturatedConversion, Saturating, Weight, }; /// The allowance for an entity, defining its usage limit and recovery rate. @@ -103,7 +104,7 @@ pub mod pallet { use frame_system::pallet_prelude::*; /// The usage of an entity. - #[derive(Encode, Decode, Clone, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] + #[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen)] pub struct Usage { /// The amount of usage consumed at block `at_block`. pub used: Balance, @@ -228,9 +229,7 @@ fn extrinsic_fee(weight: Weight, length: usize) -> BalanceOf { /// The extension can be enabled or disabled with the inner boolean. When enabled, the restriction /// process executes. When disabled, only the `RestrictedOrigins` check is executed. /// You can always enable it, the only advantage of disabling it is have better pre-dispatch weight. -#[derive( - Encode, Decode, Clone, Eq, PartialEq, TypeInfo, RuntimeDebugNoBound, DecodeWithMemTracking, -)] +#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo, DebugNoBound, DecodeWithMemTracking)] #[scale_info(skip_type_params(T))] pub struct RestrictOrigin(bool, core::marker::PhantomData); @@ -242,7 +241,7 @@ impl RestrictOrigin { } /// The info passed between the validate and prepare steps for the `RestrictOrigins` extension. -#[derive(RuntimeDebugNoBound)] +#[derive(DebugNoBound)] pub enum Val { Charge { fee: BalanceOf, entity: T::RestrictedEntity }, NoCharge, diff --git a/substrate/frame/people/src/lib.rs b/substrate/frame/people/src/lib.rs index 6a78152a46b6b..69154cc560319 100644 --- a/substrate/frame/people/src/lib.rs +++ b/substrate/frame/people/src/lib.rs @@ -155,7 +155,7 @@ use frame_support::{ use scale_info::TypeInfo; use sp_runtime::{ traits::{BadOrigin, Dispatchable}, - ArithmeticError, RuntimeDebug, SaturatedConversion, Saturating, + ArithmeticError, Debug, SaturatedConversion, Saturating, }; use verifiable::{Alias, GenerateVerifiable}; @@ -453,15 +453,7 @@ pub mod pallet { #[pallet::origin] #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - MaxEncodedLen, - TypeInfo, - DecodeWithMemTracking, + Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo, DecodeWithMemTracking, )] pub enum Origin { PersonalIdentity(PersonalId), diff --git a/substrate/frame/people/src/types.rs b/substrate/frame/people/src/types.rs index 879a347ec29c8..03d3545bd2310 100644 --- a/substrate/frame/people/src/types.rs +++ b/substrate/frame/people/src/types.rs @@ -39,15 +39,7 @@ pub type ChunksOf = BoundedVec< /// The overarching state of all people rings regarding the actions that are currently allowed to be /// performed on them. #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - MaxEncodedLen, - TypeInfo, - DecodeWithMemTracking, + Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo, DecodeWithMemTracking, )] pub enum RingMembersState { /// The rings can accept new people sequentially if the maximum capacity has not been reached @@ -123,15 +115,7 @@ impl RingMembersState { /// For instance, if a person is suspended, then ring will get revised, the revised alias with the /// old revision shows that the alias may not be owned by a valid person anymore. #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - MaxEncodedLen, - TypeInfo, - DecodeWithMemTracking, + Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo, DecodeWithMemTracking, )] pub struct RevisedContextualAlias { pub revision: RevisionIndex, @@ -144,14 +128,14 @@ pub struct RevisedContextualAlias { /// The revision can be used to tell in the future if an alias may have been suspended. /// For instance, if a person is suspended, then ring will get revised, the revised alias with the /// old revision shows that the alias may not be owned by a valid person anymore. -#[derive(Clone, PartialEq, Eq, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)] pub struct RevisedAlias { pub revision: RevisionIndex, pub ring: RingIndex, pub alias: Alias, } -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub struct RingRoot { /// The ring root for the current ring. @@ -162,9 +146,7 @@ pub struct RingRoot { pub intermediate: IntermediateOf, } -#[derive( - PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen, DefaultNoBound, -)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen, DefaultNoBound)] #[scale_info(skip_type_params(T))] /// Information about the current key inclusion status in a ring. pub struct RingStatus { @@ -179,7 +161,7 @@ pub struct RingStatus { /// Differentiates between individuals included in a ring, those being onboarded and the suspended /// ones. For those already included, provides ring index and position in it. For those being /// onboarded, provides queue page index and position in the queue. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub enum RingPosition { /// Coordinates within the onboarding queue for a person that doesn't belong to a ring yet. Onboarding { queue_page: PageIndex }, @@ -213,7 +195,7 @@ impl RingPosition { } /// Record of personhood. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub struct PersonRecord { // The key used for the person. pub key: Member, @@ -225,7 +207,7 @@ pub struct PersonRecord { /// Describes the action to take after checking the first two pages of the onboarding queue for a /// potential merge. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub(crate) enum QueueMergeAction { Merge { diff --git a/substrate/frame/preimage/src/lib.rs b/substrate/frame/preimage/src/lib.rs index 584a9fbe3aa2a..ec5a6edbb573c 100644 --- a/substrate/frame/preimage/src/lib.rs +++ b/substrate/frame/preimage/src/lib.rs @@ -66,15 +66,7 @@ pub use pallet::*; /// A type to note whether a preimage is owned by a user or the system. #[derive( - Clone, - Eq, - PartialEq, - Encode, - Decode, - TypeInfo, - MaxEncodedLen, - RuntimeDebug, - DecodeWithMemTracking, + Clone, Eq, PartialEq, Encode, Decode, TypeInfo, MaxEncodedLen, Debug, DecodeWithMemTracking, )] pub enum OldRequestStatus { /// The associated preimage has not yet been requested by the system. The given deposit (if @@ -88,15 +80,7 @@ pub enum OldRequestStatus { /// A type to note whether a preimage is owned by a user or the system. #[derive( - Clone, - Eq, - PartialEq, - Encode, - Decode, - TypeInfo, - MaxEncodedLen, - RuntimeDebug, - DecodeWithMemTracking, + Clone, Eq, PartialEq, Encode, Decode, TypeInfo, MaxEncodedLen, Debug, DecodeWithMemTracking, )] pub enum RequestStatus { /// The associated preimage has not yet been requested by the system. The given deposit (if diff --git a/substrate/frame/preimage/src/migration.rs b/substrate/frame/preimage/src/migration.rs index e38483ee68c62..88e34527fd977 100644 --- a/substrate/frame/preimage/src/migration.rs +++ b/substrate/frame/preimage/src/migration.rs @@ -36,7 +36,7 @@ const TARGET: &'static str = "runtime::preimage::migration::v1"; mod v0 { use super::*; - #[derive(Clone, Eq, PartialEq, Encode, Decode, TypeInfo, MaxEncodedLen, RuntimeDebug)] + #[derive(Clone, Eq, PartialEq, Encode, Decode, TypeInfo, MaxEncodedLen, Debug)] pub enum OldRequestStatus { Unrequested(Option<(AccountId, Balance)>), Requested(u32), diff --git a/substrate/frame/proxy/src/lib.rs b/substrate/frame/proxy/src/lib.rs index 3d586b73d2e41..beed497e7c729 100644 --- a/substrate/frame/proxy/src/lib.rs +++ b/substrate/frame/proxy/src/lib.rs @@ -64,7 +64,7 @@ type AccountIdLookupOf = <::Lookup as StaticLookup PartialEq, Ord, PartialOrd, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, )] @@ -87,7 +87,7 @@ pub struct ProxyDefinition { Copy, Eq, PartialEq, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, )] @@ -108,7 +108,7 @@ pub struct Announcement { Copy, Eq, PartialEq, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, DecodeWithMemTracking, diff --git a/substrate/frame/proxy/src/tests.rs b/substrate/frame/proxy/src/tests.rs index d56293eee9e94..25b2ea5396f3b 100644 --- a/substrate/frame/proxy/src/tests.rs +++ b/substrate/frame/proxy/src/tests.rs @@ -65,7 +65,7 @@ impl pallet_utility::Config for Test { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/substrate/frame/ranked-collective/src/lib.rs b/substrate/frame/ranked-collective/src/lib.rs index b8172916d46b0..cb56fd06cc45a 100644 --- a/substrate/frame/ranked-collective/src/lib.rs +++ b/substrate/frame/ranked-collective/src/lib.rs @@ -51,14 +51,14 @@ use frame_support::{ EnsureOrigin, EnsureOriginWithArg, OriginTrait, PollStatus, Polling, RankedMembers, RankedMembersSwapHandler, VoteTally, }, - CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, + CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound, }; use scale_info::TypeInfo; use sp_arithmetic::traits::Saturating; use sp_runtime::{ traits::{Convert, StaticLookup}, ArithmeticError::Overflow, - DispatchError, Perbill, RuntimeDebug, + Debug, DispatchError, Perbill, }; #[cfg(test)] @@ -85,7 +85,7 @@ pub type Votes = u32; CloneNoBound, PartialEqNoBound, EqNoBound, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, Encode, Decode, @@ -175,7 +175,7 @@ impl, I: 'static, M: GetMaxVoters>> } /// Record needed for every member. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub struct MemberRecord { /// The rank of the member. rank: Rank, @@ -197,7 +197,7 @@ impl MemberRecord { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] diff --git a/substrate/frame/recovery/src/lib.rs b/substrate/frame/recovery/src/lib.rs index 0de0ea1b8c721..610c0839aa45d 100644 --- a/substrate/frame/recovery/src/lib.rs +++ b/substrate/frame/recovery/src/lib.rs @@ -180,7 +180,7 @@ pub type FriendsOf = BoundedVec<::AccountId, ::MaxFriends>; /// An active recovery process. -#[derive(Clone, Eq, PartialEq, Encode, Decode, Default, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Default, Debug, TypeInfo, MaxEncodedLen)] pub struct ActiveRecovery { /// The block number when the recovery process started. pub created: BlockNumber, @@ -192,7 +192,7 @@ pub struct ActiveRecovery { } /// Configuration for recovering an account. -#[derive(Clone, Eq, PartialEq, Encode, Decode, Default, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Default, Debug, TypeInfo, MaxEncodedLen)] pub struct RecoveryConfig { /// The minimum number of blocks since the start of the recovery process before the account /// can be recovered. diff --git a/substrate/frame/referenda/src/migration.rs b/substrate/frame/referenda/src/migration.rs index 22b834ea32f23..1b0f8a6e9faa8 100644 --- a/substrate/frame/referenda/src/migration.rs +++ b/substrate/frame/referenda/src/migration.rs @@ -49,15 +49,7 @@ pub mod v0 { /// Info regarding a referendum, present or past. #[derive( - Encode, - Decode, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, - DecodeWithMemTracking, + Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, DecodeWithMemTracking, )] pub enum ReferendumInfo< TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, diff --git a/substrate/frame/referenda/src/types.rs b/substrate/frame/referenda/src/types.rs index d4b8921c0ffeb..caca9087f25a4 100644 --- a/substrate/frame/referenda/src/types.rs +++ b/substrate/frame/referenda/src/types.rs @@ -27,7 +27,7 @@ use frame_support::{ }; use scale_info::{Type, TypeInfo}; use sp_arithmetic::{Rounding::*, SignedRounding::*}; -use sp_runtime::{FixedI64, PerThing, RuntimeDebug}; +use sp_runtime::{FixedI64, PerThing}; pub type BalanceOf = <>::Currency as Currency<::AccountId>>::Balance; @@ -101,15 +101,7 @@ impl> InsertSorted for BoundedVec { } #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, )] pub struct DecidingStatus { /// When this referendum began being "decided". If confirming, then the @@ -121,15 +113,7 @@ pub struct DecidingStatus { } #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, )] pub struct Deposit { pub who: AccountId, @@ -282,15 +266,7 @@ where /// Info regarding an ongoing referendum. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, )] pub struct ReferendumStatus< TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, @@ -329,15 +305,7 @@ pub struct ReferendumStatus< /// Info regarding a referendum, present or past. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, )] pub enum ReferendumInfo< TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, @@ -417,7 +385,7 @@ impl< /// Type for describing a curve over the 2-dimensional space of axes between 0-1, as represented /// by `(Perbill, Perbill)`. #[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, TypeInfo, MaxEncodedLen)] -#[cfg_attr(not(feature = "std"), derive(RuntimeDebug))] +#[cfg_attr(not(feature = "std"), derive(Debug))] pub enum Curve { /// Linear curve starting at `(0, ceil)`, proceeding linearly to `(length, floor)`, then /// remaining at `floor` until the end of the period. diff --git a/substrate/frame/revive/src/debug.rs b/substrate/frame/revive/src/debug.rs index 069867830587c..6d569523459c0 100644 --- a/substrate/frame/revive/src/debug.rs +++ b/substrate/frame/revive/src/debug.rs @@ -20,7 +20,7 @@ use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use sp_core::Get; -use sp_runtime::RuntimeDebug; +use Debug; /// Debugging settings that can be configured when DebugEnabled config is true. #[derive( @@ -29,7 +29,7 @@ use sp_runtime::RuntimeDebug; Default, Clone, PartialEq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, Serialize, diff --git a/substrate/frame/revive/src/evm/runtime.rs b/substrate/frame/revive/src/evm/runtime.rs index c359b04d45764..4da3b4c99d4cd 100644 --- a/substrate/frame/revive/src/evm/runtime.rs +++ b/substrate/frame/revive/src/evm/runtime.rs @@ -42,7 +42,7 @@ use sp_runtime::{ TransactionExtension, }, transaction_validity::{InvalidTransaction, TransactionValidityError}, - OpaqueExtrinsic, RuntimeDebug, Weight, + Debug, OpaqueExtrinsic, Weight, }; /// Used to set the weight limit argument of a `eth_call` or `eth_instantiate_with_code` call. @@ -55,7 +55,7 @@ pub trait SetWeightLimit { /// Wraps [`generic::UncheckedExtrinsic`] to support checking unsigned /// [`crate::Call::eth_transact`] extrinsic. -#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, RuntimeDebug)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug)] pub struct UncheckedExtrinsic( pub generic::UncheckedExtrinsic, Signature, E::Extension>, ); diff --git a/substrate/frame/revive/src/exec.rs b/substrate/frame/revive/src/exec.rs index 53613a393ba99..02ab38c731dab 100644 --- a/substrate/frame/revive/src/exec.rs +++ b/substrate/frame/revive/src/exec.rs @@ -22,7 +22,7 @@ use crate::{ metering::{ChargedAmount, Diff, FrameMeter, ResourceMeter, State, Token, TransactionMeter}, precompiles::{All as AllPrecompiles, Instance as PrecompileInstance, Precompiles}, primitives::{ExecConfig, ExecReturnValue, StorageDeposit}, - runtime_decl_for_revive_api::{Decode, Encode, RuntimeDebugNoBound, TypeInfo}, + runtime_decl_for_revive_api::{Decode, Encode, TypeInfo}, storage::{AccountIdOrAddress, WriteOutcome}, tracing::if_tracing, transient_storage::TransientStorage, @@ -171,7 +171,7 @@ impl> From for ExecError { } /// The type of origins supported by the revive pallet. -#[derive(Clone, Encode, Decode, PartialEq, TypeInfo, RuntimeDebugNoBound)] +#[derive(Clone, Encode, Decode, PartialEq, TypeInfo, DebugNoBound)] pub enum Origin { Root, Signed(T::AccountId), @@ -556,7 +556,7 @@ pub trait PrecompileExt: sealing::Sealed { Clone, PartialEq, Eq, - sp_core::RuntimeDebug, + Debug, codec::Decode, codec::Encode, codec::MaxEncodedLen, @@ -678,7 +678,7 @@ struct Frame { /// This structure is used to represent the arguments in a delegate call frame in order to /// distinguish who delegated the call and where it was delegated to. -#[derive(Clone, RuntimeDebugNoBound)] +#[derive(Clone, DebugNoBound)] pub struct DelegateInfo { /// The caller of the contract. pub caller: Origin, diff --git a/substrate/frame/revive/src/lib.rs b/substrate/frame/revive/src/lib.rs index b47caf6f98aff..90af173fcb8ef 100644 --- a/substrate/frame/revive/src/lib.rs +++ b/substrate/frame/revive/src/lib.rs @@ -74,7 +74,7 @@ use frame_support::{ ConstU32, ConstU64, EnsureOrigin, Get, IsSubType, IsType, OriginTrait, }, weights::WeightMeter, - BoundedVec, RuntimeDebugNoBound, + BoundedVec, }; use frame_system::{ ensure_signed, @@ -640,15 +640,7 @@ pub mod pallet { } #[derive( - PartialEq, - Eq, - Clone, - MaxEncodedLen, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - RuntimeDebug, + PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug, )] #[pallet::origin] pub enum Origin { diff --git a/substrate/frame/revive/src/metering/storage.rs b/substrate/frame/revive/src/metering/storage.rs index 98ca58e3514d3..33580057aa14f 100644 --- a/substrate/frame/revive/src/metering/storage.rs +++ b/substrate/frame/revive/src/metering/storage.rs @@ -27,7 +27,7 @@ use crate::{ }; use alloc::vec::Vec; use core::{marker::PhantomData, mem}; -use frame_support::{traits::Get, DefaultNoBound, RuntimeDebugNoBound}; +use frame_support::{traits::Get, DebugNoBound, DefaultNoBound}; use sp_runtime::{ traits::{Saturating, Zero}, DispatchError, FixedPointNumber, FixedU128, @@ -71,7 +71,7 @@ pub trait Ext { pub enum ReservingExt {} /// A type that allows the metering of consumed or freed storage of a single contract call stack. -#[derive(DefaultNoBound, RuntimeDebugNoBound)] +#[derive(DefaultNoBound, DebugNoBound)] pub struct RawMeter { /// The limit of how much balance this meter is allowed to consume. pub(crate) limit: Option>, @@ -97,7 +97,7 @@ pub struct RawMeter { } /// This type is used to describe a storage change when charging from the meter. -#[derive(Default, RuntimeDebugNoBound)] +#[derive(Default, DebugNoBound)] pub struct Diff { /// How many bytes were added to storage. pub bytes_added: u32, @@ -181,7 +181,7 @@ impl Diff { } /// The state of a contract. -#[derive(RuntimeDebugNoBound, Clone, PartialEq, Eq)] +#[derive(DebugNoBound, Clone, PartialEq, Eq)] pub enum ContractState { Alive { amount: DepositOf }, Terminated, @@ -196,14 +196,14 @@ pub enum ContractState { /// The only exception is when a special (tougher) deposit limit is specified for a cross-contract /// call. In that case the limit is enforced once the call is returned, rolling it back if /// exhausted. -#[derive(RuntimeDebugNoBound, Clone)] +#[derive(DebugNoBound, Clone)] struct Charge { contract: T::AccountId, state: ContractState, } /// Records the storage changes of a storage meter. -#[derive(RuntimeDebugNoBound)] +#[derive(DebugNoBound)] enum Contribution { /// The contract the meter belongs to is alive and accumulates changes using a [`Diff`]. Alive(Diff), diff --git a/substrate/frame/revive/src/primitives.rs b/substrate/frame/revive/src/primitives.rs index c5154d7055aea..1208c97bc22e3 100644 --- a/substrate/frame/revive/src/primitives.rs +++ b/substrate/frame/revive/src/primitives.rs @@ -29,7 +29,7 @@ use scale_info::TypeInfo; use sp_core::Get; use sp_runtime::{ traits::{One, Saturating, Zero}, - DispatchError, RuntimeDebug, + DispatchError, }; /// Result type of a `bare_call` or `bare_instantiate` call as well as `ContractsApi::call` and @@ -42,7 +42,7 @@ use sp_runtime::{ /// It has been extended to include `events` at the end of the struct while not bumping the /// `ContractsApi` version. Therefore when SCALE decoding a `ContractResult` its trailing data /// should be ignored to avoid any potential compatibility issues. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] pub struct ContractResult { /// How much weight was consumed during execution. pub weight_consumed: Weight, @@ -88,7 +88,7 @@ impl Default for ContractResult { } /// The result of the execution of a `eth_transact` call. -#[derive(Clone, Eq, PartialEq, Default, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Default, Encode, Decode, Debug, TypeInfo)] pub struct EthTransactInfo { /// The amount of weight that was necessary to execute the transaction. pub weight_required: Weight, @@ -103,13 +103,13 @@ pub struct EthTransactInfo { } /// Error type of a `eth_transact` call. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] pub enum EthTransactError { Data(Vec), Message(String), } -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] /// Error encountered while creating a BalanceWithDust from a U256 balance. pub enum BalanceConversionError { /// Error encountered while creating the main balance value. @@ -189,7 +189,7 @@ pub type GetStorageResult = Result>, ContractAccessError>; pub type SetStorageResult = Result; /// The possible errors that can happen querying the storage of a contract. -#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo)] +#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, MaxEncodedLen, Debug, TypeInfo)] pub enum ContractAccessError { /// The given address doesn't point to a contract. DoesntExist, @@ -200,7 +200,7 @@ pub enum ContractAccessError { } /// Output of a contract call or instantiation which ran to completion. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo, Default)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug, TypeInfo, Default)] pub struct ExecReturnValue { /// Flags passed along by `seal_return`. Empty when `seal_return` was never called. pub flags: ReturnFlags, @@ -216,7 +216,7 @@ impl ExecReturnValue { } /// The result of a successful contract instantiation. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo, Default)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug, TypeInfo, Default)] pub struct InstantiateReturnValue { /// The output of the called constructor. pub result: ExecReturnValue, @@ -225,7 +225,7 @@ pub struct InstantiateReturnValue { } /// The result of successfully uploading a contract. -#[derive(Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen, Debug, TypeInfo)] pub struct CodeUploadReturnValue { /// The key under which the new code is stored. pub code_hash: sp_core::H256, @@ -234,7 +234,7 @@ pub struct CodeUploadReturnValue { } /// Reference to an existing code hash or a new vm module. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] pub enum Code { /// A vm module as raw bytes. Upload(Vec), @@ -243,9 +243,7 @@ pub enum Code { } /// The amount of balance that was either charged or refunded in order to pay for storage. -#[derive( - Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo, -)] +#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, MaxEncodedLen, Debug, TypeInfo)] pub enum StorageDeposit { /// The transaction reduced storage consumption. /// diff --git a/substrate/frame/revive/src/storage.rs b/substrate/frame/revive/src/storage.rs index 77110178c9d3e..b36ef75eed25e 100644 --- a/substrate/frame/revive/src/storage.rs +++ b/substrate/frame/revive/src/storage.rs @@ -43,7 +43,7 @@ use sp_core::{Get, H160}; use sp_io::KillStorageResult; use sp_runtime::{ traits::{Hash, Saturating, Zero}, - DispatchError, RuntimeDebug, + Debug, DispatchError, }; use crate::metering::Diff; @@ -57,15 +57,7 @@ pub enum AccountIdOrAddress { /// Represents the account information for a contract or an externally owned account (EOA). #[derive( - DefaultNoBound, - Encode, - Decode, - CloneNoBound, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + DefaultNoBound, Encode, Decode, CloneNoBound, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, )] #[scale_info(skip_type_params(T))] pub struct AccountInfo { @@ -79,15 +71,7 @@ pub struct AccountInfo { /// The account type is used to distinguish between contracts and externally owned accounts. #[derive( - DefaultNoBound, - Encode, - Decode, - CloneNoBound, - PartialEq, - Eq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + DefaultNoBound, Encode, Decode, CloneNoBound, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen, )] #[scale_info(skip_type_params(T))] pub enum AccountType { @@ -473,7 +457,7 @@ impl ContractInfo { } /// Information about what happened to the pre-existing value when calling [`ContractInfo::write`]. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] pub enum WriteOutcome { /// No value existed at the specified key. New, diff --git a/substrate/frame/revive/src/vm/pvm.rs b/substrate/frame/revive/src/vm/pvm.rs index e582cc5c95475..6fb4cbca9aa70 100644 --- a/substrate/frame/revive/src/vm/pvm.rs +++ b/substrate/frame/revive/src/vm/pvm.rs @@ -36,7 +36,7 @@ use core::{fmt, marker::PhantomData, mem}; use frame_support::{ensure, weights::Weight}; use pallet_revive_uapi::{CallFlags, ReturnErrorCode, ReturnFlags, StorageFlags}; use sp_core::{H160, H256, U256}; -use sp_runtime::{DispatchError, RuntimeDebug}; +use sp_runtime::DispatchError; /// Extracts the code and data from a given program blob. pub fn extract_code_and_data(data: &[u8]) -> Option<(Vec, Vec)> { @@ -225,7 +225,7 @@ impl From<&ExecReturnValue> for ReturnErrorCode { } /// The data passed through when a contract uses `seal_return`. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct ReturnData { /// The flags as passed through by the contract. They are still unchecked and /// will later be parsed into a `ReturnFlags` bitflags struct. @@ -240,7 +240,7 @@ pub struct ReturnData { /// occurred (the SupervisorError variant). /// The other case is where the trap does not constitute an error but rather was invoked /// as a quick way to terminate the application (all other variants). -#[derive(RuntimeDebug)] +#[derive(Debug)] pub enum TrapReason { /// The supervisor trapped the contract because of an error condition occurred during /// execution in privileged code. diff --git a/substrate/frame/safe-mode/src/lib.rs b/substrate/frame/safe-mode/src/lib.rs index 80a904d68ad9e..ac160ec1b500d 100644 --- a/substrate/frame/safe-mode/src/lib.rs +++ b/substrate/frame/safe-mode/src/lib.rs @@ -234,7 +234,7 @@ pub mod pallet { Clone, PartialEq, Eq, - RuntimeDebug, + Debug, Encode, Decode, DecodeWithMemTracking, diff --git a/substrate/frame/safe-mode/src/mock.rs b/substrate/frame/safe-mode/src/mock.rs index 8a47148a4ed9c..ebe7e404c8d72 100644 --- a/substrate/frame/safe-mode/src/mock.rs +++ b/substrate/frame/safe-mode/src/mock.rs @@ -86,7 +86,7 @@ impl pallet_utility::Config for Test { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/substrate/frame/salary/src/lib.rs b/substrate/frame/salary/src/lib.rs index bd8855bcc24d5..b158377a1f7f5 100644 --- a/substrate/frame/salary/src/lib.rs +++ b/substrate/frame/salary/src/lib.rs @@ -39,7 +39,7 @@ pub use weights::WeightInfo; pub type Cycle = u32; /// The status of the pallet instance. -#[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, RuntimeDebug)] +#[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, Debug)] pub struct StatusType { /// The index of the "current cycle" (i.e. the last cycle being processed). cycle_index: CycleIndex, @@ -54,7 +54,7 @@ pub struct StatusType { } /// The state of a specific payment claim. -#[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, RuntimeDebug)] +#[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, Debug)] pub enum ClaimState { /// No claim recorded. Nothing, @@ -67,7 +67,7 @@ pub enum ClaimState { use ClaimState::*; /// The status of a single payee/claimant. -#[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, RuntimeDebug)] +#[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, Debug)] pub struct ClaimantStatus { /// The most recent cycle in which the claimant was active. last_active: CycleIndex, diff --git a/substrate/frame/scheduler/src/lib.rs b/substrate/frame/scheduler/src/lib.rs index 9d5595e8dc4f3..54c3ffc2d88a0 100644 --- a/substrate/frame/scheduler/src/lib.rs +++ b/substrate/frame/scheduler/src/lib.rs @@ -105,7 +105,7 @@ use scale_info::TypeInfo; use sp_io::hashing::blake2_256; use sp_runtime::{ traits::{BadOrigin, BlockNumberProvider, Dispatchable, One, Saturating, Zero}, - BoundedVec, DispatchError, RuntimeDebug, + BoundedVec, Debug, DispatchError, }; pub use pallet::*; @@ -129,7 +129,7 @@ pub type BlockNumberFor = #[derive( Clone, Copy, - RuntimeDebug, + Debug, PartialEq, Eq, Encode, @@ -148,7 +148,7 @@ pub struct RetryConfig { } #[cfg_attr(any(feature = "std", test), derive(PartialEq, Eq))] -#[derive(Clone, RuntimeDebug, Encode, Decode)] +#[derive(Clone, Debug, Encode, Decode)] struct ScheduledV1 { maybe_id: Option>, priority: schedule::Priority, @@ -158,15 +158,7 @@ struct ScheduledV1 { /// Information regarding an item to be executed in the future. #[derive( - Clone, - RuntimeDebug, - PartialEq, - Eq, - Encode, - Decode, - MaxEncodedLen, - TypeInfo, - DecodeWithMemTracking, + Clone, Debug, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo, DecodeWithMemTracking, )] pub struct Scheduled { /// The unique identity for this task, if there is one. diff --git a/substrate/frame/society/src/lib.rs b/substrate/frame/society/src/lib.rs index 954f1622a4346..9d5c09c96b5e7 100644 --- a/substrate/frame/society/src/lib.rs +++ b/substrate/frame/society/src/lib.rs @@ -285,7 +285,7 @@ use sp_runtime::{ TrailingZeroInput, Zero, }, ArithmeticError::Overflow, - Percent, RuntimeDebug, + Debug, Percent, }; pub use weights::WeightInfo; @@ -303,14 +303,14 @@ pub type NegativeImbalanceOf = <>::Currency as Currency< >>::NegativeImbalance; pub type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct Vote { pub approve: bool, pub weight: u32, } /// A judgement by the suspension judgement origin on a suspended candidate. -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub enum Judgement { /// The suspension judgement origin takes no direct judgment /// and places the candidate back into the bid pool. @@ -322,9 +322,7 @@ pub enum Judgement { } /// Details of a payout given as a per-block linear "trickle". -#[derive( - Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen, -)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, Default, TypeInfo, MaxEncodedLen)] pub struct Payout { /// Total value of the payout. pub value: Balance, @@ -337,7 +335,7 @@ pub struct Payout { } /// Status of a vouching member. -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub enum VouchingStatus { /// Member is currently vouching for a user. Vouching, @@ -349,7 +347,7 @@ pub enum VouchingStatus { pub type StrikeCount = u32; /// A bid for entry into society. -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct Bid { /// The bidder/candidate trying to enter society pub who: AccountId, @@ -369,9 +367,7 @@ pub type Rank = u32; pub type VoteCount = u32; /// Tally of votes. -#[derive( - Default, Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen, -)] +#[derive(Default, Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct Tally { /// The approval votes. pub approvals: VoteCount, @@ -398,7 +394,7 @@ impl Tally { } /// A bid for entry into society. -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct Candidacy { /// The index of the round where the candidacy began. pub round: RoundIndex, @@ -413,7 +409,7 @@ pub struct Candidacy { } /// A vote by a member on a candidate application. -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub enum BidKind { /// The given deposit was paid for this bid. Deposit(Balance), @@ -432,7 +428,7 @@ pub type PayoutsFor = BoundedVec<(BlockNumberFor, BalanceOf), >::MaxPayouts>; /// Information concerning a member. -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct MemberRecord { pub rank: Rank, pub strikes: StrikeCount, @@ -441,7 +437,7 @@ pub struct MemberRecord { } /// Information concerning a member. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, Default, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo, Default, MaxEncodedLen)] pub struct PayoutRecord { pub paid: Balance, pub payouts: PayoutsVec, @@ -453,7 +449,7 @@ pub type PayoutRecordFor = PayoutRecord< >; /// Record for an individual new member who was elevated from a candidate recently. -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub struct IntakeRecord { pub who: AccountId, pub bid: Balance, @@ -471,7 +467,7 @@ pub type IntakeRecordFor = Clone, PartialEq, Eq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] diff --git a/substrate/frame/society/src/migrations.rs b/substrate/frame/society/src/migrations.rs index 45bd977535d5f..57c009fa5304c 100644 --- a/substrate/frame/society/src/migrations.rs +++ b/substrate/frame/society/src/migrations.rs @@ -109,7 +109,7 @@ pub(crate) mod v0 { use frame_support::storage_alias; /// A vote by a member on a candidate application. - #[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] + #[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo)] pub enum Vote { /// The member has been chosen to be skeptic and has not yet taken any action. Skeptic, diff --git a/substrate/frame/src/lib.rs b/substrate/frame/src/lib.rs index bfcc8fe44c51e..a314c2a02ba15 100644 --- a/substrate/frame/src/lib.rs +++ b/substrate/frame/src/lib.rs @@ -563,7 +563,7 @@ pub mod derive { pub use core::fmt::Debug; pub use frame_support::{ CloneNoBound, DebugNoBound, DefaultNoBound, EqNoBound, OrdNoBound, PartialEqNoBound, - PartialOrdNoBound, RuntimeDebugNoBound, + PartialOrdNoBound, }; pub use scale_info::TypeInfo; pub use serde; @@ -573,7 +573,6 @@ pub mod derive { /// or specify the `#[serde(crate = "PATH_TO_THIS_CRATE::serde")]` attribute that points /// to the path where serde can be found. pub use serde::{Deserialize, Serialize}; - pub use sp_runtime::RuntimeDebug; } /// All hashing related components. diff --git a/substrate/frame/staking-async/ah-client/src/lib.rs b/substrate/frame/staking-async/ah-client/src/lib.rs index b1c0e9d46894f..e16dbf3e839b9 100644 --- a/substrate/frame/staking-async/ah-client/src/lib.rs +++ b/substrate/frame/staking-async/ah-client/src/lib.rs @@ -142,7 +142,7 @@ impl Se Clone, PartialEq, Eq, - RuntimeDebug, + Debug, serde::Serialize, serde::Deserialize, )] @@ -493,7 +493,7 @@ pub mod pallet { /// These variants are emitted as [`Event::Unexpected`] and indicate a defensive check has /// failed. While these should never occur under normal operation, they are useful for /// diagnosing issues in production or test environments. - #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, RuntimeDebug)] + #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, Debug)] pub enum UnexpectedKind { /// A validator set was received while the pallet is in [`OperatingMode::Passive`]. ReceivedValidatorSetWhilePassive, diff --git a/substrate/frame/staking-async/rc-client/src/lib.rs b/substrate/frame/staking-async/rc-client/src/lib.rs index f9f4f86bba824..dfcee1f6e02d1 100644 --- a/substrate/frame/staking-async/rc-client/src/lib.rs +++ b/substrate/frame/staking-async/rc-client/src/lib.rs @@ -770,7 +770,7 @@ pub mod pallet { /// These variants are emitted as [`Event::Unexpected`] and indicate a defensive check has /// failed. While these should never occur under normal operation, they are useful for /// diagnosing issues in production or test environments. - #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, RuntimeDebug)] + #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, Debug)] pub enum UnexpectedKind { /// We could not merge the chunks, and therefore dropped the session report. SessionReportIntegrityFailed, diff --git a/substrate/frame/staking-async/runtimes/parachain/src/governance/origins.rs b/substrate/frame/staking-async/runtimes/parachain/src/governance/origins.rs index da3a12449e3fa..1c9c7ee0d965c 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/governance/origins.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/governance/origins.rs @@ -31,15 +31,7 @@ pub mod pallet_custom_origins { pub struct Pallet(_); #[derive( - PartialEq, - Eq, - Clone, - MaxEncodedLen, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - RuntimeDebug, + PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug, )] #[pallet::origin] pub enum Origin { diff --git a/substrate/frame/staking-async/runtimes/parachain/src/lib.rs b/substrate/frame/staking-async/runtimes/parachain/src/lib.rs index ad42ee31662e0..7522820a0cc52 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/lib.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/lib.rs @@ -85,7 +85,7 @@ use sp_runtime::{ generic, impl_opaque_keys, traits::{AccountIdConversion, BlakeTwo256, Block as BlockT, ConvertInto, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, Perbill, Permill, RuntimeDebug, + ApplyExtrinsicResult, Debug, Perbill, Permill, }; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -638,7 +638,7 @@ parameter_types! { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/substrate/frame/staking-async/runtimes/rc/src/governance/origins.rs b/substrate/frame/staking-async/runtimes/rc/src/governance/origins.rs index dfcac957bb1a6..ef476c3a1aa71 100644 --- a/substrate/frame/staking-async/runtimes/rc/src/governance/origins.rs +++ b/substrate/frame/staking-async/runtimes/rc/src/governance/origins.rs @@ -30,15 +30,7 @@ pub mod pallet_custom_origins { pub struct Pallet(_); #[derive( - PartialEq, - Eq, - Clone, - MaxEncodedLen, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, - RuntimeDebug, + PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug, )] #[pallet::origin] pub enum Origin { diff --git a/substrate/frame/staking-async/runtimes/rc/src/lib.rs b/substrate/frame/staking-async/runtimes/rc/src/lib.rs index 53edb28ceccd9..c0b61628114c9 100644 --- a/substrate/frame/staking-async/runtimes/rc/src/lib.rs +++ b/substrate/frame/staking-async/runtimes/rc/src/lib.rs @@ -100,7 +100,7 @@ use sp_consensus_beefy::{ ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature}, mmr::{BeefyDataProvider, MmrLeafVersion}, }; -use sp_core::{ConstU8, ConstUint, OpaqueMetadata, RuntimeDebug, H256}; +use sp_core::{ConstU8, ConstUint, OpaqueMetadata, H256}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; use sp_runtime::{ @@ -1302,7 +1302,7 @@ parameter_types! { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, )] diff --git a/substrate/frame/staking-async/src/lib.rs b/substrate/frame/staking-async/src/lib.rs index 80c32b06ca251..90c3864642a4f 100644 --- a/substrate/frame/staking-async/src/lib.rs +++ b/substrate/frame/staking-async/src/lib.rs @@ -204,15 +204,14 @@ use frame_support::{ tokens::fungible::{Credit, Debt}, ConstU32, Contains, Get, LockIdentifier, }, - BoundedVec, DebugNoBound, DefaultNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, - WeakBoundedVec, + BoundedVec, DebugNoBound, DefaultNoBound, EqNoBound, PartialEqNoBound, WeakBoundedVec, }; use frame_system::pallet_prelude::BlockNumberFor; use ledger::LedgerIntegrityState; use scale_info::TypeInfo; use sp_runtime::{ traits::{AtLeast32BitUnsigned, One, StaticLookup, UniqueSaturatedInto}, - BoundedBTreeMap, Perbill, RuntimeDebug, Saturating, + BoundedBTreeMap, Debug, Perbill, Saturating, }; use sp_staking::{EraIndex, ExposurePage, PagedExposureMetadata, SessionIndex}; pub use sp_staking::{Exposure, IndividualExposure, StakerStatus}; @@ -270,7 +269,7 @@ pub type NegativeImbalanceOf = type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; /// Information regarding the active era (era in used in session). -#[derive(Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen, PartialEq, Eq, Clone)] +#[derive(Encode, Decode, Debug, TypeInfo, MaxEncodedLen, PartialEq, Eq, Clone)] pub struct ActiveEraInfo { /// Index of era. pub index: EraIndex, @@ -305,7 +304,7 @@ pub struct EraRewardPoints { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -332,7 +331,7 @@ pub enum RewardDestination { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, Default, MaxEncodedLen, @@ -362,7 +361,7 @@ pub enum SnapshotStatus { /// A record of the nominations made by a specific account. #[derive( - PartialEqNoBound, EqNoBound, Clone, Encode, Decode, RuntimeDebugNoBound, TypeInfo, MaxEncodedLen, + PartialEqNoBound, EqNoBound, Clone, Encode, Decode, DebugNoBound, TypeInfo, MaxEncodedLen, )] #[codec(mel_bound())] #[scale_info(skip_type_params(T))] @@ -384,7 +383,7 @@ pub struct Nominations { /// /// This is useful where we need to take into account the validator's own stake and total exposure /// in consideration, in addition to the individual nominators backing them. -#[derive(Encode, Decode, RuntimeDebug, TypeInfo, PartialEq, Eq)] +#[derive(Encode, Decode, Debug, TypeInfo, PartialEq, Eq)] pub struct PagedExposure { exposure_metadata: PagedExposureMetadata, exposure_page: ExposurePage, @@ -506,7 +505,7 @@ impl EraPayout for () { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, serde::Serialize, diff --git a/substrate/frame/staking-async/src/pallet/mod.rs b/substrate/frame/staking-async/src/pallet/mod.rs index f99c8b3e47392..b035e4e955a2c 100644 --- a/substrate/frame/staking-async/src/pallet/mod.rs +++ b/substrate/frame/staking-async/src/pallet/mod.rs @@ -72,7 +72,7 @@ pub mod pallet { use frame_support::{weights::WeightMeter, DefaultNoBound}; /// Represents the current step in the era pruning process - #[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] + #[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub enum PruningStep { /// Pruning ErasStakersPaged storage ErasStakersPaged, @@ -1202,7 +1202,7 @@ pub mod pallet { /// These variants are emitted as [`Event::Unexpected`] and indicate a defensive check has /// failed. While these should never occur under normal operation, they are useful for /// diagnosing issues in production or test environments. - #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, RuntimeDebug)] + #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, Debug)] pub enum UnexpectedKind { /// Emitted when calculated era duration exceeds the configured maximum. EraDurationBoundExceeded, diff --git a/substrate/frame/staking-async/src/slashing.rs b/substrate/frame/staking-async/src/slashing.rs index ad8c62910cf2d..2f3aabee0d78a 100644 --- a/substrate/frame/staking-async/src/slashing.rs +++ b/substrate/frame/staking-async/src/slashing.rs @@ -51,7 +51,7 @@ use frame_support::traits::{Defensive, DefensiveSaturating, Get, Imbalance, OnUn use scale_info::TypeInfo; use sp_runtime::{ traits::{Saturating, Zero}, - RuntimeDebug, WeakBoundedVec, Weight, + Debug, WeakBoundedVec, Weight, }; use sp_staking::{EraIndex, StakingInterface}; @@ -77,7 +77,7 @@ pub(crate) struct SlashParams<'a, T: 'a + Config> { /// Represents an offence record within the staking system, capturing details about a slashing /// event. -#[derive(Clone, Encode, Decode, TypeInfo, MaxEncodedLen, PartialEq, RuntimeDebug)] +#[derive(Clone, Encode, Decode, TypeInfo, MaxEncodedLen, PartialEq, Debug)] pub struct OffenceRecord { /// The account ID of the entity that reported the offence. pub reporter: Option, diff --git a/substrate/frame/staking/src/lib.rs b/substrate/frame/staking/src/lib.rs index 1d13172090bc0..76257e5f833ee 100644 --- a/substrate/frame/staking/src/lib.rs +++ b/substrate/frame/staking/src/lib.rs @@ -319,13 +319,13 @@ use frame_support::{ ConstU32, Contains, Defensive, DefensiveMax, DefensiveSaturating, Get, LockIdentifier, }, weights::Weight, - BoundedVec, CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, + BoundedVec, CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound, }; use scale_info::TypeInfo; use sp_runtime::{ curve::PiecewiseLinear, traits::{AtLeast32BitUnsigned, Convert, StaticLookup, Zero}, - Perbill, Perquintill, Rounding, RuntimeDebug, Saturating, + Debug, Perbill, Perquintill, Rounding, Saturating, }; use sp_staking::{ offence::{Offence, OffenceError, OffenceSeverity, ReportOffence}, @@ -375,15 +375,7 @@ type AccountIdLookupOf = <::Lookup as StaticLookup /// Information regarding the active era (era in used in session). #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, - PartialEq, - Eq, + Encode, Decode, DecodeWithMemTracking, Clone, Debug, TypeInfo, MaxEncodedLen, PartialEq, Eq, )] pub struct ActiveEraInfo { /// Index of era. @@ -398,7 +390,7 @@ pub struct ActiveEraInfo { /// Reward points of an era. Used to split era total payout between validators. /// /// This points will be used to reward validators and their respective nominators. -#[derive(Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo, Clone, PartialEq, Eq)] +#[derive(Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, Clone, PartialEq, Eq)] pub struct EraRewardPoints { /// Total number of points. Equals the sum of reward points for each validator. pub total: RewardPoint, @@ -421,7 +413,7 @@ impl Default for EraRewardPoints { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -448,7 +440,7 @@ pub enum RewardDestination { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, Default, MaxEncodedLen, @@ -466,15 +458,7 @@ pub struct ValidatorPrefs { /// Just a Balance/BlockNumber tuple to encode when a chunk of funds will be unlocked. #[derive( - PartialEq, - Eq, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, MaxEncodedLen, )] pub struct UnlockChunk { /// Amount of funds to be unlocked. @@ -501,7 +485,7 @@ pub struct UnlockChunk { Encode, Decode, DecodeWithMemTracking, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, MaxEncodedLen, )] @@ -816,7 +800,7 @@ impl StakingLedger { Encode, Decode, DecodeWithMemTracking, - RuntimeDebugNoBound, + DebugNoBound, TypeInfo, MaxEncodedLen, )] @@ -840,7 +824,7 @@ pub struct Nominations { /// /// This is useful where we need to take into account the validator's own stake and total exposure /// in consideration, in addition to the individual nominators backing them. -#[derive(Encode, Decode, RuntimeDebug, TypeInfo, PartialEq, Eq)] +#[derive(Encode, Decode, Debug, TypeInfo, PartialEq, Eq)] pub struct PagedExposure { exposure_metadata: PagedExposureMetadata, exposure_page: ExposurePage, @@ -885,7 +869,7 @@ impl { /// The stash ID of the offending validator. pub validator: AccountId, @@ -1050,7 +1034,7 @@ where Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, serde::Serialize, diff --git a/substrate/frame/staking/src/migrations.rs b/substrate/frame/staking/src/migrations.rs index e24d5f372e5b6..7f62e21fd7a64 100644 --- a/substrate/frame/staking/src/migrations.rs +++ b/substrate/frame/staking/src/migrations.rs @@ -31,7 +31,7 @@ use sp_runtime::TryRuntimeError; /// Used for release versioning up to v12. /// /// Obsolete from v13. Keeping around to make encoding/decoding of old migration code easier. -#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] enum ObsoleteReleases { V5_0_0, // blockable validators. V6_0_0, // removal of all storage associated with offchain phragmen. diff --git a/substrate/frame/staking/src/slashing.rs b/substrate/frame/staking/src/slashing.rs index 477a6e0486f48..0092a2b332b96 100644 --- a/substrate/frame/staking/src/slashing.rs +++ b/substrate/frame/staking/src/slashing.rs @@ -63,7 +63,7 @@ use frame_support::{ use scale_info::TypeInfo; use sp_runtime::{ traits::{Saturating, Zero}, - DispatchResult, RuntimeDebug, + Debug, DispatchResult, }; use sp_staking::{EraIndex, StakingInterface}; @@ -75,7 +75,7 @@ const REWARD_F1: Perbill = Perbill::from_percent(50); pub type SpanIndex = u32; // A range of start..end eras for a slashing span. -#[derive(Encode, Decode, Clone, TypeInfo, RuntimeDebug, PartialEq, Eq)] +#[derive(Encode, Decode, Clone, TypeInfo, Debug, PartialEq, Eq)] pub struct SlashingSpan { pub index: SpanIndex, pub start: EraIndex, @@ -89,7 +89,7 @@ impl SlashingSpan { } /// An encoding of all of a nominator's slashing spans. -#[derive(Encode, Decode, Clone, TypeInfo, RuntimeDebug, PartialEq, Eq)] +#[derive(Encode, Decode, Clone, TypeInfo, Debug, PartialEq, Eq)] pub struct SlashingSpans { // the index of the current slashing span of the nominator. different for // every stash, resets when the account hits free balance 0. @@ -197,7 +197,7 @@ impl SlashingSpans { MaxEncodedLen, PartialEq, Eq, - RuntimeDebug, + Debug, )] pub struct SpanRecord { pub slashed: Balance, diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/call.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/call.rs index f2ec55945fe76..bcc2ff0f6661c 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/expand/call.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/expand/call.rs @@ -66,7 +66,7 @@ pub fn expand_outer_dispatch( #scrate::__private::codec::Decode, #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::scale_info::TypeInfo, - #scrate::__private::RuntimeDebug, + #scrate::__private::Debug, )] pub enum RuntimeCall { #variant_defs diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/freeze_reason.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/freeze_reason.rs index b36d54fb79e60..7bb9dc541114b 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/expand/freeze_reason.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/expand/freeze_reason.rs @@ -63,7 +63,7 @@ pub fn expand_outer_freeze_reason(pallet_decls: &[Pallet], scrate: &TokenStream) #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, #scrate::__private::scale_info::TypeInfo, - #scrate::__private::RuntimeDebug, + #scrate::__private::Debug, )] pub enum RuntimeFreezeReason { #( #freeze_reason_variants )* diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/hold_reason.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/hold_reason.rs index b729c3d0a19c4..a71f8a03fe0d8 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/expand/hold_reason.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/expand/hold_reason.rs @@ -63,7 +63,7 @@ pub fn expand_outer_hold_reason(pallet_decls: &[Pallet], scrate: &TokenStream) - #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, #scrate::__private::scale_info::TypeInfo, - #scrate::__private::RuntimeDebug, + #scrate::__private::Debug, )] pub enum RuntimeHoldReason { #( #hold_reason_variants )* diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/lock_id.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/lock_id.rs index 902acc58d5ab2..b8fddda8bff1d 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/expand/lock_id.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/expand/lock_id.rs @@ -56,7 +56,7 @@ pub fn expand_outer_lock_id(pallet_decls: &[Pallet], scrate: &TokenStream) -> To #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, #scrate::__private::scale_info::TypeInfo, - #scrate::__private::RuntimeDebug, + #scrate::__private::Debug, )] pub enum RuntimeLockId { #( #lock_id_variants )* diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/slash_reason.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/slash_reason.rs index a0e441dec26a3..3cc3634b1db85 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/expand/slash_reason.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/expand/slash_reason.rs @@ -56,7 +56,7 @@ pub fn expand_outer_slash_reason(pallet_decls: &[Pallet], scrate: &TokenStream) #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, #scrate::__private::scale_info::TypeInfo, - #scrate::__private::RuntimeDebug, + #scrate::__private::Debug, )] pub enum RuntimeSlashReason { #( #slash_reason_variants )* diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/task.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/task.rs index b1cf4f858de11..0486d401706cc 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/expand/task.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/expand/task.rs @@ -90,7 +90,7 @@ pub fn expand_outer_task( #scrate::__private::codec::Decode, #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::scale_info::TypeInfo, - #scrate::__private::RuntimeDebug, + #scrate::__private::Debug, )] pub enum RuntimeTask { #( #task_variants )* diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/view_function.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/view_function.rs index 082a2e6ea3076..3272d563926cc 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/expand/view_function.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/expand/view_function.rs @@ -45,7 +45,7 @@ pub fn expand_outer_query( #scrate::__private::codec::Decode, #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::scale_info::TypeInfo, - #scrate::__private::RuntimeDebug, + #scrate::__private::Debug, )] pub enum #runtime_view_function {} diff --git a/substrate/frame/support/procedural/src/construct_runtime/mod.rs b/substrate/frame/support/procedural/src/construct_runtime/mod.rs index 8e326972a2732..fa4f2f1ac3878 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/mod.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/mod.rs @@ -445,7 +445,7 @@ fn construct_runtime_final_expansion( }; #[derive( - Clone, Copy, PartialEq, Eq, #scrate::sp_runtime::RuntimeDebug, + Clone, Copy, PartialEq, Eq, core::fmt::Debug, #scrate::__private::scale_info::TypeInfo )] pub struct #name; diff --git a/substrate/frame/support/procedural/src/dynamic_params.rs b/substrate/frame/support/procedural/src/dynamic_params.rs index 9cc04e8a1647a..ed75b6cf63c6e 100644 --- a/substrate/frame/support/procedural/src/dynamic_params.rs +++ b/substrate/frame/support/procedural/src/dynamic_params.rs @@ -268,7 +268,7 @@ impl ToTokens for DynamicPalletParamAttr { #scrate::__private::codec::Decode, #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, - #scrate::__private::RuntimeDebug, + core::fmt::Debug, #scrate::__private::scale_info::TypeInfo )] #vis enum Parameters { @@ -287,7 +287,7 @@ impl ToTokens for DynamicPalletParamAttr { #scrate::__private::codec::Decode, #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, - #scrate::__private::RuntimeDebug, + core::fmt::Debug, #scrate::__private::scale_info::TypeInfo )] #vis enum #key_ident { @@ -306,7 +306,7 @@ impl ToTokens for DynamicPalletParamAttr { #scrate::__private::codec::Decode, #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, - #scrate::__private::RuntimeDebug, + core::fmt::Debug, #scrate::__private::scale_info::TypeInfo )] #vis enum #value_ident { @@ -341,7 +341,7 @@ impl ToTokens for DynamicPalletParamAttr { #scrate::__private::codec::Decode, #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, - #scrate::__private::RuntimeDebug, + core::fmt::Debug, #scrate::__private::scale_info::TypeInfo )] #vis struct #key_names; @@ -391,7 +391,7 @@ impl ToTokens for DynamicPalletParamAttr { Clone, PartialEq, Eq, - #scrate::sp_runtime::RuntimeDebug, + core::fmt::Debug, )] #vis struct #key_values(pub #value_types); @@ -479,7 +479,7 @@ impl ToTokens for DynamicParamAggregatedEnum { #scrate::__private::codec::Decode, #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, - #scrate::sp_runtime::RuntimeDebug, + core::fmt::Debug, #scrate::__private::scale_info::TypeInfo )] #vis enum #name { @@ -499,7 +499,7 @@ impl ToTokens for DynamicParamAggregatedEnum { #scrate::__private::codec::Decode, #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, - #scrate::sp_runtime::RuntimeDebug, + core::fmt::Debug, #scrate::__private::scale_info::TypeInfo )] #vis enum #params_key_ident { @@ -518,7 +518,7 @@ impl ToTokens for DynamicParamAggregatedEnum { #scrate::__private::codec::Decode, #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, - #scrate::sp_runtime::RuntimeDebug, + core::fmt::Debug, #scrate::__private::scale_info::TypeInfo )] #vis enum #params_value_ident { diff --git a/substrate/frame/support/procedural/src/lib.rs b/substrate/frame/support/procedural/src/lib.rs index d06bd41e0a0b1..30e372d1aaa09 100644 --- a/substrate/frame/support/procedural/src/lib.rs +++ b/substrate/frame/support/procedural/src/lib.rs @@ -316,47 +316,6 @@ pub fn derive_debug_no_bound(input: TokenStream) -> TokenStream { no_bound::debug::derive_debug_no_bound(input) } -/// Derive [`Debug`], if `std` is enabled it uses `frame_support::DebugNoBound`, if `std` is not -/// enabled it just returns `""`. -/// This behaviour is useful to prevent bloating the runtime WASM blob from unneeded code. -#[proc_macro_derive(RuntimeDebugNoBound)] -pub fn derive_runtime_debug_no_bound(input: TokenStream) -> TokenStream { - let try_runtime_or_std_impl: proc_macro2::TokenStream = - no_bound::debug::derive_debug_no_bound(input.clone()).into(); - - let stripped_impl = { - let input = syn::parse_macro_input!(input as syn::DeriveInput); - - let name = &input.ident; - let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); - - quote::quote!( - const _: () = { - impl #impl_generics ::core::fmt::Debug for #name #ty_generics #where_clause { - fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> core::fmt::Result { - fmt.write_str("") - } - } - }; - ) - }; - - let frame_support = match generate_access_from_frame_or_crate("frame-support") { - Ok(frame_support) => frame_support, - Err(e) => return e.to_compile_error().into(), - }; - - quote::quote!( - #frame_support::try_runtime_or_std_enabled! { - #try_runtime_or_std_impl - } - #frame_support::try_runtime_and_std_not_enabled! { - #stripped_impl - } - ) - .into() -} - /// Derive [`PartialEq`] but do not bound any generic. /// /// Docs at `frame_support::PartialEqNoBound`. diff --git a/substrate/frame/support/procedural/src/pallet/expand/call.rs b/substrate/frame/support/procedural/src/pallet/expand/call.rs index 52829d4e1c9dd..698ea520449dd 100644 --- a/substrate/frame/support/procedural/src/pallet/expand/call.rs +++ b/substrate/frame/support/procedural/src/pallet/expand/call.rs @@ -388,7 +388,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream { #( #[doc = #docs] )* #[derive( - #frame_support::RuntimeDebugNoBound, + #frame_support::DebugNoBound, #frame_support::CloneNoBound, #frame_support::EqNoBound, #frame_support::PartialEqNoBound, diff --git a/substrate/frame/support/procedural/src/pallet/expand/pallet_struct.rs b/substrate/frame/support/procedural/src/pallet/expand/pallet_struct.rs index 747d9832d7d5b..80e8fe9d8080d 100644 --- a/substrate/frame/support/procedural/src/pallet/expand/pallet_struct.rs +++ b/substrate/frame/support/procedural/src/pallet/expand/pallet_struct.rs @@ -79,7 +79,7 @@ pub fn expand_pallet_struct(def: &mut Def) -> proc_macro2::TokenStream { #frame_support::CloneNoBound, #frame_support::EqNoBound, #frame_support::PartialEqNoBound, - #frame_support::RuntimeDebugNoBound, + #frame_support::DebugNoBound, )] )); diff --git a/substrate/frame/support/procedural/src/pallet/expand/view_functions.rs b/substrate/frame/support/procedural/src/pallet/expand/view_functions.rs index d856b8c05d8bb..30b57d110b732 100644 --- a/substrate/frame/support/procedural/src/pallet/expand/view_functions.rs +++ b/substrate/frame/support/procedural/src/pallet/expand/view_functions.rs @@ -102,7 +102,7 @@ fn expand_view_function( #( #[doc = #docs] )* #[allow(missing_docs)] #[derive( - #frame_support::RuntimeDebugNoBound, + #frame_support::DebugNoBound, #frame_support::CloneNoBound, #frame_support::EqNoBound, #frame_support::PartialEqNoBound, diff --git a/substrate/frame/support/procedural/src/pallet/parse/composite.rs b/substrate/frame/support/procedural/src/pallet/parse/composite.rs index b3131d29f338b..ff3cbd1d4950c 100644 --- a/substrate/frame/support/procedural/src/pallet/parse/composite.rs +++ b/substrate/frame/support/procedural/src/pallet/parse/composite.rs @@ -156,7 +156,7 @@ impl CompositeDef { #scrate::__private::codec::DecodeWithMemTracking, #scrate::__private::codec::MaxEncodedLen, #scrate::__private::scale_info::TypeInfo, - #scrate::__private::RuntimeDebug, + #scrate::__private::Debug, )] }; item.attrs.push(derive_attr); diff --git a/substrate/frame/support/procedural/src/runtime/expand/mod.rs b/substrate/frame/support/procedural/src/runtime/expand/mod.rs index ae466db5b68aa..0733ebf21301a 100644 --- a/substrate/frame/support/procedural/src/runtime/expand/mod.rs +++ b/substrate/frame/support/procedural/src/runtime/expand/mod.rs @@ -258,7 +258,7 @@ fn construct_runtime_final_expansion( }; #[derive( - Clone, Copy, PartialEq, Eq, #scrate::sp_runtime::RuntimeDebug, + Clone, Copy, PartialEq, Eq, core::fmt::Debug, #scrate::__private::scale_info::TypeInfo )] pub struct #name; diff --git a/substrate/frame/support/src/instances.rs b/substrate/frame/support/src/instances.rs index ecb356af50b6f..1428b3903884f 100644 --- a/substrate/frame/support/src/instances.rs +++ b/substrate/frame/support/src/instances.rs @@ -34,80 +34,80 @@ /// `Instance1` to be used for instantiable pallets defined with the /// [`#[pallet]`](`frame_support::pallet`) macro. Instances 2-16 are also available but are hidden /// from docs. -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance1; /// `Instance2` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance2; /// `Instance3` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance3; /// `Instance4` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance4; /// `Instance5` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance5; /// `Instance6` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance6; /// `Instance7` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance7; /// `Instance8` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance8; /// `Instance9` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance9; /// `Instance10` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance10; /// `Instance11` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance11; /// `Instance12` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance12; /// `Instance13` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance13; /// `Instance14` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance14; /// `Instance15` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance15; /// `Instance16` to be used for instantiable pallets defined with the `#[pallet]` macro. #[doc(hidden)] -#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)] +#[derive(Clone, Copy, PartialEq, Eq, crate::DebugNoBound)] pub struct Instance16; diff --git a/substrate/frame/support/src/lib.rs b/substrate/frame/support/src/lib.rs index 92e4aded8e688..b26e94e36b58c 100644 --- a/substrate/frame/support/src/lib.rs +++ b/substrate/frame/support/src/lib.rs @@ -71,7 +71,7 @@ pub mod __private { pub use sp_runtime::{bounded_btree_map, bounded_vec}; pub use sp_runtime::{ traits::{AsSystemOriginSigner, AsTransactionAuthorizedOrigin, Dispatchable}, - DispatchError, RuntimeDebug, StateVersion, TransactionOutcome, + DispatchError, StateVersion, TransactionOutcome, }; #[cfg(feature = "std")] pub use sp_state_machine::BasicExternalities; @@ -204,7 +204,7 @@ pub mod dynamic_params { #[doc(inline)] pub use frame_support_procedural::{ - construct_runtime, match_and_insert, transactional, PalletError, RuntimeDebugNoBound, + construct_runtime, match_and_insert, transactional, PalletError, }; pub use frame_support_procedural::runtime; @@ -438,7 +438,7 @@ pub mod pallet_prelude { StorageVersion, Task, TypedGet, }, Blake2_128, Blake2_128Concat, Blake2_256, CloneNoBound, DebugNoBound, EqNoBound, Identity, - PartialEqNoBound, RuntimeDebugNoBound, Twox128, Twox256, Twox64Concat, + PartialEqNoBound, Twox128, Twox256, Twox64Concat, }; pub use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; pub use core::marker::PhantomData; @@ -457,7 +457,7 @@ pub mod pallet_prelude { TransactionTag, TransactionValidity, TransactionValidityError, TransactionValidityWithRefund, UnknownTransaction, ValidTransaction, }, - DispatchError, RuntimeDebug, MAX_MODULE_ERROR_ENCODED_SIZE, + Debug, DispatchError, MAX_MODULE_ERROR_ENCODED_SIZE, }; pub use sp_weights::Weight; } @@ -564,7 +564,7 @@ pub mod pallet_prelude { /// frame_support::CloneNoBound, /// frame_support::EqNoBound, /// frame_support::PartialEqNoBound, -/// frame_support::RuntimeDebugNoBound, +/// frame_support::DebugNoBound, /// )] /// ``` /// and replaces the type `_` with `PhantomData`. @@ -1183,7 +1183,7 @@ pub mod pallet_macros { /// /// ```ignore /// Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, MaxEncodedLen, TypeInfo, - /// RuntimeDebug + /// Debug /// ``` /// /// For ease of usage, when no `#[derive]` attributes are found for the enum under @@ -1433,7 +1433,7 @@ pub mod pallet_macros { /// * `#[derive(`[`frame_support::CloneNoBound`]`)]` /// * `#[derive(`[`frame_support::EqNoBound`]`)]` /// * `#[derive(`[`frame_support::PartialEqNoBound`]`)]` - /// * `#[derive(`[`frame_support::RuntimeDebugNoBound`]`)]` + /// * `#[derive(`[`frame_support::DebugNoBound`]`)]` /// * `#[derive(`[`codec::Encode`]`)]` /// * `#[derive(`[`codec::Decode`]`)]` /// @@ -2231,7 +2231,7 @@ pub mod pallet_macros { /// # pub struct Pallet(_); /// /// On the spot declaration. /// #[pallet::origin] - /// #[derive(PartialEq, Eq, Clone, RuntimeDebug, Encode, Decode, TypeInfo, MaxEncodedLen)] + /// #[derive(PartialEq, Eq, Clone, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)] /// pub enum Origin { /// Foo, /// Bar, @@ -2249,7 +2249,7 @@ pub mod pallet_macros { /// # pub trait Config: frame_system::Config {} /// # #[pallet::pallet] /// # pub struct Pallet(_); - /// #[derive(PartialEq, Eq, Clone, RuntimeDebug, Encode, Decode, TypeInfo, MaxEncodedLen)] + /// #[derive(PartialEq, Eq, Clone, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)] /// pub enum RawOrigin { /// Foo, /// Bar, diff --git a/substrate/frame/support/src/traits/messages.rs b/substrate/frame/support/src/traits/messages.rs index 0a5c70f8f0fa5..24a4e56acc3b7 100644 --- a/substrate/frame/support/src/traits/messages.rs +++ b/substrate/frame/support/src/traits/messages.rs @@ -25,7 +25,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode, FullCodec, MaxEncodedLen}; use core::{cmp::Ordering, fmt::Debug, marker::PhantomData}; use scale_info::TypeInfo; use sp_core::{ConstU32, Get, TypedGet}; -use sp_runtime::{traits::Convert, BoundedSlice, RuntimeDebug}; +use sp_runtime::{traits::Convert, BoundedSlice}; use sp_weights::{Weight, WeightMeter}; /// Errors that can happen when attempting to process a message with @@ -71,7 +71,7 @@ pub trait ProcessMessage { /// Errors that can happen when attempting to execute an overweight message with /// [`ServiceQueues::execute_overweight()`]. -#[derive(Eq, PartialEq, RuntimeDebug)] +#[derive(Eq, PartialEq, Debug)] pub enum ExecuteOverweightError { /// The referenced message was not found. NotFound, @@ -155,7 +155,7 @@ impl EnqueueMessage for () { } /// The resource footprint of a queue. -#[derive(Default, Copy, Clone, Eq, PartialEq, RuntimeDebug)] +#[derive(Default, Copy, Clone, Eq, PartialEq, Debug)] pub struct QueueFootprint { /// The number of pages in the queue (including overweight pages). pub pages: u32, @@ -166,7 +166,7 @@ pub struct QueueFootprint { } /// The resource footprint of a batch of messages. -#[derive(Default, Copy, Clone, PartialEq, RuntimeDebug)] +#[derive(Default, Copy, Clone, PartialEq, Debug)] pub struct BatchFootprint { /// The number of messages in the batch. pub msgs_count: usize, @@ -181,7 +181,7 @@ pub struct BatchFootprint { /// For a set of messages `xcms[0..n]`, each `footprints[i]` contains the footprint /// of the batch `xcms[0..i]`, so as `i` increases `footprints[i]` contains the footprint /// of a bigger batch. -#[derive(Default, RuntimeDebug)] +#[derive(Default, Debug)] pub struct BatchesFootprints { /// The position in the first available MQ page where the batch will start being appended. /// diff --git a/substrate/frame/support/src/traits/metadata.rs b/substrate/frame/support/src/traits/metadata.rs index 1ab644f893f26..d921c9e9ce592 100644 --- a/substrate/frame/support/src/traits/metadata.rs +++ b/substrate/frame/support/src/traits/metadata.rs @@ -21,7 +21,7 @@ use alloc::{vec, vec::Vec}; use codec::{Decode, Encode}; use core::ops::Add; use impl_trait_for_tuples::impl_for_tuples; -use sp_runtime::RuntimeDebug; +use Debug; /// Provides information about the pallet itself and its setup in the runtime. /// @@ -41,7 +41,7 @@ pub trait PalletInfo { } /// Information regarding an instance of a pallet. -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, RuntimeDebug)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)] pub struct PalletInfoData { /// Index of the pallet as configured in the runtime. pub index: usize, @@ -96,7 +96,7 @@ impl PalletsInfoAccess for Tuple { } /// The function and pallet name of the Call. -#[derive(Clone, Eq, PartialEq, Default, RuntimeDebug)] +#[derive(Clone, Eq, PartialEq, Default, Debug)] pub struct CallMetadata { /// Name of the function. pub function_name: &'static str, diff --git a/substrate/frame/support/src/traits/preimages.rs b/substrate/frame/support/src/traits/preimages.rs index e0c76b8bdff81..f407d0cf7a52c 100644 --- a/substrate/frame/support/src/traits/preimages.rs +++ b/substrate/frame/support/src/traits/preimages.rs @@ -20,11 +20,11 @@ use alloc::borrow::Cow; use codec::{Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen}; use scale_info::TypeInfo; -use sp_core::RuntimeDebug; use sp_runtime::{ traits::{ConstU32, Hash}, DispatchError, }; +use Debug; pub type BoundedInline = crate::BoundedVec>; @@ -32,15 +32,7 @@ pub type BoundedInline = crate::BoundedVec>; const MAX_LEGACY_LEN: u32 = 1_000_000; #[derive( - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - Clone, - Eq, - PartialEq, - TypeInfo, - RuntimeDebug, + Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, Clone, Eq, PartialEq, TypeInfo, Debug, )] #[codec(mel_bound())] pub enum Bounded { diff --git a/substrate/frame/support/src/traits/reality.rs b/substrate/frame/support/src/traits/reality.rs index 5538a3b1353e6..781185a5a31bc 100644 --- a/substrate/frame/support/src/traits/reality.rs +++ b/substrate/frame/support/src/traits/reality.rs @@ -23,7 +23,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode, FullCodec, MaxEncodedLen}; use frame_support::{CloneNoBound, EqNoBound, Parameter, PartialEqNoBound}; use scale_info::TypeInfo; use sp_core::ConstU32; -use sp_runtime::{traits::Member, BoundedVec, DispatchError, DispatchResult, RuntimeDebug}; +use sp_runtime::{traits::Member, BoundedVec, DispatchError, DispatchResult}; /// Identity of personhood. /// @@ -65,15 +65,7 @@ pub type JudgementContext = BoundedVec>; /// The [`Alias`] type enriched with the originating [`Context`]. #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - MaxEncodedLen, - TypeInfo, - DecodeWithMemTracking, + Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo, DecodeWithMemTracking, )] pub struct ContextualAlias { /// The alias of the person. @@ -188,7 +180,7 @@ pub trait CountedMembers { Copy, PartialEq, Eq, - RuntimeDebug, + Debug, Encode, Decode, MaxEncodedLen, @@ -210,7 +202,7 @@ pub enum Truth { Copy, PartialEq, Eq, - RuntimeDebug, + Debug, Encode, Decode, MaxEncodedLen, @@ -242,15 +234,7 @@ pub mod identity { /// Social platforms that statement oracles support. #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - MaxEncodedLen, - TypeInfo, - DecodeWithMemTracking, + Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo, DecodeWithMemTracking, )] pub enum Social { Twitter { username: Data }, @@ -269,7 +253,7 @@ pub mod identity { } /// A statement upon which a [`StatementOracle`] can provide judgement. -#[derive(Clone, PartialEq, Eq, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)] pub enum Statement { /// Ask for whether evidence exists to confirm that a particular social credential on a /// supported platform belongs to a person. @@ -291,7 +275,7 @@ pub enum Statement { /// Describes the location within the runtime of a callback, along with other type information such /// as parameters passed into the callback. #[derive( - CloneNoBound, PartialEqNoBound, EqNoBound, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo, + CloneNoBound, PartialEqNoBound, EqNoBound, Debug, Encode, Decode, MaxEncodedLen, TypeInfo, )] #[scale_info(skip_type_params(Params, RuntimeCall))] #[codec(mel_bound())] diff --git a/substrate/frame/support/src/traits/schedule.rs b/substrate/frame/support/src/traits/schedule.rs index 2bf53d5f45a98..784cd1aaddb68 100644 --- a/substrate/frame/support/src/traits/schedule.rs +++ b/substrate/frame/support/src/traits/schedule.rs @@ -23,7 +23,7 @@ use alloc::vec::Vec; use codec::{Codec, Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen}; use core::{fmt::Debug, result::Result}; use scale_info::TypeInfo; -use sp_runtime::{traits::Saturating, DispatchError, RuntimeDebug}; +use sp_runtime::{traits::Saturating, DispatchError}; /// Information relating to the period of a scheduled task. First item is the length of the /// period and the second is the number of times it should be executed in total before the task @@ -43,7 +43,7 @@ pub type Priority = u8; Clone, PartialEq, Eq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -73,7 +73,7 @@ pub const HARD_DEADLINE: Priority = 63; pub const LOWEST_PRIORITY: Priority = 255; /// Type representing an encodable value or the hash of the encoding of such a value. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub enum MaybeHashed { /// The value itself. Value(T), @@ -88,7 +88,7 @@ impl From for MaybeHashed { } /// Error type for `MaybeHashed::lookup`. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] pub enum LookupError { /// A call of this hash was not known. Unknown, diff --git a/substrate/frame/support/src/traits/storage.rs b/substrate/frame/support/src/traits/storage.rs index 774f6db4de657..1e3df63b3cda4 100644 --- a/substrate/frame/support/src/traits/storage.rs +++ b/substrate/frame/support/src/traits/storage.rs @@ -27,7 +27,7 @@ pub use sp_core::storage::TrackedStorageKey; use sp_core::Get; use sp_runtime::{ traits::{Convert, Member}, - DispatchError, RuntimeDebug, + Debug, DispatchError, }; /// An instance of a pallet in the storage. @@ -162,7 +162,7 @@ impl WhitelistedStorageKeys for Tuple { /// The resource footprint of a bunch of blobs. We assume only the number of blobs and their total /// size in bytes matter. -#[derive(Default, Copy, Clone, Eq, PartialEq, RuntimeDebug)] +#[derive(Default, Copy, Clone, Eq, PartialEq, Debug)] pub struct Footprint { /// The number of blobs. pub count: u64, diff --git a/substrate/frame/support/src/traits/tokens/asset_ops/common_strategies.rs b/substrate/frame/support/src/traits/tokens/asset_ops/common_strategies.rs index 77d17112c0ea3..2c20be7b4dde7 100644 --- a/substrate/frame/support/src/traits/tokens/asset_ops/common_strategies.rs +++ b/substrate/frame/support/src/traits/tokens/asset_ops/common_strategies.rs @@ -20,8 +20,8 @@ use super::*; use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; -use sp_core::RuntimeDebug; use sp_runtime::traits::Convert; +use Debug; /// The `CheckState` is a strategy that accepts an `Inspect` value and the `Inner` strategy. /// @@ -173,7 +173,7 @@ impl UpdateStrategy for Bytes { /// The `Owner` strategy is both [inspect](InspectStrategy) and [update](UpdateStrategy) strategy /// allows getting and setting the owner of an asset. -#[derive(RuntimeDebug, PartialEq, Eq, Clone, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, MaxEncodedLen, TypeInfo)] pub struct Owner(PhantomData); impl Default for Owner { fn default() -> Self { @@ -190,7 +190,7 @@ impl UpdateStrategy for Owner { /// The `Admin` strategy is both [inspect](InspectStrategy) and [update](UpdateStrategy) strategy /// allows getting and setting the admin of an asset. -#[derive(RuntimeDebug, PartialEq, Eq, Clone, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, MaxEncodedLen, TypeInfo)] pub struct Admin(PhantomData); impl Default for Admin { fn default() -> Self { @@ -215,7 +215,7 @@ impl UpdateStrategy for Admin { /// data. The said extrinsic, in turn, could use the destroy operation with the `WithWitness` /// strategy, which will compare the provided witness with the actual chain state before attempting /// the collection destruction. -#[derive(RuntimeDebug, PartialEq, Eq, Clone, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, MaxEncodedLen, TypeInfo)] pub struct Witness(PhantomData); impl Default for Witness { fn default() -> Self { @@ -354,7 +354,7 @@ pub type PredefinedId = DeriveAndReportId; /// /// An example of ID derivation is the creation of an NFT inside a collection using the /// collection ID as `Params`. The `ReportedId` in this case is the full ID of the NFT. -#[derive(RuntimeDebug, PartialEq, Eq, Clone, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, MaxEncodedLen, TypeInfo)] pub struct DeriveAndReportId { pub params: Params, _phantom: PhantomData, @@ -437,7 +437,7 @@ impl WithConfigValue for T { /// PredefinedId::from(ASSET_ID), /// )) /// ``` -#[derive(RuntimeDebug, PartialEq, Eq, Clone, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode, MaxEncodedLen, TypeInfo)] pub struct WithConfig { pub config: ConfigValue, pub extra: Extra, diff --git a/substrate/frame/support/src/traits/tokens/fungible/imbalance.rs b/substrate/frame/support/src/traits/tokens/fungible/imbalance.rs index b6a686c3cd2bb..ca530d6afd96a 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/imbalance.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/imbalance.rs @@ -30,7 +30,7 @@ use crate::{ }, }; use core::marker::PhantomData; -use frame_support_procedural::{EqNoBound, PartialEqNoBound, RuntimeDebugNoBound}; +use frame_support_procedural::{DebugNoBound, EqNoBound, PartialEqNoBound}; use sp_runtime::traits::Zero; /// Handler for when an imbalance gets dropped. This could handle either a credit (negative) or @@ -53,7 +53,7 @@ impl HandleImbalanceDrop for () { #[derive( EqNoBound, PartialEqNoBound, - RuntimeDebugNoBound, + DebugNoBound, Encode, Decode, DecodeWithMemTracking, diff --git a/substrate/frame/support/src/traits/tokens/fungible/mod.rs b/substrate/frame/support/src/traits/tokens/fungible/mod.rs index 31f8e0150ca6e..13994a355229e 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/mod.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/mod.rs @@ -163,7 +163,7 @@ mod union_of; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::marker::PhantomData; -use frame_support_procedural::{CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound}; +use frame_support_procedural::{CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound}; use scale_info::TypeInfo; #[cfg(feature = "runtime-benchmarks")] use sp_runtime::Saturating; @@ -199,14 +199,7 @@ use crate::{ /// The aggregate amount frozen under `R::get()` for any account which has multiple tickets, /// is the *cumulative* amounts of each ticket's footprint (each individually determined by `D`). #[derive( - CloneNoBound, - EqNoBound, - PartialEqNoBound, - Encode, - Decode, - TypeInfo, - MaxEncodedLen, - RuntimeDebugNoBound, + CloneNoBound, EqNoBound, PartialEqNoBound, Encode, Decode, TypeInfo, MaxEncodedLen, DebugNoBound, )] #[scale_info(skip_type_params(A, F, R, D, Fp))] #[codec(mel_bound())] @@ -269,7 +262,7 @@ impl< DecodeWithMemTracking, TypeInfo, MaxEncodedLen, - RuntimeDebugNoBound, + DebugNoBound, )] #[scale_info(skip_type_params(A, F, R, D, Fp))] #[codec(mel_bound())] @@ -336,14 +329,7 @@ impl< /// track the specific balance which is frozen. If you are uncertain then use `FreezeConsideration` /// instead, since this works in all circumstances. #[derive( - CloneNoBound, - EqNoBound, - PartialEqNoBound, - Encode, - Decode, - TypeInfo, - MaxEncodedLen, - RuntimeDebugNoBound, + CloneNoBound, EqNoBound, PartialEqNoBound, Encode, Decode, TypeInfo, MaxEncodedLen, DebugNoBound, )] #[scale_info(skip_type_params(A, Fx, Rx, D, Fp))] #[codec(mel_bound())] @@ -381,14 +367,7 @@ impl< /// track the specific balance which is frozen. If you are uncertain then use `FreezeConsideration` /// instead, since this works in all circumstances. #[derive( - CloneNoBound, - EqNoBound, - PartialEqNoBound, - Encode, - Decode, - TypeInfo, - MaxEncodedLen, - RuntimeDebugNoBound, + CloneNoBound, EqNoBound, PartialEqNoBound, Encode, Decode, TypeInfo, MaxEncodedLen, DebugNoBound, )] #[scale_info(skip_type_params(A, Fx, Rx, D, Fp))] #[codec(mel_bound())] diff --git a/substrate/frame/support/src/traits/tokens/fungible/union_of.rs b/substrate/frame/support/src/traits/tokens/fungible/union_of.rs index f8d476d517fe4..fd99ba33163fd 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/union_of.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/union_of.rs @@ -33,15 +33,14 @@ use frame_support::traits::{ use scale_info::TypeInfo; use sp_runtime::{ traits::Convert, - DispatchError, DispatchResult, Either, + Debug, DispatchError, DispatchResult, Either, Either::{Left, Right}, - RuntimeDebug, }; /// The `NativeOrWithId` enum classifies an asset as either `Native` to the current chain or as an /// asset with a specific ID. #[derive( - Decode, DecodeWithMemTracking, Encode, Default, MaxEncodedLen, TypeInfo, Clone, RuntimeDebug, Eq, + Decode, DecodeWithMemTracking, Encode, Default, MaxEncodedLen, TypeInfo, Clone, Debug, Eq, )] pub enum NativeOrWithId where diff --git a/substrate/frame/support/src/traits/tokens/fungibles/imbalance.rs b/substrate/frame/support/src/traits/tokens/fungibles/imbalance.rs index 349d9d7c65e89..49e9a7459c2d4 100644 --- a/substrate/frame/support/src/traits/tokens/fungibles/imbalance.rs +++ b/substrate/frame/support/src/traits/tokens/fungibles/imbalance.rs @@ -30,7 +30,7 @@ use crate::traits::{ }, }; use core::marker::PhantomData; -use frame_support_procedural::{EqNoBound, PartialEqNoBound, RuntimeDebugNoBound}; +use frame_support_procedural::{DebugNoBound, EqNoBound, PartialEqNoBound}; use sp_runtime::traits::Zero; /// Handler for when an imbalance gets dropped. This could handle either a credit (negative) or @@ -45,7 +45,7 @@ pub trait HandleImbalanceDrop { /// /// Importantly, it has a special `Drop` impl, and cannot be created outside of this module. #[must_use] -#[derive(EqNoBound, PartialEqNoBound, RuntimeDebugNoBound)] +#[derive(EqNoBound, PartialEqNoBound, DebugNoBound)] pub struct Imbalance< A: AssetId, B: Balance, diff --git a/substrate/frame/support/src/traits/tokens/misc.rs b/substrate/frame/support/src/traits/tokens/misc.rs index 7d0719990443f..f6bcb69153a36 100644 --- a/substrate/frame/support/src/traits/tokens/misc.rs +++ b/substrate/frame/support/src/traits/tokens/misc.rs @@ -22,14 +22,13 @@ use alloc::{vec, vec::Vec}; use codec::{Decode, DecodeWithMemTracking, Encode, FullCodec, HasCompact, MaxEncodedLen}; use core::fmt::Debug; use sp_arithmetic::traits::{AtLeast32BitUnsigned, Zero}; -use sp_core::RuntimeDebug; use sp_runtime::{ traits::{Convert, MaybeSerializeDeserialize}, ArithmeticError, DispatchError, TokenError, }; /// The origin of funds to be used for a deposit operation. -#[derive(Copy, Clone, RuntimeDebug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum Provenance { /// The funds will be minted into the system, increasing total issuance (and potentially /// causing an overflow there). @@ -39,7 +38,7 @@ pub enum Provenance { } /// The mode under which usage of funds may be restricted. -#[derive(Copy, Clone, RuntimeDebug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum Restriction { /// Funds are under the normal conditions. Free, @@ -48,7 +47,7 @@ pub enum Restriction { } /// The mode by which we describe whether an operation should keep an account alive. -#[derive(Copy, Clone, RuntimeDebug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum Preservation { /// We don't care if the account gets killed by this operation. Expendable, @@ -60,7 +59,7 @@ pub enum Preservation { } /// The privilege with which a withdraw operation is conducted. -#[derive(Copy, Clone, RuntimeDebug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum Fortitude { /// The operation should execute with regular privilege. Polite, @@ -71,7 +70,7 @@ pub enum Fortitude { /// The precision required of an operation generally involving some aspect of quantitative fund /// withdrawal or transfer. -#[derive(Copy, Clone, RuntimeDebug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum Precision { /// The operation should must either proceed either exactly according to the amounts involved /// or not at all. @@ -82,7 +81,7 @@ pub enum Precision { } /// One of a number of consequences of withdrawing a fungible from an account. -#[derive(Copy, Clone, RuntimeDebug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum WithdrawConsequence { /// Withdraw could not happen since the amount to be withdrawn is less than the total funds in /// the account. @@ -128,7 +127,7 @@ impl WithdrawConsequence { } /// One of a number of consequences of withdrawing a fungible from an account. -#[derive(Copy, Clone, RuntimeDebug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum DepositConsequence { /// Deposit couldn't happen due to the amount being too low. This is usually because the /// account doesn't yet exist and the deposit wouldn't bring it to at least the minimum needed @@ -166,7 +165,7 @@ impl DepositConsequence { } /// Simple boolean for whether an account needs to be kept in existence. -#[derive(Copy, Clone, RuntimeDebug, Eq, PartialEq)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum ExistenceRequirement { /// Operation must not result in the account going out of existence. /// @@ -186,7 +185,7 @@ pub enum ExistenceRequirement { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, scale_info::TypeInfo, MaxEncodedLen, )] @@ -409,15 +408,7 @@ impl> GetSalary for ConvertRank { /// An identifier and balance. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - RuntimeDebug, - MaxEncodedLen, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug, MaxEncodedLen, TypeInfo, )] pub struct IdAmount { /// An identifier for this item. diff --git a/substrate/frame/support/src/traits/tokens/transfer.rs b/substrate/frame/support/src/traits/tokens/transfer.rs index c901398a7d54d..b5e306d176434 100644 --- a/substrate/frame/support/src/traits/tokens/transfer.rs +++ b/substrate/frame/support/src/traits/tokens/transfer.rs @@ -21,7 +21,6 @@ use crate::pallet_prelude::{Decode, Encode}; use core::fmt::Debug; use frame_support::traits::tokens::PaymentStatus; use scale_info::TypeInfo; -use sp_debug_derive::RuntimeDebug; use sp_runtime::codec::{FullCodec, MaxEncodedLen}; /// Is intended to be implemented using a `fungible` impl, but can also be implemented with @@ -82,7 +81,7 @@ pub trait Transfer { } /// Status for making a payment via the `Pay::pay` trait function. -#[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, RuntimeDebug)] +#[derive(Encode, Decode, Eq, PartialEq, Clone, TypeInfo, MaxEncodedLen, Debug)] pub enum TransferStatus { /// Payment is in progress. Nothing to report yet. InProgress, diff --git a/substrate/frame/support/src/view_functions.rs b/substrate/frame/support/src/view_functions.rs index cba451b554eb6..2dd00661385bc 100644 --- a/substrate/frame/support/src/view_functions.rs +++ b/substrate/frame/support/src/view_functions.rs @@ -20,10 +20,10 @@ use alloc::vec::Vec; use codec::{Decode, DecodeAll, Encode, Output}; use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; +use Debug; /// The unique identifier for a view function. -#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, Debug, TypeInfo)] pub struct ViewFunctionId { /// The part of the id for dispatching view functions from the top level of the runtime. /// @@ -44,7 +44,7 @@ impl From for [u8; 32] { } /// Error type for view function dispatching. -#[derive(Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Debug, TypeInfo)] pub enum ViewFunctionDispatchError { /// View functions are not implemented for this runtime. NotImplemented, diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr index ef647463e893f..c65ede148badd 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/deprecated_where_block.stderr @@ -433,7 +433,6 @@ error[E0277]: the trait bound `Runtime: Config` is not satisfied | = help: the trait `Callable` is implemented for `Pallet` = note: required for `Pallet` to implement `Callable` - = note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::RuntimeDebug` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: the method `get_dispatch_info` exists for reference `&Call`, but its trait bounds were not satisfied --> tests/construct_runtime_ui/deprecated_where_block.rs:20:1 diff --git a/substrate/frame/support/test/tests/derive_no_bound.rs b/substrate/frame/support/test/tests/derive_no_bound.rs index 6fc4ea12c5131..1cec168feb693 100644 --- a/substrate/frame/support/test/tests/derive_no_bound.rs +++ b/substrate/frame/support/test/tests/derive_no_bound.rs @@ -16,14 +16,14 @@ // limitations under the License. //! Tests for DebugNoBound, CloneNoBound, EqNoBound, PartialEqNoBound, DefaultNoBound, -//! RuntimeDebugNoBound, PartialOrdNoBound and OrdNoBound +//! DebugNoBound, PartialOrdNoBound and OrdNoBound use frame_support::{ CloneNoBound, DebugNoBound, DefaultNoBound, EqNoBound, OrdNoBound, PartialEqNoBound, - PartialOrdNoBound, RuntimeDebugNoBound, + PartialOrdNoBound, }; -#[derive(RuntimeDebugNoBound)] +#[derive(DebugNoBound)] #[allow(dead_code)] struct Unnamed(u64); diff --git a/substrate/frame/support/test/tests/enum_deprecation.rs b/substrate/frame/support/test/tests/enum_deprecation.rs index 50e1f5ff2c956..5eed1b9910434 100644 --- a/substrate/frame/support/test/tests/enum_deprecation.rs +++ b/substrate/frame/support/test/tests/enum_deprecation.rs @@ -96,7 +96,7 @@ pub mod pallet { #[pallet::origin] #[derive( EqNoBound, - RuntimeDebugNoBound, + DebugNoBound, CloneNoBound, PartialEqNoBound, PartialOrdNoBound, diff --git a/substrate/frame/support/test/tests/instance.rs b/substrate/frame/support/test/tests/instance.rs index 3069ef44eb134..6b7a169a9e588 100644 --- a/substrate/frame/support/test/tests/instance.rs +++ b/substrate/frame/support/test/tests/instance.rs @@ -114,15 +114,7 @@ mod module1 { #[pallet::origin] #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, + Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, )] #[scale_info(skip_type_params(I))] pub enum Origin { @@ -230,15 +222,7 @@ mod module2 { #[pallet::origin] #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, + Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, )] #[scale_info(skip_type_params(I))] pub enum Origin { diff --git a/substrate/frame/support/test/tests/origin.rs b/substrate/frame/support/test/tests/origin.rs index 81e7f46189290..2b65e0f17f1f7 100644 --- a/substrate/frame/support/test/tests/origin.rs +++ b/substrate/frame/support/test/tests/origin.rs @@ -53,7 +53,7 @@ mod nested { Clone, PartialEq, Eq, - RuntimeDebug, + Debug, Encode, Decode, DecodeWithMemTracking, @@ -131,15 +131,7 @@ pub mod module { #[pallet::origin] #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, + Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, )] pub struct Origin(pub PhantomData); diff --git a/substrate/frame/support/test/tests/pallet.rs b/substrate/frame/support/test/tests/pallet.rs index bd3240d391762..7d50c0008a843 100644 --- a/substrate/frame/support/test/tests/pallet.rs +++ b/substrate/frame/support/test/tests/pallet.rs @@ -491,7 +491,7 @@ pub mod pallet { #[pallet::origin] #[derive( EqNoBound, - RuntimeDebugNoBound, + DebugNoBound, CloneNoBound, PartialEqNoBound, PartialOrdNoBound, @@ -563,7 +563,7 @@ pub mod pallet { Staking, } - #[derive(codec::Encode, sp_runtime::RuntimeDebug)] + #[derive(codec::Encode, Debug)] #[cfg_attr(feature = "std", derive(codec::Decode))] pub enum InherentError { Fatal, diff --git a/substrate/frame/support/test/tests/pallet_instance.rs b/substrate/frame/support/test/tests/pallet_instance.rs index 7593c42e76f98..0ab763eaa89cd 100644 --- a/substrate/frame/support/test/tests/pallet_instance.rs +++ b/substrate/frame/support/test/tests/pallet_instance.rs @@ -207,7 +207,7 @@ pub mod pallet { #[pallet::origin] #[derive( EqNoBound, - RuntimeDebugNoBound, + DebugNoBound, CloneNoBound, PartialEqNoBound, PartialOrdNoBound, @@ -248,7 +248,7 @@ pub mod pallet { } } - #[derive(codec::Encode, sp_runtime::RuntimeDebug)] + #[derive(codec::Encode, Debug)] #[cfg_attr(feature = "std", derive(codec::Decode))] pub enum InherentError {} diff --git a/substrate/frame/support/test/tests/runtime.rs b/substrate/frame/support/test/tests/runtime.rs index 5f89c5bfc94ec..416fae5feb5fc 100644 --- a/substrate/frame/support/test/tests/runtime.rs +++ b/substrate/frame/support/test/tests/runtime.rs @@ -66,15 +66,7 @@ mod module1 { #[pallet::origin] #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, + Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, )] #[scale_info(skip_type_params(I))] pub struct Origin(pub PhantomData<(T, I)>); @@ -121,15 +113,7 @@ mod module2 { #[pallet::origin] #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, + Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, )] pub struct Origin; @@ -182,7 +166,7 @@ mod nested { Clone, PartialEq, Eq, - RuntimeDebug, + Debug, Encode, Decode, DecodeWithMemTracking, @@ -272,15 +256,7 @@ pub mod module3 { #[pallet::origin] #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, + Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, )] pub struct Origin(pub PhantomData); diff --git a/substrate/frame/support/test/tests/runtime_legacy_ordering.rs b/substrate/frame/support/test/tests/runtime_legacy_ordering.rs index c2163cddb057d..e25c803a56a34 100644 --- a/substrate/frame/support/test/tests/runtime_legacy_ordering.rs +++ b/substrate/frame/support/test/tests/runtime_legacy_ordering.rs @@ -66,15 +66,7 @@ mod module1 { #[pallet::origin] #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, + Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, )] #[scale_info(skip_type_params(I))] pub struct Origin(pub PhantomData<(T, I)>); @@ -121,15 +113,7 @@ mod module2 { #[pallet::origin] #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, + Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, )] pub struct Origin; @@ -182,7 +166,7 @@ mod nested { Clone, PartialEq, Eq, - RuntimeDebug, + Debug, Encode, Decode, DecodeWithMemTracking, @@ -272,15 +256,7 @@ pub mod module3 { #[pallet::origin] #[derive( - Clone, - PartialEq, - Eq, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - TypeInfo, + Clone, PartialEq, Eq, Debug, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, )] pub struct Origin(pub PhantomData); diff --git a/substrate/frame/system/src/extensions/authorize_call.rs b/substrate/frame/system/src/extensions/authorize_call.rs index e41b7adde04d8..b6f97f01e8d16 100644 --- a/substrate/frame/system/src/extensions/authorize_call.rs +++ b/substrate/frame/system/src/extensions/authorize_call.rs @@ -22,7 +22,7 @@ use frame_support::{ Decode, DecodeWithMemTracking, DispatchResult, Encode, TransactionSource, TypeInfo, Weight, }, traits::Authorize, - CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, + CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound, }; use sp_runtime::{ traits::{ @@ -44,7 +44,7 @@ use sp_runtime::{ EqNoBound, PartialEqNoBound, TypeInfo, - RuntimeDebugNoBound, + DebugNoBound, DecodeWithMemTracking, )] #[scale_info(skip_type_params(T))] diff --git a/substrate/frame/system/src/extensions/check_nonce.rs b/substrate/frame/system/src/extensions/check_nonce.rs index 535d69510759a..c18b217307082 100644 --- a/substrate/frame/system/src/extensions/check_nonce.rs +++ b/substrate/frame/system/src/extensions/check_nonce.rs @@ -21,9 +21,7 @@ use alloc::{vec, vec::Vec}; use crate::Config; use codec::{Decode, DecodeWithMemTracking, Encode}; -use frame_support::{ - dispatch::DispatchInfo, pallet_prelude::TransactionSource, RuntimeDebugNoBound, -}; +use frame_support::{dispatch::DispatchInfo, pallet_prelude::TransactionSource, DebugNoBound}; use scale_info::TypeInfo; use sp_runtime::{ traits::{ @@ -120,7 +118,7 @@ impl core::fmt::Debug for CheckNonce { } /// Operation to perform from `validate` to `prepare` in [`CheckNonce`] transaction extension. -#[derive(RuntimeDebugNoBound)] +#[derive(DebugNoBound)] pub enum Val { /// Account and its nonce to check for. CheckNonce(T::AccountId), @@ -130,7 +128,7 @@ pub enum Val { /// Operation to perform from `prepare` to `post_dispatch_details` in [`CheckNonce`] transaction /// extension. -#[derive(RuntimeDebugNoBound)] +#[derive(DebugNoBound)] pub enum Pre { /// The transaction extension weight should not be refunded. NonceChecked, diff --git a/substrate/frame/system/src/lib.rs b/substrate/frame/system/src/lib.rs index 229671cb4f85e..869ca1ef1da04 100644 --- a/substrate/frame/system/src/lib.rs +++ b/substrate/frame/system/src/lib.rs @@ -118,7 +118,7 @@ use sp_runtime::{ InvalidTransaction, TransactionLongevity, TransactionSource, TransactionValidity, ValidTransaction, }, - DispatchError, RuntimeDebug, + DispatchError, }; use sp_version::RuntimeVersion; @@ -285,16 +285,7 @@ where /// [`ExtrinsicSuccess`](Event::ExtrinsicSuccess) and [`ExtrinsicFailed`](Event::ExtrinsicFailed) /// events. #[derive( - Clone, - Copy, - Eq, - PartialEq, - Default, - RuntimeDebug, - Encode, - Decode, - DecodeWithMemTracking, - TypeInfo, + Clone, Copy, Eq, PartialEq, Default, Debug, Encode, Decode, DecodeWithMemTracking, TypeInfo, )] pub struct DispatchEventInfo { /// Weight of this transaction. @@ -1185,7 +1176,7 @@ pub type Key = Vec; pub type KeyValue = (Vec, Vec); /// A phase of a block's execution. -#[derive(Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Debug, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "std", derive(Serialize, PartialEq, Eq, Clone))] pub enum Phase { /// Applying an extrinsic. @@ -1203,7 +1194,7 @@ impl Default for Phase { } /// Record of an event happening. -#[derive(Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(Serialize, PartialEq, Eq, Clone))] pub struct EventRecord { /// The phase of the block it happened in. @@ -1232,7 +1223,7 @@ type EventIndex = u32; pub type RefCount = u32; /// Information of an account. -#[derive(Clone, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Eq, PartialEq, Default, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)] pub struct AccountInfo { /// The number of transactions this account has sent. pub nonce: Nonce, @@ -1252,7 +1243,7 @@ pub struct AccountInfo { /// Stores the `spec_version` and `spec_name` of when the last runtime upgrade /// happened. -#[derive(RuntimeDebug, Encode, Decode, TypeInfo)] +#[derive(Debug, Encode, Decode, TypeInfo)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct LastRuntimeUpgradeInfo { pub spec_version: codec::Compact, @@ -1510,14 +1501,14 @@ where } /// Reference status; can be either referenced or unreferenced. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub enum RefStatus { Referenced, Unreferenced, } /// Some resultant status relevant to incrementing a provider/self-sufficient reference. -#[derive(Eq, PartialEq, RuntimeDebug)] +#[derive(Eq, PartialEq, Debug)] pub enum IncRefStatus { /// Account was created. Created, @@ -1526,7 +1517,7 @@ pub enum IncRefStatus { } /// Some resultant status relevant to decrementing a provider/self-sufficient reference. -#[derive(Eq, PartialEq, RuntimeDebug)] +#[derive(Eq, PartialEq, Debug)] pub enum DecRefStatus { /// Account was destroyed. Reaped, diff --git a/substrate/frame/system/src/limits.rs b/substrate/frame/system/src/limits.rs index ab5a98a6b9745..0bf6025e96bc7 100644 --- a/substrate/frame/system/src/limits.rs +++ b/substrate/frame/system/src/limits.rs @@ -30,10 +30,10 @@ use frame_support::{ weights::{constants, Weight}, }; use scale_info::TypeInfo; -use sp_runtime::{traits::Bounded, Perbill, RuntimeDebug}; +use sp_runtime::{traits::Bounded, Perbill}; /// Block length limit configuration. -#[derive(RuntimeDebug, Clone, codec::Encode, codec::Decode, TypeInfo)] +#[derive(Debug, Clone, codec::Encode, codec::Decode, TypeInfo)] pub struct BlockLength { /// Maximal total length in bytes for each extrinsic class. /// @@ -69,7 +69,7 @@ impl BlockLength { } } -#[derive(Default, RuntimeDebug)] +#[derive(Default, Debug)] pub struct ValidationErrors { pub has_errors: bool, #[cfg(feature = "std")] @@ -95,7 +95,7 @@ pub type ValidationResult = Result; const DEFAULT_NORMAL_RATIO: Perbill = Perbill::from_percent(75); /// `DispatchClass`-specific weight configuration. -#[derive(RuntimeDebug, Clone, codec::Encode, codec::Decode, TypeInfo)] +#[derive(Debug, Clone, codec::Encode, codec::Decode, TypeInfo)] pub struct WeightsPerClass { /// Base weight of single extrinsic of given class. pub base_extrinsic: Weight, @@ -195,7 +195,7 @@ pub struct WeightsPerClass { /// /// As a consequence of `reserved` space, total consumed block weight might exceed `max_block` /// value, so this parameter should rather be thought of as "target block weight" than a hard limit. -#[derive(RuntimeDebug, Clone, codec::Encode, codec::Decode, TypeInfo)] +#[derive(Debug, Clone, codec::Encode, codec::Decode, TypeInfo)] pub struct BlockWeights { /// Base weight of block execution. pub base_block: Weight, diff --git a/substrate/frame/system/src/migrations/mod.rs b/substrate/frame/system/src/migrations/mod.rs index 7c69843d73f10..2404cdde2afc7 100644 --- a/substrate/frame/system/src/migrations/mod.rs +++ b/substrate/frame/system/src/migrations/mod.rs @@ -23,13 +23,13 @@ use codec::{Decode, Encode, FullCodec}; use frame_support::{ pallet_prelude::ValueQuery, traits::PalletInfoAccess, weights::Weight, Blake2_128Concat, }; -use sp_runtime::RuntimeDebug; +use Debug; /// Type used to encode the number of references an account has. type RefCount = u32; /// Information of an account. -#[derive(Clone, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode)] +#[derive(Clone, Eq, PartialEq, Default, Debug, Encode, Decode)] struct AccountInfo { nonce: Nonce, consumers: RefCount, diff --git a/substrate/frame/system/src/offchain.rs b/substrate/frame/system/src/offchain.rs index 64ba3df24ac0f..f04064b6013a6 100644 --- a/substrate/frame/system/src/offchain.rs +++ b/substrate/frame/system/src/offchain.rs @@ -62,7 +62,7 @@ use scale_info::TypeInfo; use sp_runtime::{ app_crypto::RuntimeAppPublic, traits::{ExtrinsicLike, IdentifyAccount, One}, - RuntimeDebug, + Debug, }; /// Marker struct used to flag using all supported keys to sign a payload. @@ -102,7 +102,7 @@ where /// The signer is then able to: /// - Submit a unsigned transaction with a signed payload /// - Submit a signed transaction -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct Signer, X = ForAny> { accounts: Option>, _phantom: core::marker::PhantomData<(X, C)>, @@ -320,7 +320,7 @@ impl, C: AppCrypto { /// Index on the provided list of accounts or list of all accounts. pub index: usize, diff --git a/substrate/frame/tips/src/lib.rs b/substrate/frame/tips/src/lib.rs index 900f1bdfb6785..206a2118c2c9c 100644 --- a/substrate/frame/tips/src/lib.rs +++ b/substrate/frame/tips/src/lib.rs @@ -64,7 +64,7 @@ extern crate alloc; use sp_runtime::{ traits::{AccountIdConversion, BadOrigin, Hash, StaticLookup, TrailingZeroInput, Zero}, - Percent, RuntimeDebug, + Debug, Percent, }; use alloc::{vec, vec::Vec}; @@ -93,7 +93,7 @@ type AccountIdLookupOf = <::Lookup as StaticLookup /// An open tipping "motion". Retains all details of a tip including information on the finder /// and the members who have voted. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, scale_info::TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, scale_info::TypeInfo)] pub struct OpenTip< AccountId: Parameter, Balance: Parameter, @@ -597,7 +597,7 @@ impl, I: 'static> Pallet { pub fn migrate_retract_tip_for_tip_new(module: &[u8], item: &[u8]) { /// An open tipping "motion". Retains all details of a tip including information on the /// finder and the members who have voted. - #[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug)] + #[derive(Clone, Eq, PartialEq, Encode, Decode, Debug)] pub struct OldOpenTip< AccountId: Parameter, Balance: Parameter, diff --git a/substrate/frame/tips/src/tests.rs b/substrate/frame/tips/src/tests.rs index b769ea5b3e753..052a425981edd 100644 --- a/substrate/frame/tips/src/tests.rs +++ b/substrate/frame/tips/src/tests.rs @@ -438,7 +438,7 @@ fn tip_changing_works() { fn test_last_reward_migration() { let mut s = Storage::default(); - #[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug)] + #[derive(Clone, Eq, PartialEq, Encode, Decode, Debug)] pub struct OldOpenTip< AccountId: Parameter, Balance: Parameter, diff --git a/substrate/frame/transaction-payment/src/lib.rs b/substrate/frame/transaction-payment/src/lib.rs index 4c20b0fdd298f..b26450ea27662 100644 --- a/substrate/frame/transaction-payment/src/lib.rs +++ b/substrate/frame/transaction-payment/src/lib.rs @@ -57,7 +57,7 @@ use frame_support::{ pallet_prelude::TransactionSource, traits::{Defensive, EstimateCallFee, Get, Imbalance, SuppressedDrop}, weights::{Weight, WeightToFee}, - RuntimeDebugNoBound, + DebugNoBound, }; pub use pallet::*; pub use payment::*; @@ -67,7 +67,7 @@ use sp_runtime::{ Saturating, TransactionExtension, Zero, }, transaction_validity::{TransactionPriority, TransactionValidityError, ValidTransaction}, - FixedPointNumber, FixedU128, Perbill, Perquintill, RuntimeDebug, + Debug, FixedPointNumber, FixedU128, Perbill, Perquintill, }; pub use types::{FeeDetails, InclusionFee, RuntimeDispatchInfo}; pub use weights::WeightInfo; @@ -299,7 +299,7 @@ where } /// Storage releases of the pallet. -#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] pub enum Releases { /// Original version of the pallet. V1Ancient, @@ -941,7 +941,7 @@ impl core::fmt::Debug for ChargeTransactionPayment { } /// The info passed between the validate and prepare steps for the `ChargeAssetTxPayment` extension. -#[derive(RuntimeDebugNoBound)] +#[derive(DebugNoBound)] pub enum Val { Charge { tip: BalanceOf, diff --git a/substrate/frame/transaction-storage/src/lib.rs b/substrate/frame/transaction-storage/src/lib.rs index c97f46ab31f4c..a6db1b565cc32 100644 --- a/substrate/frame/transaction-storage/src/lib.rs +++ b/substrate/frame/transaction-storage/src/lib.rs @@ -65,16 +65,7 @@ pub const DEFAULT_MAX_BLOCK_TRANSACTIONS: u32 = 512; type ContentHash = [u8; 32]; /// State data for a stored transaction. -#[derive( - Encode, - Decode, - Clone, - sp_runtime::RuntimeDebug, - PartialEq, - Eq, - scale_info::TypeInfo, - MaxEncodedLen, -)] +#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, scale_info::TypeInfo, MaxEncodedLen)] pub struct TransactionInfo { /// Chunk trie root. chunk_root: ::Output, diff --git a/substrate/frame/treasury/src/lib.rs b/substrate/frame/treasury/src/lib.rs index 06dfd0e93e7b3..1d074a4df68b7 100644 --- a/substrate/frame/treasury/src/lib.rs +++ b/substrate/frame/treasury/src/lib.rs @@ -93,7 +93,7 @@ use sp_runtime::{ AccountIdConversion, BlockNumberProvider, CheckedAdd, One, Saturating, StaticLookup, UniqueSaturatedInto, Zero, }, - PerThing, Permill, RuntimeDebug, + Debug, PerThing, Permill, }; use frame_support::{ @@ -152,15 +152,7 @@ pub type ProposalIndex = u32; /// A spending proposal. #[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - MaxEncodedLen, - RuntimeDebug, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, MaxEncodedLen, Debug, TypeInfo, )] pub struct Proposal { /// The account proposing it. @@ -176,15 +168,7 @@ pub struct Proposal { /// The state of the payment claim. #[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - MaxEncodedLen, - RuntimeDebug, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, MaxEncodedLen, Debug, TypeInfo, )] pub enum PaymentState { /// Pending claim. @@ -198,15 +182,7 @@ pub enum PaymentState { /// Info regarding an approved treasury spend. #[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] #[derive( - Encode, - Decode, - DecodeWithMemTracking, - Clone, - PartialEq, - Eq, - MaxEncodedLen, - RuntimeDebug, - TypeInfo, + Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, MaxEncodedLen, Debug, TypeInfo, )] pub struct SpendStatus { // The kind of asset to be spent. diff --git a/substrate/frame/tx-pause/src/mock.rs b/substrate/frame/tx-pause/src/mock.rs index c5489c950bdd8..2486d78393fc7 100644 --- a/substrate/frame/tx-pause/src/mock.rs +++ b/substrate/frame/tx-pause/src/mock.rs @@ -53,7 +53,7 @@ impl pallet_utility::Config for Test { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/substrate/frame/uniques/src/lib.rs b/substrate/frame/uniques/src/lib.rs index e930d1052da65..9a8ef24362b52 100644 --- a/substrate/frame/uniques/src/lib.rs +++ b/substrate/frame/uniques/src/lib.rs @@ -53,7 +53,7 @@ use frame_support::traits::{ use frame_system::Config as SystemConfig; use sp_runtime::{ traits::{Saturating, StaticLookup, Zero}, - ArithmeticError, RuntimeDebug, + ArithmeticError, Debug, }; pub use pallet::*; diff --git a/substrate/frame/uniques/src/types.rs b/substrate/frame/uniques/src/types.rs index 575120a3d7d8a..95589ca28c8d5 100644 --- a/substrate/frame/uniques/src/types.rs +++ b/substrate/frame/uniques/src/types.rs @@ -36,7 +36,7 @@ pub type ItemDetailsFor = ItemDetails<::AccountId, Depo pub type ItemPrice = <>::Currency as Currency<::AccountId>>::Balance; -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen)] pub struct CollectionDetails { /// Can change `owner`, `issuer`, `freezer` and `admin` accounts. pub owner: AccountId, @@ -70,7 +70,7 @@ pub struct CollectionDetails { DecodeWithMemTracking, Eq, PartialEq, - RuntimeDebug, + Debug, TypeInfo, MaxEncodedLen, )] @@ -97,7 +97,7 @@ impl CollectionDetails { } /// Information concerning the ownership of a single unique item. -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, Default, TypeInfo, MaxEncodedLen)] pub struct ItemDetails { /// The owner of this item. pub owner: AccountId, @@ -110,7 +110,7 @@ pub struct ItemDetails { pub deposit: DepositBalance, } -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, Default, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(StringLimit))] #[codec(mel_bound(DepositBalance: MaxEncodedLen))] pub struct CollectionMetadata> { @@ -126,7 +126,7 @@ pub struct CollectionMetadata> { pub is_frozen: bool, } -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo, MaxEncodedLen)] +#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, Default, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(StringLimit))] #[codec(mel_bound(DepositBalance: MaxEncodedLen))] pub struct ItemMetadata> { diff --git a/substrate/frame/vesting/src/lib.rs b/substrate/frame/vesting/src/lib.rs index fc8d64dd853b2..a5b5b44826f40 100644 --- a/substrate/frame/vesting/src/lib.rs +++ b/substrate/frame/vesting/src/lib.rs @@ -78,7 +78,7 @@ use sp_runtime::{ AtLeast32BitUnsigned, BlockNumberProvider, Bounded, Convert, MaybeSerializeDeserialize, One, Saturating, StaticLookup, Zero, }, - DispatchError, RuntimeDebug, + DispatchError, }; pub use pallet::*; @@ -95,7 +95,7 @@ const VESTING_ID: LockIdentifier = *b"vesting "; // A value placed in storage that represents the current version of the Vesting storage. // This value is used by `on_runtime_upgrade` to determine whether we run storage migration logic. -#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, Debug, MaxEncodedLen, TypeInfo)] pub enum Releases { V0, V1, diff --git a/substrate/frame/vesting/src/vesting_info.rs b/substrate/frame/vesting/src/vesting_info.rs index fd26ff3e6b77e..fd55499984204 100644 --- a/substrate/frame/vesting/src/vesting_info.rs +++ b/substrate/frame/vesting/src/vesting_info.rs @@ -28,7 +28,7 @@ use super::*; Clone, PartialEq, Eq, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, )] diff --git a/substrate/primitives/application-crypto/src/lib.rs b/substrate/primitives/application-crypto/src/lib.rs index 357a28e85063c..5c51bad18ac9f 100644 --- a/substrate/primitives/application-crypto/src/lib.rs +++ b/substrate/primitives/application-crypto/src/lib.rs @@ -30,7 +30,6 @@ pub use sp_core::{ self, crypto::{ByteArray, CryptoType, Derive, IsWrappedBy, Public, Signature, UncheckedFrom, Wraps}, proof_of_possession::{ProofOfPossessionGenerator, ProofOfPossessionVerifier}, - RuntimeDebug, }; #[doc(hidden)] @@ -281,7 +280,7 @@ macro_rules! app_crypto_public_full_crypto { $crate::codec::Encode, $crate::codec::Decode, $crate::codec::DecodeWithMemTracking, - $crate::RuntimeDebug, + Debug, $crate::codec::MaxEncodedLen, $crate::scale_info::TypeInfo, )] @@ -319,7 +318,7 @@ macro_rules! app_crypto_public_not_full_crypto { $crate::codec::Encode, $crate::codec::Decode, $crate::codec::DecodeWithMemTracking, - $crate::RuntimeDebug, + Debug, $crate::codec::MaxEncodedLen, $crate::scale_info::TypeInfo, )] @@ -467,7 +466,7 @@ macro_rules! app_crypto_signature_full_crypto { $crate::codec::Encode, $crate::codec::Decode, $crate::codec::DecodeWithMemTracking, - $crate::RuntimeDebug, + Debug, $crate::scale_info::TypeInfo, )] #[derive(Hash)] @@ -503,7 +502,7 @@ macro_rules! app_crypto_signature_not_full_crypto { $crate::codec::Encode, $crate::codec::Decode, $crate::codec::DecodeWithMemTracking, - $crate::RuntimeDebug, + Debug, $crate::scale_info::TypeInfo, )] pub struct Signature($sig); @@ -600,7 +599,7 @@ macro_rules! app_crypto_proof_of_possession_full_crypto { $crate::codec::Encode, $crate::codec::Decode, $crate::codec::DecodeWithMemTracking, - $crate::RuntimeDebug, + Debug, $crate::scale_info::TypeInfo, )] pub struct ProofOfPossession($sig); @@ -635,7 +634,7 @@ macro_rules! app_crypto_proof_of_possession_not_full_crypto { $crate::codec::Encode, $crate::codec::Decode, $crate::codec::DecodeWithMemTracking, - $crate::RuntimeDebug, + Debug, $crate::scale_info::TypeInfo, )] pub struct ProofOfPossession($sig); diff --git a/substrate/primitives/consensus/babe/src/digests.rs b/substrate/primitives/consensus/babe/src/digests.rs index 6516a3c0fd8eb..dc68d1ced4c8b 100644 --- a/substrate/primitives/consensus/babe/src/digests.rs +++ b/substrate/primitives/consensus/babe/src/digests.rs @@ -25,13 +25,13 @@ use super::{ #[cfg(not(feature = "std"))] use alloc::vec::Vec; use sp_core::sr25519::vrf::VrfSignature; -use sp_runtime::{DigestItem, RuntimeDebug}; +use sp_runtime::DigestItem; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; /// Raw BABE primary slot assignment pre-digest. -#[derive(Clone, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)] pub struct PrimaryPreDigest { /// Authority index pub authority_index: super::AuthorityIndex, @@ -42,7 +42,7 @@ pub struct PrimaryPreDigest { } /// BABE secondary slot assignment pre-digest. -#[derive(Clone, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)] pub struct SecondaryPlainPreDigest { /// Authority index /// @@ -56,7 +56,7 @@ pub struct SecondaryPlainPreDigest { } /// BABE secondary deterministic slot assignment with VRF outputs. -#[derive(Clone, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)] pub struct SecondaryVRFPreDigest { /// Authority index pub authority_index: super::AuthorityIndex, @@ -69,7 +69,7 @@ pub struct SecondaryVRFPreDigest { /// A BABE pre-runtime digest. This contains all data required to validate a /// block and for the BABE runtime module. Slots can be assigned to a primary /// (VRF based) and to a secondary (slot number based). -#[derive(Clone, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)] pub enum PreDigest { /// A primary VRF-based slot assignment. #[codec(index = 1)] @@ -127,7 +127,7 @@ impl PreDigest { /// Information about the next epoch. This is broadcast in the first block /// of the epoch. -#[derive(Decode, Encode, PartialEq, Eq, Clone, RuntimeDebug)] +#[derive(Decode, Encode, PartialEq, Eq, Clone, Debug)] pub struct NextEpochDescriptor { /// The authorities. pub authorities: Vec<(AuthorityId, BabeAuthorityWeight)>, @@ -145,7 +145,7 @@ pub struct NextEpochDescriptor { PartialEq, Eq, Clone, - RuntimeDebug, + Debug, MaxEncodedLen, scale_info::TypeInfo, )] diff --git a/substrate/primitives/consensus/babe/src/lib.rs b/substrate/primitives/consensus/babe/src/lib.rs index b29785b1c4463..fd81e44002b4b 100644 --- a/substrate/primitives/consensus/babe/src/lib.rs +++ b/substrate/primitives/consensus/babe/src/lib.rs @@ -31,7 +31,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -use sp_runtime::{traits::Header, ConsensusEngineId, RuntimeDebug}; +use sp_runtime::{traits::Header, ConsensusEngineId}; use crate::digests::{NextConfigDescriptor, NextEpochDescriptor}; @@ -134,7 +134,7 @@ pub enum ConsensusLog { } /// Configuration data used by the BABE consensus engine. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug, TypeInfo)] pub struct BabeConfigurationV1 { /// The slot duration in milliseconds for BABE. Currently, only /// the value provided by this type at genesis will be used. @@ -182,7 +182,7 @@ impl From for BabeConfiguration { } /// Configuration data used by the BABE consensus engine. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug, TypeInfo)] pub struct BabeConfiguration { /// The slot duration in milliseconds for BABE. Currently, only /// the value provided by this type at genesis will be used. @@ -227,7 +227,7 @@ impl BabeConfiguration { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, )] @@ -254,7 +254,7 @@ impl AllowedSlots { } /// Configuration data used by the BABE consensus engine that may change with epochs. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug, MaxEncodedLen, TypeInfo)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct BabeEpochConfiguration { /// A constant value that is used in the threshold calculation formula. diff --git a/substrate/primitives/consensus/grandpa/src/lib.rs b/substrate/primitives/consensus/grandpa/src/lib.rs index 6c973964cfdee..3544e13a4e124 100644 --- a/substrate/primitives/consensus/grandpa/src/lib.rs +++ b/substrate/primitives/consensus/grandpa/src/lib.rs @@ -31,7 +31,7 @@ use scale_info::TypeInfo; use sp_keystore::KeystorePtr; use sp_runtime::{ traits::{Header as HeaderT, NumberFor}, - ConsensusEngineId, OpaqueValue, RuntimeDebug, + ConsensusEngineId, Debug, OpaqueValue, }; /// The log target to be used by client code. @@ -137,7 +137,7 @@ pub struct GrandpaJustification { } /// A scheduled change of authority set. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "serde", derive(Serialize))] pub struct ScheduledChange { /// The new authorities after the change, along with their respective weights. @@ -147,7 +147,7 @@ pub struct ScheduledChange { } /// An consensus log item for GRANDPA. -#[derive(Decode, Encode, PartialEq, Eq, Clone, RuntimeDebug)] +#[derive(Decode, Encode, PartialEq, Eq, Clone, Debug)] #[cfg_attr(feature = "serde", derive(Serialize))] pub enum ConsensusLog { /// Schedule an authority set change. diff --git a/substrate/primitives/consensus/sassafras/src/digests.rs b/substrate/primitives/consensus/sassafras/src/digests.rs index bac31f57f2da3..16a022ca011c0 100644 --- a/substrate/primitives/consensus/sassafras/src/digests.rs +++ b/substrate/primitives/consensus/sassafras/src/digests.rs @@ -27,12 +27,12 @@ use scale_info::TypeInfo; #[cfg(not(feature = "std"))] use alloc::vec::Vec; -use sp_runtime::{DigestItem, RuntimeDebug}; +use sp_runtime::DigestItem; /// Epoch slot claim digest entry. /// /// This is mandatory for each block. -#[derive(Clone, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)] +#[derive(Clone, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)] pub struct SlotClaim { /// Authority index that claimed the slot. pub authority_idx: AuthorityIndex, @@ -47,7 +47,7 @@ pub struct SlotClaim { /// Information about the next epoch. /// /// This is mandatory in the first block of each epoch. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug)] pub struct NextEpochDescriptor { /// Randomness value. pub randomness: Randomness, diff --git a/substrate/primitives/consensus/sassafras/src/lib.rs b/substrate/primitives/consensus/sassafras/src/lib.rs index 09baf678f16de..4bf9afc142745 100644 --- a/substrate/primitives/consensus/sassafras/src/lib.rs +++ b/substrate/primitives/consensus/sassafras/src/lib.rs @@ -27,7 +27,7 @@ use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_core::crypto::KeyTypeId; -use sp_runtime::{ConsensusEngineId, RuntimeDebug}; +use sp_runtime::ConsensusEngineId; pub use sp_consensus_slots::{Slot, SlotDuration}; @@ -93,7 +93,7 @@ pub type Randomness = [u8; RANDOMNESS_LENGTH]; Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, MaxEncodedLen, TypeInfo, Default, diff --git a/substrate/primitives/core/src/crypto.rs b/substrate/primitives/core/src/crypto.rs index 62b3a9767bc72..614456e6fd65a 100644 --- a/substrate/primitives/core/src/crypto.rs +++ b/substrate/primitives/core/src/crypto.rs @@ -1047,18 +1047,7 @@ pub trait CryptoType { /// Values whose first character is `_` are reserved for private use and won't conflict with any /// public modules. #[derive( - Copy, - Clone, - Default, - PartialEq, - Eq, - PartialOrd, - Ord, - Hash, - Encode, - Decode, - crate::RuntimeDebug, - TypeInfo, + Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Encode, Decode, Debug, TypeInfo, )] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[repr(transparent)] diff --git a/substrate/primitives/core/src/lib.rs b/substrate/primitives/core/src/lib.rs index fc5faa6a6f233..1b232b31e9786 100644 --- a/substrate/primitives/core/src/lib.rs +++ b/substrate/primitives/core/src/lib.rs @@ -43,8 +43,6 @@ pub use serde; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -pub use sp_debug_derive::RuntimeDebug; - #[cfg(feature = "serde")] pub use impl_serde::serialize as bytes; @@ -111,7 +109,7 @@ pub use sp_storage as storage; pub use sp_std; /// Hex-serialized shim for `Vec`. -#[derive(PartialEq, Eq, Clone, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Debug)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize, Hash, PartialOrd, Ord))] pub struct Bytes(#[cfg_attr(feature = "serde", serde(with = "bytes"))] pub Vec); @@ -179,7 +177,7 @@ impl Deref for OpaqueMetadata { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, )] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] @@ -366,15 +364,7 @@ pub fn to_substrate_wasm_fn_return_value(value: &impl Encode) -> u64 { /// The void type - it cannot exist. // Oh rust, you crack me up... #[derive( - Clone, - Decode, - DecodeWithMemTracking, - Encode, - Eq, - PartialEq, - RuntimeDebug, - TypeInfo, - MaxEncodedLen, + Clone, Decode, DecodeWithMemTracking, Encode, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen, )] pub enum Void {} diff --git a/substrate/primitives/core/src/offchain/mod.rs b/substrate/primitives/core/src/offchain/mod.rs index a25a708b0a27f..d0786f2ffc885 100644 --- a/substrate/primitives/core/src/offchain/mod.rs +++ b/substrate/primitives/core/src/offchain/mod.rs @@ -17,7 +17,7 @@ //! Offchain workers types -use crate::{OpaquePeerId, RuntimeDebug}; +use crate::OpaquePeerId; use alloc::{boxed::Box, vec::Vec}; use codec::{Decode, Encode}; use scale_info::TypeInfo; @@ -56,7 +56,7 @@ pub trait OffchainStorage: Clone + Send + Sync { } /// A type of supported crypto. -#[derive(Clone, Copy, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, Copy, PartialEq, Eq, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[repr(C)] pub enum StorageKind { @@ -93,7 +93,7 @@ impl From for u32 { } /// Opaque type for offchain http requests. -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, RuntimeDebug, Encode, Decode)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Encode, Decode)] #[cfg_attr(feature = "std", derive(Hash))] pub struct HttpRequestId(pub u16); @@ -116,7 +116,7 @@ impl From for u32 { } /// An error enum returned by some http methods. -#[derive(Clone, Copy, PartialEq, Eq, RuntimeDebug, Encode, Decode)] +#[derive(Clone, Copy, PartialEq, Eq, Debug, Encode, Decode)] #[repr(C)] pub enum HttpError { /// The requested action couldn't been completed within a deadline. @@ -150,7 +150,7 @@ impl From for u32 { } /// Status of the HTTP request -#[derive(Clone, Copy, PartialEq, Eq, RuntimeDebug, Encode, Decode)] +#[derive(Clone, Copy, PartialEq, Eq, Debug, Encode, Decode)] pub enum HttpRequestStatus { /// Deadline was reached while we waited for this request to finish. /// @@ -196,7 +196,7 @@ impl TryFrom for HttpRequestStatus { /// A blob to hold information about the local node's network state /// without committing to its format. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "std", derive(Default))] pub struct OpaqueNetworkState { /// PeerId of the local node in SCALE encoded. @@ -206,7 +206,7 @@ pub struct OpaqueNetworkState { } /// Simple blob to hold a `Multiaddr` without committing to its format. -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, TypeInfo)] pub struct OpaqueMultiaddr(pub Vec); impl OpaqueMultiaddr { @@ -217,7 +217,7 @@ impl OpaqueMultiaddr { } /// Opaque timestamp type -#[derive(Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Default, RuntimeDebug, Encode, Decode)] +#[derive(Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Default, Debug, Encode, Decode)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Timestamp(u64); @@ -234,7 +234,7 @@ impl From for u64 { } /// Duration type -#[derive(Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Default, RuntimeDebug, Encode, Decode)] +#[derive(Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Default, Debug, Encode, Decode)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Duration(u64); diff --git a/substrate/primitives/debug-derive/Cargo.toml b/substrate/primitives/debug-derive/Cargo.toml index 8937f2c881b5f..140dc3744cb60 100644 --- a/substrate/primitives/debug-derive/Cargo.toml +++ b/substrate/primitives/debug-derive/Cargo.toml @@ -19,15 +19,13 @@ targets = ["x86_64-unknown-linux-gnu"] proc-macro = true [dependencies] +proc-macro-warning = { workspace = true } proc-macro2 = { workspace = true } quote = { workspace = true } syn = { workspace = true } [features] default = ["std"] +# These features are deprecated and have no effect. std = [] -# By default `RuntimeDebug` implements `Debug` that outputs `` when `std` is -# disabled. However, sometimes downstream users need to have the real `Debug` implementation for -# debugging purposes. If this is required, a user only needs to add this crate as a dependency of -# their runtime and enable the `force-debug` feature. force-debug = [] diff --git a/substrate/primitives/debug-derive/src/impls.rs b/substrate/primitives/debug-derive/src/impls.rs index 76ef8367277b9..1b971e219ed50 100644 --- a/substrate/primitives/debug-derive/src/impls.rs +++ b/substrate/primitives/debug-derive/src/impls.rs @@ -43,22 +43,6 @@ pub fn debug_derive(ast: DeriveInput) -> proc_macro::TokenStream { gen.into() } -#[cfg(all(not(feature = "std"), not(feature = "force-debug")))] -mod implementation { - use super::*; - - /// Derive the inner implementation of `Debug::fmt` function. - /// - /// Non-std environment. We do nothing to prevent bloating the size of runtime. - /// Implement `Printable` if you need to print the details. - pub fn derive(_name_str: &str, _data: &Data) -> TokenStream { - quote! { - fmt.write_str("") - } - } -} - -#[cfg(any(feature = "std", feature = "force-debug"))] mod implementation { use super::*; use proc_macro2::Span; diff --git a/substrate/primitives/debug-derive/src/lib.rs b/substrate/primitives/debug-derive/src/lib.rs index 639dbb6df189c..188ff5ce3cfe1 100644 --- a/substrate/primitives/debug-derive/src/lib.rs +++ b/substrate/primitives/debug-derive/src/lib.rs @@ -17,13 +17,7 @@ //! Macros to derive runtime debug implementation. //! -//! This custom derive implements a `core::fmt::Debug` trait, -//! but in case the `std` feature is enabled the implementation -//! will actually print out the structure as regular `derive(Debug)` -//! would do. If `std` is disabled the implementation will be empty. -//! -//! This behaviour is useful to prevent bloating the runtime WASM -//! blob from unneeded code. +//! This macro is deprecated. Use `#[derive(Debug)]` directly instead. //! //! ```rust //! #[derive(sp_debug_derive::RuntimeDebug)] @@ -35,8 +29,23 @@ mod impls; use proc_macro::TokenStream; +use quote::quote; +/// Derive macro for `Debug` that emits a deprecation warning. +/// +/// This macro is deprecated. Use `#[derive(Debug)]` directly instead. #[proc_macro_derive(RuntimeDebug)] -pub fn debug_derive(input: TokenStream) -> TokenStream { - impls::debug_derive(syn::parse_macro_input!(input)) +pub fn runtime_debug_derive(input: TokenStream) -> TokenStream { + let input: syn::DeriveInput = syn::parse_macro_input!(input); + let name = &input.ident; + + let warning = proc_macro_warning::Warning::new_deprecated(&format!("RuntimeDebug_{}", name)) + .old("derive `RuntimeDebug`") + .new("derive `Debug`") + .span(input.ident.span()) + .build_or_panic(); + + let debug_impl: proc_macro2::TokenStream = impls::debug_derive(input).into(); + + quote!(#warning #debug_impl).into() } diff --git a/substrate/primitives/debug-derive/tests/tests.rs b/substrate/primitives/debug-derive/tests/tests.rs index da521068e0dcd..eeb86b0f0f739 100644 --- a/substrate/primitives/debug-derive/tests/tests.rs +++ b/substrate/primitives/debug-derive/tests/tests.rs @@ -15,6 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#![allow(deprecated)] + use sp_debug_derive::RuntimeDebug; #[derive(RuntimeDebug)] diff --git a/substrate/primitives/merkle-mountain-range/src/lib.rs b/substrate/primitives/merkle-mountain-range/src/lib.rs index cf858624431e9..d55bd356c0fd5 100644 --- a/substrate/primitives/merkle-mountain-range/src/lib.rs +++ b/substrate/primitives/merkle-mountain-range/src/lib.rs @@ -29,7 +29,6 @@ use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode}; use core::fmt; use scale_info::TypeInfo; -use sp_debug_derive::RuntimeDebug; use sp_runtime::traits; pub mod utils; @@ -105,7 +104,7 @@ impl FullLeaf /// it would have to be SCALE-compatible with the concrete leaf type, but due to SCALE limitations /// it's not possible to know how many bytes the encoding of concrete leaf type uses. #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -#[derive(RuntimeDebug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq)] pub struct OpaqueLeaf( /// Raw bytes of the leaf type encoded in its compact form. /// @@ -145,7 +144,7 @@ impl FullLeaf for OpaqueLeaf { /// /// It is different from [`OpaqueLeaf`], because it does implement `Codec` /// and the encoding has to match raw `Vec` encoding. -#[derive(codec::Encode, codec::Decode, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)] +#[derive(codec::Encode, codec::Decode, Debug, Clone, PartialEq, Eq, TypeInfo)] pub struct EncodableOpaqueLeaf(pub Vec); impl EncodableOpaqueLeaf { @@ -176,7 +175,7 @@ impl EncodableOpaqueLeaf { /// /// [DataOrHash::hash] method calculates the hash of this element in its compact form, /// so should be used instead of hashing the encoded form (which will always be non-compact). -#[derive(RuntimeDebug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq)] pub enum DataOrHash { /// Arbitrary data in its full form. Data(L), @@ -247,7 +246,7 @@ impl DataOrHash { /// into [DataOrHash] and each tuple element is hashed first before constructing /// the final hash of the entire tuple. This allows you to replace tuple elements /// you don't care about with their hashes. -#[derive(RuntimeDebug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq)] pub struct Compact { /// Internal tuple representation. pub tuple: T, @@ -352,7 +351,7 @@ impl_leaf_data_for_tuple!(A:0, B:1, C:2, D:3); impl_leaf_data_for_tuple!(A:0, B:1, C:2, D:3, E:4); /// An MMR proof data for a group of leaves. -#[derive(codec::Encode, codec::Decode, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)] +#[derive(codec::Encode, codec::Decode, Debug, Clone, PartialEq, Eq, TypeInfo)] pub struct LeafProof { /// The indices of the leaves the proof is for. pub leaf_indices: Vec, @@ -364,7 +363,7 @@ pub struct LeafProof { /// An MMR ancestry proof for a prior mmr root. #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -#[derive(Encode, Decode, DecodeWithMemTracking, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Debug, Clone, PartialEq, Eq, TypeInfo)] pub struct AncestryProof { /// Peaks of the ancestor's mmr pub prev_peaks: Vec, @@ -379,7 +378,7 @@ pub struct AncestryProof { /// Merkle Mountain Range operation error. #[cfg_attr(feature = "std", derive(thiserror::Error))] -#[derive(RuntimeDebug, codec::Encode, codec::Decode, PartialEq, Eq, TypeInfo)] +#[derive(Debug, codec::Encode, codec::Decode, PartialEq, Eq, TypeInfo)] pub enum Error { /// Error during translation of a block number into a leaf index. #[cfg_attr(feature = "std", error("Error performing numeric op"))] diff --git a/substrate/primitives/npos-elections/src/assignments.rs b/substrate/primitives/npos-elections/src/assignments.rs index 0686fdda643bd..a4cbc24d736a0 100644 --- a/substrate/primitives/npos-elections/src/assignments.rs +++ b/substrate/primitives/npos-elections/src/assignments.rs @@ -25,10 +25,10 @@ use sp_arithmetic::{ traits::{Bounded, Zero}, Normalizable, PerThing, }; -use sp_core::RuntimeDebug; +use Debug; /// A voter's stake assignment among a set of targets, represented as ratios. -#[derive(RuntimeDebug, Clone, Default)] +#[derive(Debug, Clone, Default)] #[cfg_attr(feature = "serde", derive(PartialEq, Eq, Encode, Decode))] pub struct Assignment { /// Voter's identifier. @@ -96,7 +96,7 @@ impl Assignment { /// A voter's stake assignment among a set of targets, represented as absolute values in the scale /// of [`ExtendedBalance`]. -#[derive(RuntimeDebug, Clone, Default)] +#[derive(Debug, Clone, Default)] #[cfg_attr(feature = "serde", derive(PartialEq, Eq, Encode, Decode))] pub struct StakedAssignment { /// Voter's identifier diff --git a/substrate/primitives/npos-elections/src/lib.rs b/substrate/primitives/npos-elections/src/lib.rs index 4c2583be31de5..aa9e91a915f72 100644 --- a/substrate/primitives/npos-elections/src/lib.rs +++ b/substrate/primitives/npos-elections/src/lib.rs @@ -83,7 +83,7 @@ use scale_info::TypeInfo; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use sp_arithmetic::{traits::Zero, Normalizable, PerThing, Rational128, ThresholdOrd}; -use sp_core::RuntimeDebug; +use Debug; #[cfg(test)] mod mock; @@ -113,7 +113,7 @@ pub use traits::{IdentifierT, PerThing128}; #[derive( Eq, PartialEq, - RuntimeDebug, + Debug, Clone, codec::Encode, codec::Decode, @@ -282,7 +282,7 @@ pub struct BalancingConfig { pub type CandidatePtr = Rc>>; /// A candidate entity for the election. -#[derive(RuntimeDebug, Clone, Default)] +#[derive(Debug, Clone, Default)] pub struct Candidate { /// Identifier. who: AccountId, @@ -466,7 +466,7 @@ impl Voter { } /// Final result of the election. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct ElectionResult { /// Just winners zipped with their approval stake. Note that the approval stake is merely the /// sub of their received stake and could be used for very basic sorting and approval voting. @@ -483,7 +483,7 @@ pub struct ElectionResult { /// /// This, at the current version, resembles the `Exposure` defined in the Staking pallet, yet they /// do not necessarily have to be the same. -#[derive(RuntimeDebug, Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, TypeInfo)] +#[derive(Debug, Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Support { /// Total support. diff --git a/substrate/primitives/runtime/src/curve.rs b/substrate/primitives/runtime/src/curve.rs index 2fc032cfafe2d..77b5f00cbf3d1 100644 --- a/substrate/primitives/runtime/src/curve.rs +++ b/substrate/primitives/runtime/src/curve.rs @@ -25,7 +25,7 @@ use core::ops::Sub; use scale_info::TypeInfo; /// Piecewise Linear function in [0, 1] -> [0, 1]. -#[derive(PartialEq, Eq, sp_core::RuntimeDebug, TypeInfo)] +#[derive(PartialEq, Eq, Debug, TypeInfo)] pub struct PiecewiseLinear<'a> { /// Array of points. Must be in order from the lowest abscissas to the highest. pub points: &'a [(Perbill, Perbill)], diff --git a/substrate/primitives/runtime/src/generic/block.rs b/substrate/primitives/runtime/src/generic/block.rs index 58ad1dca3c7dc..7f99919c3f57f 100644 --- a/substrate/primitives/runtime/src/generic/block.rs +++ b/substrate/primitives/runtime/src/generic/block.rs @@ -33,10 +33,10 @@ use crate::{ }; use alloc::vec::Vec; use core::marker::PhantomData; -use sp_core::RuntimeDebug; +use Debug; /// Something to identify a block. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug)] pub enum BlockId { /// Identify by block header hash. Hash(Block::Hash), @@ -79,7 +79,7 @@ impl fmt::Display for BlockId { } /// Abstraction over a substrate block that allows us to lazily decode its extrinsics. -#[derive(RuntimeDebug, Encode, Decode, scale_info::TypeInfo)] +#[derive(Debug, Encode, Decode, scale_info::TypeInfo)] pub struct LazyBlock { /// The block header. pub header: Header, @@ -145,7 +145,7 @@ where /// Abstraction over a substrate block. #[derive( - PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, scale_info::TypeInfo, + PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, Debug, scale_info::TypeInfo, )] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] @@ -194,7 +194,7 @@ where } /// Abstraction over a substrate block and justification. -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, Debug)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] #[cfg_attr(feature = "serde", serde(deny_unknown_fields))] diff --git a/substrate/primitives/runtime/src/generic/checked_extrinsic.rs b/substrate/primitives/runtime/src/generic/checked_extrinsic.rs index dec8185984723..9314cc9d67caa 100644 --- a/substrate/primitives/runtime/src/generic/checked_extrinsic.rs +++ b/substrate/primitives/runtime/src/generic/checked_extrinsic.rs @@ -38,7 +38,7 @@ const DEFAULT_EXTENSION_VERSION: ExtensionVersion = 0; /// The kind of extrinsic this is, including any fields required of that kind. This is basically /// the full extrinsic except the `Call`. -#[derive(PartialEq, Eq, Clone, sp_core::RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Debug)] pub enum ExtrinsicFormat { /// Extrinsic is bare; it must pass either the bare forms of `TransactionExtension` or /// `ValidateUnsigned`, both deprecated, or alternatively a `ProvideInherent`. @@ -56,7 +56,7 @@ pub enum ExtrinsicFormat { /// /// This is typically passed into [`traits::Applyable::apply`], which should execute /// [`CheckedExtrinsic::function`], alongside all other bits and bobs. -#[derive(PartialEq, Eq, Clone, sp_core::RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Debug)] pub struct CheckedExtrinsic { /// Who this purports to be from and the number of extrinsics have come before /// from the same signer, if anyone (note this is not a signature). diff --git a/substrate/primitives/runtime/src/generic/digest.rs b/substrate/primitives/runtime/src/generic/digest.rs index 9f5e4b8e1bb95..db9770e8f4a30 100644 --- a/substrate/primitives/runtime/src/generic/digest.rs +++ b/substrate/primitives/runtime/src/generic/digest.rs @@ -32,12 +32,10 @@ use crate::{ }, ConsensusEngineId, }; -use sp_core::RuntimeDebug; +use Debug; /// Generic header digest. -#[derive( - PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo, Default, -)] +#[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, Default)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Digest { /// A list of logs in the digest. @@ -73,7 +71,7 @@ impl Digest { /// Digest item that is able to encode/decode 'system' digest items and /// provide opaque access to other items. -#[derive(PartialEq, Eq, Clone, DecodeWithMemTracking, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, DecodeWithMemTracking, Debug)] pub enum DigestItem { /// A pre-runtime digest. /// @@ -172,7 +170,7 @@ impl TypeInfo for DigestItem { /// A 'referencing view' for digest item. Does not own its contents. Used by /// final runtime implementations for encoding/decoding its log items. -#[derive(PartialEq, Eq, Clone, RuntimeDebug)] +#[derive(PartialEq, Eq, Clone, Debug)] pub enum DigestItemRef<'a> { /// A pre-runtime digest. /// diff --git a/substrate/primitives/runtime/src/generic/era.rs b/substrate/primitives/runtime/src/generic/era.rs index c3762b310bf9d..adacabdaa8f6e 100644 --- a/substrate/primitives/runtime/src/generic/era.rs +++ b/substrate/primitives/runtime/src/generic/era.rs @@ -29,7 +29,7 @@ pub type Period = u64; pub type Phase = u64; /// An era to describe the longevity of a transaction. -#[derive(DecodeWithMemTracking, PartialEq, Eq, Clone, Copy, sp_core::RuntimeDebug)] +#[derive(DecodeWithMemTracking, PartialEq, Eq, Clone, Copy, Debug)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum Era { /// The transaction is valid forever. The genesis hash must be present in the signed content. diff --git a/substrate/primitives/runtime/src/generic/header.rs b/substrate/primitives/runtime/src/generic/header.rs index cde8098404b44..a8d45a5e64738 100644 --- a/substrate/primitives/runtime/src/generic/header.rs +++ b/substrate/primitives/runtime/src/generic/header.rs @@ -28,9 +28,7 @@ use serde::{Deserialize, Serialize}; use sp_core::U256; /// Abstraction over a block header for a substrate chain. -#[derive( - Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, Clone, sp_core::RuntimeDebug, TypeInfo, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, Clone, Debug, TypeInfo)] #[scale_info(skip_type_params(Hash))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] diff --git a/substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs b/substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs index 01f4bf9c50488..1b7d8d082b7ca 100644 --- a/substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs +++ b/substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs @@ -34,7 +34,9 @@ use codec::{ Compact, CountedInput, Decode, DecodeWithMemLimit, DecodeWithMemTracking, Encode, EncodeLike, Input, }; -use core::fmt::{self, Debug}; +use core::fmt::{ + Debug, {self}, +}; use scale_info::{build::Fields, meta_type, Path, StaticTypeInfo, Type, TypeInfo, TypeParameter}; use sp_io::hashing::blake2_256; use sp_weights::Weight; diff --git a/substrate/primitives/runtime/src/lib.rs b/substrate/primitives/runtime/src/lib.rs index 47500bd43a705..0f4b043a454ec 100644 --- a/substrate/primitives/runtime/src/lib.rs +++ b/substrate/primitives/runtime/src/lib.rs @@ -115,8 +115,8 @@ pub use sp_core::{ #[cfg(feature = "std")] pub use sp_core::{bounded_btree_map, bounded_vec}; -/// Re-export `RuntimeDebug`, to avoid dependency clutter. -pub use sp_core::RuntimeDebug; +/// Re-export `Debug`, to avoid dependency clutter. +pub use core::fmt::Debug; /// Re-export big_uint stuff. pub use sp_arithmetic::biguint; @@ -278,15 +278,7 @@ pub type ConsensusEngineId = [u8; 4]; /// Signature verify that can work with any known signature types. #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive( - Eq, - PartialEq, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - MaxEncodedLen, - RuntimeDebug, - TypeInfo, + Eq, PartialEq, Clone, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, Debug, TypeInfo, )] pub enum MultiSignature { /// An Ed25519 signature. @@ -352,16 +344,7 @@ impl TryFrom for ecdsa::Signature { /// Public key for any known crypto algorithm. #[derive( - Eq, - PartialEq, - Ord, - PartialOrd, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - RuntimeDebug, - TypeInfo, + Eq, PartialEq, Ord, PartialOrd, Clone, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, )] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum MultiSigner { @@ -519,7 +502,7 @@ impl Verify for MultiSignature { } /// Signature verify that can work with any known signature types.. -#[derive(Eq, PartialEq, Clone, Default, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Eq, PartialEq, Clone, Default, Encode, Decode, Debug, TypeInfo)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct AnySignature(H512); @@ -1145,7 +1128,7 @@ pub enum ExtrinsicInclusionMode { } /// Simple blob that hold a value in an encoded form without committing to its type. -#[derive(Decode, Encode, PartialEq, Eq, Clone, RuntimeDebug, TypeInfo)] +#[derive(Decode, Encode, PartialEq, Eq, Clone, Debug, TypeInfo)] pub struct OpaqueValue(Vec); impl OpaqueValue { /// Create a new `OpaqueValue` using the given encoded representation. diff --git a/substrate/primitives/runtime/src/multiaddress.rs b/substrate/primitives/runtime/src/multiaddress.rs index 5a309af704206..5c60406e067fb 100644 --- a/substrate/primitives/runtime/src/multiaddress.rs +++ b/substrate/primitives/runtime/src/multiaddress.rs @@ -22,14 +22,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode}; /// A multi-format address wrapper for on-chain accounts. #[derive( - Encode, - Decode, - DecodeWithMemTracking, - PartialEq, - Eq, - Clone, - crate::RuntimeDebug, - scale_info::TypeInfo, + Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, Clone, Debug, scale_info::TypeInfo, )] #[cfg_attr(feature = "std", derive(Hash))] pub enum MultiAddress { diff --git a/substrate/primitives/runtime/src/offchain/http.rs b/substrate/primitives/runtime/src/offchain/http.rs index 926d7dfe9ca9c..90fd304cdf62e 100644 --- a/substrate/primitives/runtime/src/offchain/http.rs +++ b/substrate/primitives/runtime/src/offchain/http.rs @@ -49,15 +49,12 @@ //! ``` use alloc::{str, vec, vec::Vec}; -use sp_core::{ - offchain::{ - HttpError, HttpRequestId as RequestId, HttpRequestStatus as RequestStatus, Timestamp, - }, - RuntimeDebug, +use sp_core::offchain::{ + HttpError, HttpRequestId as RequestId, HttpRequestStatus as RequestStatus, Timestamp, }; /// Request method (HTTP verb) -#[derive(Clone, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub enum Method { /// GET request Get, @@ -90,7 +87,7 @@ mod header { use super::*; /// A header type. - #[derive(Clone, PartialEq, Eq, RuntimeDebug)] + #[derive(Clone, PartialEq, Eq, Debug)] pub struct Header { name: Vec, value: Vec, @@ -121,7 +118,7 @@ mod header { } /// An HTTP request builder. -#[derive(Clone, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub struct Request<'a, T = Vec<&'static [u8]>> { /// Request method pub method: Method, @@ -231,7 +228,7 @@ impl<'a, I: AsRef<[u8]>, T: IntoIterator> Request<'a, T> { } /// A request error -#[derive(Clone, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub enum Error { /// Deadline has been reached. DeadlineReached, @@ -242,7 +239,7 @@ pub enum Error { } /// A struct representing an uncompleted http request. -#[derive(PartialEq, Eq, RuntimeDebug)] +#[derive(PartialEq, Eq, Debug)] pub struct PendingRequest { /// Request ID pub id: RequestId, @@ -309,7 +306,7 @@ impl PendingRequest { } /// A HTTP response. -#[derive(RuntimeDebug)] +#[derive(Debug)] pub struct Response { /// Request id pub id: RequestId, @@ -433,7 +430,7 @@ impl Iterator for ResponseBody { } /// A collection of Headers in the response. -#[derive(Clone, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub struct Headers { /// Raw headers pub raw: Vec<(Vec, Vec)>, @@ -463,7 +460,7 @@ impl Headers { } /// A custom iterator traversing all the headers. -#[derive(Clone, RuntimeDebug)] +#[derive(Clone, Debug)] pub struct HeadersIterator<'a> { collection: &'a [(Vec, Vec)], index: Option, diff --git a/substrate/primitives/runtime/src/traits/mod.rs b/substrate/primitives/runtime/src/traits/mod.rs index 9b5b5c5cff5c2..77eed09a54979 100644 --- a/substrate/primitives/runtime/src/traits/mod.rs +++ b/substrate/primitives/runtime/src/traits/mod.rs @@ -43,7 +43,7 @@ pub use sp_arithmetic::traits::{ EnsureOp, EnsureOpAssign, EnsureSub, EnsureSubAssign, IntegerSquareRoot, One, SaturatedConversion, Saturating, UniqueSaturatedFrom, UniqueSaturatedInto, Zero, }; -use sp_core::{self, storage::StateVersion, Hasher, RuntimeDebug, TypeId, U256}; +use sp_core::{self, storage::StateVersion, Hasher, TypeId, U256}; #[doc(hidden)] pub use sp_core::{ parameter_types, ConstBool, ConstI128, ConstI16, ConstI32, ConstI64, ConstI8, ConstInt, @@ -185,7 +185,7 @@ where } /// An error type that indicates that the origin is invalid. -#[derive(Encode, Decode, RuntimeDebug)] +#[derive(Encode, Decode, Debug)] pub struct BadOrigin; impl From for &'static str { @@ -195,7 +195,7 @@ impl From for &'static str { } /// An error that indicates that a lookup failed. -#[derive(Encode, Decode, RuntimeDebug)] +#[derive(Encode, Decode, Debug)] pub struct LookupError; impl From for &'static str { @@ -1040,7 +1040,7 @@ impl HashOutput for T where } /// Blake2-256 Hash implementation. -#[derive(PartialEq, Eq, Clone, RuntimeDebug, TypeInfo)] +#[derive(PartialEq, Eq, Clone, Debug, TypeInfo)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct BlakeTwo256; @@ -1067,7 +1067,7 @@ impl Hash for BlakeTwo256 { } /// Keccak-256 Hash implementation. -#[derive(PartialEq, Eq, Clone, RuntimeDebug, TypeInfo)] +#[derive(PartialEq, Eq, Clone, Debug, TypeInfo)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Keccak256; @@ -1615,7 +1615,7 @@ impl Dispatchable for () { } /// Dispatchable impl containing an arbitrary value which panics if it actually is dispatched. -#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo)] pub struct FakeDispatchable(pub Inner); impl From for FakeDispatchable { fn from(inner: Inner) -> Self { @@ -2132,7 +2132,7 @@ macro_rules! impl_opaque_keys_inner { $crate::codec::Decode, $crate::codec::DecodeWithMemTracking, $crate::scale_info::TypeInfo, - $crate::RuntimeDebug, + Debug, )] pub struct $name { $( diff --git a/substrate/primitives/runtime/src/traits/transaction_extension/as_transaction_extension.rs b/substrate/primitives/runtime/src/traits/transaction_extension/as_transaction_extension.rs index 1153926dd246c..49220056a25be 100644 --- a/substrate/primitives/runtime/src/traits/transaction_extension/as_transaction_extension.rs +++ b/substrate/primitives/runtime/src/traits/transaction_extension/as_transaction_extension.rs @@ -21,7 +21,7 @@ #![allow(deprecated)] use scale_info::TypeInfo; -use sp_core::RuntimeDebug; +use Debug; use crate::{ traits::{AsSystemOriginSigner, SignedExtension, ValidateResult}, @@ -31,7 +31,7 @@ use crate::{ use super::*; /// Adapter to use a `SignedExtension` in the place of a `TransactionExtension`. -#[derive(TypeInfo, Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, RuntimeDebug)] +#[derive(TypeInfo, Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, Debug)] #[deprecated = "Convert your SignedExtension to a TransactionExtension."] pub struct AsTransactionExtension(pub SE); diff --git a/substrate/primitives/runtime/src/transaction_validity.rs b/substrate/primitives/runtime/src/transaction_validity.rs index 07617a8ed697b..b39d5690d36c8 100644 --- a/substrate/primitives/runtime/src/transaction_validity.rs +++ b/substrate/primitives/runtime/src/transaction_validity.rs @@ -19,7 +19,7 @@ use crate::{ codec::{Decode, Encode}, - RuntimeDebug, + Debug, }; use alloc::{vec, vec::Vec}; use scale_info::TypeInfo; @@ -36,7 +36,7 @@ pub type TransactionLongevity = u64; pub type TransactionTag = Vec; /// An invalid transaction validity. -#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, Debug, TypeInfo)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum InvalidTransaction { /// The call of the transaction is not expected. @@ -127,7 +127,7 @@ impl From for &'static str { } /// An unknown transaction validity. -#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, Debug, TypeInfo)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum UnknownTransaction { /// Could not lookup some information that is required to validate the transaction. @@ -151,7 +151,7 @@ impl From for &'static str { } /// Errors that can occur while checking the validity of a transaction. -#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, Debug, TypeInfo)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum TransactionValidityError { /// The transaction is invalid. @@ -240,7 +240,7 @@ impl From for TransactionValidity { /// Depending on the source we might apply different validation schemes. /// For instance we can disallow specific kinds of transactions if they were not produced /// by our local node (for instance off-chain workers). -#[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo, Hash)] +#[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, Debug, TypeInfo, Hash)] pub enum TransactionSource { /// Transaction is already included in block. /// @@ -265,7 +265,7 @@ pub enum TransactionSource { } /// Information concerning a valid transaction. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug, TypeInfo)] pub struct ValidTransaction { /// Priority of the transaction. /// @@ -353,7 +353,7 @@ impl ValidTransaction { /// /// Allows to easily construct `ValidTransaction` and most importantly takes care of /// prefixing `requires` and `provides` tags to avoid conflicts. -#[derive(Default, Clone, RuntimeDebug)] +#[derive(Default, Clone, Debug)] pub struct ValidTransactionBuilder { prefix: Option<&'static str>, validity: ValidTransaction, diff --git a/substrate/primitives/session/src/lib.rs b/substrate/primitives/session/src/lib.rs index 3225097b665e6..79de8214f95dd 100644 --- a/substrate/primitives/session/src/lib.rs +++ b/substrate/primitives/session/src/lib.rs @@ -29,8 +29,8 @@ use sp_api::ProvideRuntimeApi; use sp_runtime::traits::Block as BlockT; use alloc::vec::Vec; -use sp_core::RuntimeDebug; use sp_staking::SessionIndex; +use Debug; pub mod runtime_api; pub use runtime_api::*; @@ -47,7 +47,7 @@ pub type ValidatorCount = u32; Eq, PartialEq, Default, - RuntimeDebug, + Debug, scale_info::TypeInfo, )] pub struct MembershipProof { diff --git a/substrate/primitives/staking/src/lib.rs b/substrate/primitives/staking/src/lib.rs index 863e6cbe2b20f..54cfdf16187bf 100644 --- a/substrate/primitives/staking/src/lib.rs +++ b/substrate/primitives/staking/src/lib.rs @@ -29,7 +29,7 @@ use core::ops::{Add, AddAssign, Sub, SubAssign}; use scale_info::TypeInfo; use sp_runtime::{ traits::{AtLeast32BitUnsigned, Zero}, - DispatchError, DispatchResult, Perbill, RuntimeDebug, Saturating, + Debug, DispatchError, DispatchResult, Perbill, Saturating, }; pub mod offence; @@ -62,7 +62,7 @@ impl From for StakingAccount { } /// Representation of the status of a staker. -#[derive(RuntimeDebug, TypeInfo)] +#[derive(Debug, TypeInfo)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone))] pub enum StakerStatus { /// Chilling. @@ -75,7 +75,7 @@ pub enum StakerStatus { /// A struct that reflects stake that an account has in the staking system. Provides a set of /// methods to operate on it's properties. Aimed at making `StakingInterface` more concise. -#[derive(RuntimeDebug, Clone, Copy, Eq, PartialEq, Default)] +#[derive(Debug, Clone, Copy, Eq, PartialEq, Default)] pub struct Stake { /// The total stake that `stash` has in the staking system. This includes the /// `active` stake, and any funds currently in the process of unbonding via @@ -355,7 +355,7 @@ pub trait StakingUnchecked: StakingInterface { Encode, Decode, DecodeWithMemTracking, - RuntimeDebug, + Debug, TypeInfo, Copy, )] @@ -369,16 +369,7 @@ pub struct IndividualExposure { /// A snapshot of the stake backing a single validator in the system. #[derive( - PartialEq, - Eq, - PartialOrd, - Ord, - Clone, - Encode, - Decode, - DecodeWithMemTracking, - RuntimeDebug, - TypeInfo, + PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, )] pub struct Exposure { /// The total balance backing this validator. @@ -463,7 +454,7 @@ impl< } /// A snapshot of the stake backing a single validator in the system. -#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, Debug, TypeInfo)] pub struct ExposurePage { /// The total balance of this chunk/page. #[codec(compact)] @@ -504,7 +495,7 @@ impl From { } /// Errors that may happen on offence reports. -#[derive(PartialEq, sp_runtime::RuntimeDebug)] +#[derive(PartialEq, Debug)] pub enum OffenceError { /// The report has already been submitted. DuplicateReport, @@ -169,7 +169,7 @@ impl OnOffenceHandler } /// A details about an offending authority for a particular kind of offence. -#[derive(Clone, PartialEq, Eq, Encode, Decode, sp_runtime::RuntimeDebug, scale_info::TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug, scale_info::TypeInfo)] pub struct OffenceDetails { /// The offending authority id pub offender: Offender, diff --git a/substrate/primitives/statement-store/src/lib.rs b/substrate/primitives/statement-store/src/lib.rs index 99524207a0b05..5c1ba7839209f 100644 --- a/substrate/primitives/statement-store/src/lib.rs +++ b/substrate/primitives/statement-store/src/lib.rs @@ -92,9 +92,7 @@ pub fn hash_encoded(data: &[u8]) -> [u8; 32] { } /// Statement proof. -#[derive( - Encode, Decode, DecodeWithMemTracking, TypeInfo, sp_core::RuntimeDebug, Clone, PartialEq, Eq, -)] +#[derive(Encode, Decode, DecodeWithMemTracking, TypeInfo, Debug, Clone, PartialEq, Eq)] pub enum Proof { /// Sr25519 Signature. Sr25519 { @@ -143,7 +141,7 @@ impl Proof { /// Statement attributes. Each statement is a list of 0 or more fields. Fields may only appear once /// and in the order declared here. -#[derive(Encode, Decode, TypeInfo, sp_core::RuntimeDebug, Clone, PartialEq, Eq)] +#[derive(Encode, Decode, TypeInfo, Debug, Clone, PartialEq, Eq)] #[repr(u8)] pub enum Field { /// Statement proof. @@ -175,7 +173,7 @@ impl Field { } /// Statement structure. -#[derive(DecodeWithMemTracking, TypeInfo, sp_core::RuntimeDebug, Clone, PartialEq, Eq, Default)] +#[derive(DecodeWithMemTracking, TypeInfo, Debug, Clone, PartialEq, Eq, Default)] pub struct Statement { proof: Option, decryption_key: Option, diff --git a/substrate/primitives/statement-store/src/runtime_api.rs b/substrate/primitives/statement-store/src/runtime_api.rs index 98f9b7a623919..f24b66fcfcc6f 100644 --- a/substrate/primitives/statement-store/src/runtime_api.rs +++ b/substrate/primitives/statement-store/src/runtime_api.rs @@ -21,7 +21,6 @@ use crate::{Hash, Statement, Topic}; use alloc::vec::Vec; use codec::{Decode, Encode}; use scale_info::TypeInfo; -use sp_runtime::RuntimeDebug; use sp_runtime_interface::{ pass_by::{ AllocateAndReturnByCodec, PassFatPointerAndDecode, PassFatPointerAndDecodeSlice, @@ -29,12 +28,13 @@ use sp_runtime_interface::{ }, runtime_interface, }; +use Debug; #[cfg(feature = "std")] use sp_externalities::ExternalitiesExt; /// Information concerning a valid statement. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug, TypeInfo)] pub struct ValidStatement { /// Max statement count for this account, as calculated by the runtime. pub max_count: u32, @@ -43,7 +43,7 @@ pub struct ValidStatement { } /// An reason for an invalid statement. -#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, Debug, TypeInfo)] pub enum InvalidStatement { /// Failed proof validation. BadProof, @@ -56,7 +56,7 @@ pub enum InvalidStatement { /// The source of the statement. /// /// Depending on the source we might apply different validation schemes. -#[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, Debug, TypeInfo)] pub enum StatementSource { /// Statement is coming from the on-chain worker. Chain, diff --git a/substrate/primitives/storage/src/lib.rs b/substrate/primitives/storage/src/lib.rs index 3a50ca1fe6183..9d2195c843312 100644 --- a/substrate/primitives/storage/src/lib.rs +++ b/substrate/primitives/storage/src/lib.rs @@ -23,7 +23,6 @@ extern crate alloc; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -use sp_debug_derive::RuntimeDebug; use alloc::vec::Vec; use codec::{Decode, Encode}; @@ -34,7 +33,7 @@ use core::{ use ref_cast::RefCast; /// Storage key. -#[derive(PartialEq, Eq, RuntimeDebug, Hash, PartialOrd, Ord, Clone, Encode, Decode)] +#[derive(PartialEq, Eq, Debug, Hash, PartialOrd, Ord, Clone, Encode, Decode)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct StorageKey( #[cfg_attr(feature = "serde", serde(with = "impl_serde::serialize"))] pub Vec, @@ -47,7 +46,7 @@ impl AsRef<[u8]> for StorageKey { } /// Storage key with read/write tracking information. -#[derive(PartialEq, Eq, Ord, PartialOrd, core::hash::Hash, RuntimeDebug, Clone, Encode, Decode)] +#[derive(PartialEq, Eq, Ord, PartialOrd, core::hash::Hash, Debug, Clone, Encode, Decode)] pub struct TrackedStorageKey { pub key: Vec, pub reads: u32, @@ -95,7 +94,7 @@ impl From> for TrackedStorageKey { } /// Storage key of a child trie, it contains the prefix to the key. -#[derive(PartialEq, Eq, RuntimeDebug, Hash, PartialOrd, Ord, Clone)] +#[derive(PartialEq, Eq, Debug, Hash, PartialOrd, Ord, Clone)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[repr(transparent)] #[derive(RefCast)] @@ -136,7 +135,7 @@ impl PrefixedStorageKey { } /// Storage data associated to a [`StorageKey`]. -#[derive(PartialEq, Eq, RuntimeDebug, Hash, PartialOrd, Ord, Clone, Encode, Decode, Default)] +#[derive(PartialEq, Eq, Debug, Hash, PartialOrd, Ord, Clone, Encode, Decode, Default)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct StorageData( #[cfg_attr(feature = "serde", serde(with = "impl_serde::serialize"))] pub Vec, @@ -174,7 +173,7 @@ pub struct Storage { } /// Storage change set -#[derive(RuntimeDebug, PartialEq, Eq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct StorageChangeSet { diff --git a/substrate/primitives/test-primitives/src/lib.rs b/substrate/primitives/test-primitives/src/lib.rs index 9c6b79318dc53..b8b150a607c76 100644 --- a/substrate/primitives/test-primitives/src/lib.rs +++ b/substrate/primitives/test-primitives/src/lib.rs @@ -27,7 +27,7 @@ pub use sp_application_crypto; use sp_application_crypto::sr25519; use alloc::vec::Vec; -pub use sp_core::{hash::H256, RuntimeDebug}; +pub use sp_core::hash::H256; use sp_runtime::{ traits::{BlakeTwo256, ExtrinsicLike, LazyExtrinsic, Verify}, OpaqueExtrinsic, @@ -35,7 +35,7 @@ use sp_runtime::{ /// Extrinsic for test-runtime. #[derive( - Clone, PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, scale_info::TypeInfo, + Clone, PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, Debug, scale_info::TypeInfo, )] pub enum Extrinsic { IncludeData(Vec), diff --git a/substrate/primitives/timestamp/src/lib.rs b/substrate/primitives/timestamp/src/lib.rs index a91ee16afe8e3..b37e0ebc449a9 100644 --- a/substrate/primitives/timestamp/src/lib.rs +++ b/substrate/primitives/timestamp/src/lib.rs @@ -131,7 +131,7 @@ impl From for Timestamp { } /// Errors that can occur while checking the timestamp inherent. -#[derive(Encode, sp_runtime::RuntimeDebug)] +#[derive(Encode, Debug)] #[cfg_attr(feature = "std", derive(Decode, thiserror::Error))] pub enum InherentError { /// The time between the blocks is too short. diff --git a/substrate/primitives/transaction-storage-proof/src/lib.rs b/substrate/primitives/transaction-storage-proof/src/lib.rs index 0dad6a748b385..c92197a3fc308 100644 --- a/substrate/primitives/transaction-storage-proof/src/lib.rs +++ b/substrate/primitives/transaction-storage-proof/src/lib.rs @@ -42,7 +42,7 @@ pub const CHUNK_SIZE: usize = 256; pub type ChunkIndex = u32; /// Errors that can occur while checking the storage proof. -#[derive(Encode, sp_runtime::RuntimeDebug)] +#[derive(Encode, Debug)] #[cfg_attr(feature = "std", derive(Decode))] pub enum InherentError { InvalidProof, diff --git a/substrate/primitives/trie/src/node_header.rs b/substrate/primitives/trie/src/node_header.rs index dc33e6bd61492..6644fa01a5370 100644 --- a/substrate/primitives/trie/src/node_header.rs +++ b/substrate/primitives/trie/src/node_header.rs @@ -22,7 +22,7 @@ use codec::{Decode, Encode, Input, Output}; use core::iter::once; /// A node header -#[derive(Copy, Clone, PartialEq, Eq, sp_core::RuntimeDebug)] +#[derive(Copy, Clone, PartialEq, Eq, Debug)] pub(crate) enum NodeHeader { Null, // contains wether there is a value and nibble count diff --git a/substrate/primitives/version/src/lib.rs b/substrate/primitives/version/src/lib.rs index fbc99211a1a87..ffa8a9c511007 100644 --- a/substrate/primitives/version/src/lib.rs +++ b/substrate/primitives/version/src/lib.rs @@ -162,7 +162,7 @@ macro_rules! create_apis_vec { /// In particular: bug fixes should result in an increment of `spec_version` and possibly /// `authoring_version`, absolutely not `impl_version` since they change the semantics of the /// runtime. -#[derive(Clone, PartialEq, Eq, Encode, Default, sp_runtime::RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Default, Debug, TypeInfo)] pub struct RuntimeVersion { /// Identifies the different Substrate runtimes. There'll be at least polkadot and node. /// A different on-chain spec_name to that of the native runtime would normally result diff --git a/substrate/primitives/weights/src/lib.rs b/substrate/primitives/weights/src/lib.rs index b2c956266e2c3..bbc5ee75ab7cb 100644 --- a/substrate/primitives/weights/src/lib.rs +++ b/substrate/primitives/weights/src/lib.rs @@ -34,7 +34,6 @@ use sp_arithmetic::{ traits::{BaseArithmetic, SaturatedConversion, Unsigned}, Perbill, }; -use sp_debug_derive::RuntimeDebug; pub use weight_meter::*; pub use weight_v2::*; @@ -53,7 +52,7 @@ pub mod constants { /// /// NOTE: This is currently only measured in computational time, and will probably /// be updated all together once proof size is accounted for. -#[derive(Clone, Copy, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode, TypeInfo)] +#[derive(Clone, Copy, Eq, PartialEq, Default, Debug, Encode, Decode, TypeInfo)] pub struct RuntimeDbWeight { pub read: u64, pub write: u64, diff --git a/substrate/test-utils/runtime/src/lib.rs b/substrate/test-utils/runtime/src/lib.rs index a04b05021bb46..62a03537f7f60 100644 --- a/substrate/test-utils/runtime/src/lib.rs +++ b/substrate/test-utils/runtime/src/lib.rs @@ -54,7 +54,7 @@ use sp_application_crypto::{ecdsa, ed25519, sr25519, RuntimeAppPublic}; #[cfg(feature = "bls-experimental")] use sp_application_crypto::{bls381, ecdsa_bls381}; -use sp_core::{OpaqueMetadata, RuntimeDebug}; +use sp_core::OpaqueMetadata; use sp_trie::{ trie_types::{TrieDBBuilder, TrieDBMutBuilderV1}, PrefixedMemoryDB, StorageProof, @@ -140,7 +140,7 @@ pub fn native_version() -> NativeVersion { } /// Transfer data extracted from Extrinsic containing `Balances::transfer_allow_death`. -#[derive(Clone, PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] +#[derive(Clone, PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo)] pub struct TransferData { pub from: AccountId, pub to: AccountId, @@ -275,9 +275,7 @@ pub type Executive = frame_executive::Executive< AllPalletsWithSystem, >; -#[derive( - Copy, Clone, PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo, -)] +#[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo)] pub struct CheckSubstrateCall; impl sp_runtime::traits::Printable for CheckSubstrateCall { diff --git a/substrate/utils/frame/benchmarking-cli/src/overhead/command.rs b/substrate/utils/frame/benchmarking-cli/src/overhead/command.rs index c8b61fe92b617..ce9022f1ffcdf 100644 --- a/substrate/utils/frame/benchmarking-cli/src/overhead/command.rs +++ b/substrate/utils/frame/benchmarking-cli/src/overhead/command.rs @@ -65,7 +65,7 @@ use sp_runtime::{ use sp_storage::Storage; use sp_wasm_interface::HostFunctions; use std::{ - fmt::{Debug, Display, Formatter}, + fmt::{Display, Formatter}, fs, path::PathBuf, sync::Arc,