git.delta.rocks / unique-network / refs/commits / aa6b9ea4ef79

difftreelog

Merge pull request #821 from UniqueNetwork/refactor/simplify-construct-runtime-macro

Yaroslav Bolyukin2023-01-10parents: #fe83568 #96fe90f.patch.diff
in: master
Simplify construct runtime macro

11 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8942,6 +8942,7 @@
  "pallet-structure",
  "pallet-sudo",
  "pallet-template-transaction-payment",
+ "pallet-test-utils",
  "pallet-timestamp",
  "pallet-transaction-payment",
  "pallet-transaction-payment-rpc-runtime-api",
@@ -13174,6 +13175,7 @@
  "pallet-structure",
  "pallet-sudo",
  "pallet-template-transaction-payment",
+ "pallet-test-utils",
  "pallet-timestamp",
  "pallet-transaction-payment",
  "pallet-transaction-payment-rpc-runtime-api",
addedruntime/common/construct_runtime.rsdiffbeforeafterboth
--- /dev/null
+++ b/runtime/common/construct_runtime.rs
@@ -0,0 +1,113 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+#[macro_export]
+macro_rules! construct_runtime {
+    () => {
+            frame_support::construct_runtime! {
+
+            pub enum Runtime where
+                Block = Block,
+                NodeBlock = opaque::Block,
+                UncheckedExtrinsic = UncheckedExtrinsic
+            {
+                System: frame_system = 0,
+
+                ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
+                ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
+
+                #[cfg(feature = "collator-selection")]
+                Authorship: pallet_authorship::{Pallet, Call, Storage} = 22,
+
+                #[cfg(feature = "collator-selection")]
+                CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event<T>, Config<T>} = 23,
+
+                #[cfg(feature = "collator-selection")]
+                Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = 24,
+
+                Aura: pallet_aura::{Pallet, Config<T>} = 25,
+                AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 26,
+
+                Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
+                RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,
+                Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,
+                TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>} = 33,
+                Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,
+                Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,
+                Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,
+
+                XTokens: orml_xtokens = 38,
+                Tokens: orml_tokens = 39,
+                // Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
+
+                #[cfg(feature = "collator-selection")]
+                Identity: pallet_identity::{Pallet, Call, Storage, Event<T>} = 40,
+
+                // XCM helpers.
+                XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,
+                PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,
+                CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,
+                DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,
+
+                // Unique Pallets
+                Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
+                Unique: pallet_unique::{Pallet, Call, Storage} = 61,
+
+                // #[cfg(feature = "scheduler")]
+                // Scheduler: pallet_unique_scheduler_v2::{Pallet, Call, Storage, Event<T>} = 62,
+
+                Configuration: pallet_configuration::{Pallet, Call, Storage, Event<T>} = 63,
+
+                Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
+                // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
+                Common: pallet_common::{Pallet, Storage, Event<T>} = 66,
+                Fungible: pallet_fungible::{Pallet, Storage} = 67,
+
+                #[cfg(feature = "refungible")]
+                Refungible: pallet_refungible::{Pallet, Storage} = 68,
+
+                Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
+                Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
+
+                #[cfg(feature = "rmrk")]
+                RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,
+
+                #[cfg(feature = "rmrk")]
+                RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
+
+                #[cfg(feature = "app-promotion")]
+                AppPromotion: pallet_app_promotion::{Pallet, Call, Storage, Event<T>} = 73,
+
+                #[cfg(feature = "foreign-assets")]
+                ForeignAssets: pallet_foreign_assets::{Pallet, Call, Storage, Event<T>} = 80,
+
+                // Frontier
+                EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
+                Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
+
+                EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,
+                EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage, Event<T>} = 151,
+                EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
+                EvmMigration: pallet_evm_migration::{Pallet, Call, Storage, Event<T>} = 153,
+
+                Maintenance: pallet_maintenance::{Pallet, Call, Storage, Event<T>} = 154,
+
+                #[cfg(feature = "pallet-test-utils")]
+                TestUtils: pallet_test_utils = 255,
+            }
+        }
+    }
+}
deletedruntime/common/construct_runtime/mod.rsdiffbeforeafterboth
--- a/runtime/common/construct_runtime/mod.rs
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-mod util;
-
-#[macro_export]
-macro_rules! construct_runtime {
-    ($select_runtime:ident) => {
-        $crate::construct_runtime_impl! {
-            select_runtime($select_runtime);
-
-            pub enum Runtime where
-                Block = Block,
-                NodeBlock = opaque::Block,
-                UncheckedExtrinsic = UncheckedExtrinsic
-            {
-                System: frame_system = 0,
-
-                ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
-                ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
-
-                #[runtimes(quartz)]
-                Authorship: pallet_authorship::{Pallet, Call, Storage} = 22,
-
-                #[runtimes(quartz)]
-                CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event<T>, Config<T>} = 23,
-
-                #[runtimes(quartz)]
-                Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = 24,
-
-                Aura: pallet_aura::{Pallet, Config<T>} = 25,
-                AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 26,
-
-                Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
-                RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,
-                Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,
-                TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>} = 33,
-                Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,
-                Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,
-                Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,
-
-                XTokens: orml_xtokens = 38,
-                Tokens: orml_tokens = 39,
-                // Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
-
-                #[runtimes(quartz)]
-                Identity: pallet_identity::{Pallet, Call, Storage, Event<T>} = 40,
-
-                // XCM helpers.
-                XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,
-                PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,
-                CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,
-                DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,
-
-                // Unique Pallets
-                Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
-                Unique: pallet_unique::{Pallet, Call, Storage} = 61,
-
-                // #[runtimes(opal)]
-                // Scheduler: pallet_unique_scheduler_v2::{Pallet, Call, Storage, Event<T>} = 62,
-
-                Configuration: pallet_configuration::{Pallet, Call, Storage, Event<T>} = 63,
-
-                Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
-                // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
-                Common: pallet_common::{Pallet, Storage, Event<T>} = 66,
-                Fungible: pallet_fungible::{Pallet, Storage} = 67,
-
-                #[runtimes(opal, quartz)]
-                Refungible: pallet_refungible::{Pallet, Storage} = 68,
-
-                Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
-                Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
-
-                #[runtimes(opal)]
-                RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,
-
-                #[runtimes(opal)]
-                RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
-
-                #[runtimes(opal, quartz)]
-                AppPromotion: pallet_app_promotion::{Pallet, Call, Storage, Event<T>} = 73,
-
-                #[runtimes(opal, quartz, unique)]
-                ForeignAssets: pallet_foreign_assets::{Pallet, Call, Storage, Event<T>} = 80,
-
-                // Frontier
-                EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
-                Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
-
-                EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,
-                EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage, Event<T>} = 151,
-                EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
-                EvmMigration: pallet_evm_migration::{Pallet, Call, Storage, Event<T>} = 153,
-
-                Maintenance: pallet_maintenance::{Pallet, Call, Storage, Event<T>} = 154,
-
-                #[runtimes(opal)]
-                TestUtils: pallet_test_utils = 255,
-            }
-        }
-    }
-}
deletedruntime/common/construct_runtime/util.rsdiffbeforeafterboth
--- a/runtime/common/construct_runtime/util.rs
+++ /dev/null
@@ -1,222 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-#[macro_export]
-macro_rules! construct_runtime_impl {
-    (
-        select_runtime($select_runtime:ident);
-
-        pub enum Runtime where
-            $($where_ident:ident = $where_ty:ty),* $(,)?
-        {
-            $(
-                $(#[runtimes($($pallet_runtimes:ident),+ $(,)?)])?
-                $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal
-            ),*
-            $(,)?
-        }
-    ) => {
-        $crate::construct_runtime_helper! {
-            select_runtime($select_runtime),
-            selected_pallets(),
-
-            where_clause($($where_ident = $where_ty),*),
-            pallets(
-                $(
-                    $(#[runtimes($($pallet_runtimes),+)])?
-                    $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index
-                ),*,
-            )
-        }
-    }
-}
-
-#[macro_export]
-macro_rules! construct_runtime_helper {
-    (
-        select_runtime($select_runtime:ident),
-        selected_pallets($($selected_pallets:tt)*),
-
-        where_clause($($where_clause:tt)*),
-        pallets(
-            #[runtimes($($pallet_runtimes:ident),+)]
-            $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal,
-
-            $($pallets_tl:tt)*
-        )
-    ) => {
-        $crate::add_runtime_specific_pallets! {
-            select_runtime($select_runtime),
-            runtimes($($pallet_runtimes),+,),
-            selected_pallets($($selected_pallets)*),
-
-            where_clause($($where_clause)*),
-            pallets(
-                $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,
-                $($pallets_tl)*
-            )
-        }
-    };
-
-    (
-        select_runtime($select_runtime:ident),
-        selected_pallets($($selected_pallets:tt)*),
-
-        where_clause($($where_clause:tt)*),
-        pallets(
-            $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal,
-
-            $($pallets_tl:tt)*
-        )
-    ) => {
-        $crate::construct_runtime_helper! {
-            select_runtime($select_runtime),
-            selected_pallets(
-                $($selected_pallets)*
-                $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,
-            ),
-
-            where_clause($($where_clause)*),
-            pallets($($pallets_tl)*)
-        }
-    };
-
-    (
-        select_runtime($select_runtime:ident),
-        selected_pallets($($selected_pallets:tt)*),
-
-        where_clause($($where_clause:tt)*),
-        pallets()
-    ) => {
-        frame_support::construct_runtime! {
-            pub enum Runtime where
-                $($where_clause)*
-            {
-                $($selected_pallets)*
-            }
-        }
-    };
-}
-
-#[macro_export]
-macro_rules! add_runtime_specific_pallets {
-    (
-        select_runtime(opal),
-        runtimes(opal, $($_runtime_tl:tt)*),
-        selected_pallets($($selected_pallets:tt)*),
-
-        where_clause($($where_clause:tt)*),
-        pallets(
-            $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal,
-            $($pallets_tl:tt)*
-        )
-    ) => {
-        $crate::construct_runtime_helper! {
-            select_runtime(opal),
-            selected_pallets(
-                $($selected_pallets)*
-                $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,
-            ),
-
-            where_clause($($where_clause)*),
-            pallets($($pallets_tl)*)
-        }
-    };
-
-    (
-        select_runtime(quartz),
-        runtimes(quartz, $($_runtime_tl:tt)*),
-        selected_pallets($($selected_pallets:tt)*),
-
-        where_clause($($where_clause:tt)*),
-        pallets(
-            $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal,
-            $($pallets_tl:tt)*
-        )
-    ) => {
-        $crate::construct_runtime_helper! {
-            select_runtime(quartz),
-            selected_pallets(
-                $($selected_pallets)*
-                $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,
-            ),
-
-            where_clause($($where_clause)*),
-            pallets($($pallets_tl)*)
-        }
-    };
-
-    (
-        select_runtime(unique),
-        runtimes(unique, $($_runtime_tl:tt)*),
-        selected_pallets($($selected_pallets:tt)*),
-
-        where_clause($($where_clause:tt)*),
-        pallets(
-            $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal,
-            $($pallets_tl:tt)*
-        )
-    ) => {
-        $crate::construct_runtime_helper! {
-            select_runtime(unique),
-            selected_pallets(
-                $($selected_pallets)*
-                $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,
-            ),
-
-            where_clause($($where_clause)*),
-            pallets($($pallets_tl)*)
-        }
-    };
-
-    (
-        select_runtime($select_runtime:ident),
-        runtimes($_current_runtime:ident, $($runtime_tl:tt)*),
-        selected_pallets($($selected_pallets:tt)*),
-
-        where_clause($($where_clause:tt)*),
-        pallets($($pallets:tt)*)
-    ) => {
-        $crate::add_runtime_specific_pallets! {
-            select_runtime($select_runtime),
-            runtimes($($runtime_tl)*),
-            selected_pallets($($selected_pallets)*),
-
-            where_clause($($where_clause)*),
-            pallets($($pallets)*)
-        }
-    };
-
-    (
-        select_runtime($select_runtime:ident),
-        runtimes(),
-        selected_pallets($($selected_pallets:tt)*),
-
-        where_clause($($where_clause:tt)*),
-        pallets(
-            $_pallet_name:ident: $_pallet_mod:ident$(::{$($_pallet_parts:ty),*})? = $_index:literal,
-            $($pallets_tl:tt)*
-        )
-    ) => {
-        $crate::construct_runtime_helper! {
-            select_runtime($select_runtime),
-            selected_pallets($($selected_pallets)*),
-
-            where_clause($($where_clause)*),
-            pallets($($pallets_tl)*)
-        }
-    };
-}
modifiedruntime/common/identity.rsdiffbeforeafterboth
--- a/runtime/common/identity.rs
+++ b/runtime/common/identity.rs
@@ -21,11 +21,12 @@
 
 use sp_runtime::{
 	traits::{DispatchInfoOf, SignedExtension},
-	transaction_validity::{
-		TransactionValidity, ValidTransaction, InvalidTransaction, TransactionValidityError,
-	},
+	transaction_validity::{TransactionValidity, ValidTransaction, TransactionValidityError},
 };
 
+#[cfg(feature = "collator-selection")]
+use sp_runtime::transaction_validity::InvalidTransaction;
+
 #[derive(Debug, Encode, Decode, PartialEq, Eq, Clone, TypeInfo)]
 pub struct DisableIdentityCalls;
 
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -98,7 +98,7 @@
     'pallet-base-fee/try-runtime',
     'pallet-unique-scheduler-v2/try-runtime',
     'pallet-maintenance/try-runtime',
-    'pallet-test-utils?/try-runtime',
+    'pallet-test-utils/try-runtime',
     'fp-self-contained/try-runtime',
 ]
 std = [
@@ -186,7 +186,7 @@
     "pallet-foreign-assets/std",
 
     'pallet-maintenance/std',
-    'pallet-test-utils?/std',
+    'pallet-test-utils/std',
 ]
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
 opal-runtime = [
@@ -204,6 +204,7 @@
 foreign-assets = []
 app-promotion = []
 collator-selection = []
+pallet-test-utils = []
 
 ################################################################################
 # Substrate Dependencies
@@ -532,7 +533,7 @@
 ################################################################################
 # Test dependencies
 
-pallet-test-utils = { optional = true, default-features = false, path = "../../test-pallets/utils" }
+pallet-test-utils = { default-features = false, path = "../../test-pallets/utils" }
 
 ################################################################################
 # Other Dependencies
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
before · runtime/opal/src/lib.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.1819#![cfg_attr(not(feature = "std"), no_std)]20// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.21#![recursion_limit = "1024"]22#![allow(clippy::from_over_into, clippy::identity_op)]23#![allow(clippy::fn_to_numeric_cast_with_truncation)]24// Make the WASM binary available.25#[cfg(feature = "std")]26include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));2728extern crate alloc;2930use frame_support::parameter_types;3132use sp_version::RuntimeVersion;33use sp_runtime::create_runtime_str;3435use up_common::types::*;3637#[path = "../../common/mod.rs"]38mod runtime_common;3940pub mod xcm_barrier;4142#[cfg(test)]43mod tests;4445pub use runtime_common::*;4647pub const RUNTIME_NAME: &str = "opal";48pub const TOKEN_SYMBOL: &str = "OPL";4950/// This runtime version.51pub const VERSION: RuntimeVersion = RuntimeVersion {52	spec_name: create_runtime_str!(RUNTIME_NAME),53	impl_name: create_runtime_str!(RUNTIME_NAME),54	authoring_version: 1,55	spec_version: 936050,56	impl_version: 0,57	apis: RUNTIME_API_VERSIONS,58	transaction_version: 3,59	state_version: 0,60};6162parameter_types! {63	pub const Version: RuntimeVersion = VERSION;64	pub const SS58Prefix: u16 = 42;65	pub const ChainId: u64 = 8882;66}6768construct_runtime!(opal);6970impl_common_runtime_apis!();7172cumulus_pallet_parachain_system::register_validate_block!(73	Runtime = Runtime,74	BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,75	CheckInherents = CheckInherents,76);
after · runtime/opal/src/lib.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.1819#![cfg_attr(not(feature = "std"), no_std)]20// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.21#![recursion_limit = "1024"]22#![allow(clippy::from_over_into, clippy::identity_op)]23#![allow(clippy::fn_to_numeric_cast_with_truncation)]24// Make the WASM binary available.25#[cfg(feature = "std")]26include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));2728extern crate alloc;2930use frame_support::parameter_types;3132use sp_version::RuntimeVersion;33use sp_runtime::create_runtime_str;3435use up_common::types::*;3637#[path = "../../common/mod.rs"]38mod runtime_common;3940pub mod xcm_barrier;4142#[cfg(test)]43mod tests;4445pub use runtime_common::*;4647pub const RUNTIME_NAME: &str = "opal";48pub const TOKEN_SYMBOL: &str = "OPL";4950/// This runtime version.51pub const VERSION: RuntimeVersion = RuntimeVersion {52	spec_name: create_runtime_str!(RUNTIME_NAME),53	impl_name: create_runtime_str!(RUNTIME_NAME),54	authoring_version: 1,55	spec_version: 936050,56	impl_version: 0,57	apis: RUNTIME_API_VERSIONS,58	transaction_version: 3,59	state_version: 0,60};6162parameter_types! {63	pub const Version: RuntimeVersion = VERSION;64	pub const SS58Prefix: u16 = 42;65	pub const ChainId: u64 = 8882;66}6768construct_runtime!();6970impl_common_runtime_apis!();7172cumulus_pallet_parachain_system::register_validate_block!(73	Runtime = Runtime,74	BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,75	CheckInherents = CheckInherents,76);
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -524,6 +524,11 @@
 num_enum = { version = "0.5.3", default-features = false }
 
 ################################################################################
+# Test dependencies
+
+pallet-test-utils = { default-features = false, path = "../../test-pallets/utils" }
+
+################################################################################
 # Other Dependencies
 
 impl-trait-for-tuples = "0.2.2"
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -77,7 +77,7 @@
 	pub const ChainId: u64 = 8881;
 }
 
-construct_runtime!(quartz);
+construct_runtime!();
 
 impl_common_runtime_apis!();
 
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -516,6 +516,11 @@
 num_enum = { version = "0.5.3", default-features = false }
 
 ################################################################################
+# Test dependencies
+
+pallet-test-utils = { default-features = false, path = "../../test-pallets/utils" }
+
+################################################################################
 # Other Dependencies
 
 impl-trait-for-tuples = "0.2.2"
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -65,7 +65,7 @@
 	pub const ChainId: u64 = 8880;
 }
 
-construct_runtime!(unique);
+construct_runtime!();
 
 impl_common_runtime_apis!();