From 1827f4934a9ad2949f827dd22c7e45f8bb22257d Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Fri, 19 Apr 2024 13:48:32 +0300 Subject: [PATCH 1/3] config: Add Debug Clone for common configs Signed-off-by: Alexandru Vasile --- core/src/config/polkadot.rs | 1 + core/src/config/substrate.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/core/src/config/polkadot.rs b/core/src/config/polkadot.rs index 500ea80521..43e453ebc0 100644 --- a/core/src/config/polkadot.rs +++ b/core/src/config/polkadot.rs @@ -11,6 +11,7 @@ pub use crate::utils::{AccountId32, MultiAddress, MultiSignature}; pub use primitive_types::{H256, U256}; /// Default set of commonly used types by Polkadot nodes. +#[derive(Debug, Clone)] pub enum PolkadotConfig {} impl Config for PolkadotConfig { diff --git a/core/src/config/substrate.rs b/core/src/config/substrate.rs index 9c7ff96e9e..4ff14a16d6 100644 --- a/core/src/config/substrate.rs +++ b/core/src/config/substrate.rs @@ -16,6 +16,7 @@ pub use primitive_types::{H256, U256}; /// Default set of commonly used types by Substrate runtimes. // Note: We only use this at the type level, so it should be impossible to // create an instance of it. +#[derive(Debug, Clone)] pub enum SubstrateConfig {} impl Config for SubstrateConfig { From 8db0b3c7fab940ff617f5c9c26e1704afda7e4a1 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Fri, 19 Apr 2024 15:36:40 +0300 Subject: [PATCH 2/3] Add copy impl Signed-off-by: Alexandru Vasile --- core/src/config/polkadot.rs | 2 +- core/src/config/substrate.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/config/polkadot.rs b/core/src/config/polkadot.rs index 43e453ebc0..e574561437 100644 --- a/core/src/config/polkadot.rs +++ b/core/src/config/polkadot.rs @@ -11,7 +11,7 @@ pub use crate::utils::{AccountId32, MultiAddress, MultiSignature}; pub use primitive_types::{H256, U256}; /// Default set of commonly used types by Polkadot nodes. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Copy)] pub enum PolkadotConfig {} impl Config for PolkadotConfig { diff --git a/core/src/config/substrate.rs b/core/src/config/substrate.rs index 4ff14a16d6..3f30c4a77b 100644 --- a/core/src/config/substrate.rs +++ b/core/src/config/substrate.rs @@ -16,7 +16,7 @@ pub use primitive_types::{H256, U256}; /// Default set of commonly used types by Substrate runtimes. // Note: We only use this at the type level, so it should be impossible to // create an instance of it. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Copy)] pub enum SubstrateConfig {} impl Config for SubstrateConfig { From 07d88d580a2243a18458ff9ced521323b7038a10 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 22 Apr 2024 19:45:33 +0300 Subject: [PATCH 3/3] Add other traits Signed-off-by: Alexandru Vasile --- core/src/config/polkadot.rs | 4 +++- core/src/config/substrate.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/config/polkadot.rs b/core/src/config/polkadot.rs index e574561437..7f4e3a88f9 100644 --- a/core/src/config/polkadot.rs +++ b/core/src/config/polkadot.rs @@ -11,7 +11,9 @@ pub use crate::utils::{AccountId32, MultiAddress, MultiSignature}; pub use primitive_types::{H256, U256}; /// Default set of commonly used types by Polkadot nodes. -#[derive(Debug, Clone, Copy)] +// Note: The trait implementations exist just to make life easier, +// but shouldn't strictly be necessary since users can't instantiate this type. +#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] pub enum PolkadotConfig {} impl Config for PolkadotConfig { diff --git a/core/src/config/substrate.rs b/core/src/config/substrate.rs index 3f30c4a77b..ef71f5a54a 100644 --- a/core/src/config/substrate.rs +++ b/core/src/config/substrate.rs @@ -16,7 +16,9 @@ pub use primitive_types::{H256, U256}; /// Default set of commonly used types by Substrate runtimes. // Note: We only use this at the type level, so it should be impossible to // create an instance of it. -#[derive(Debug, Clone, Copy)] +// The trait implementations exist just to make life easier, +// but shouldn't strictly be necessary since users can't instantiate this type. +#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] pub enum SubstrateConfig {} impl Config for SubstrateConfig {