git.delta.rocks / unique-network / refs/commits / 9f1da529327c

difftreelog

fix test-pallet included only in opal

Daniel Shiposha2022-10-11parent: #18c626a.patch.diff
in: master

8 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8805,7 +8805,6 @@
  "pallet-structure",
  "pallet-sudo",
  "pallet-template-transaction-payment",
- "pallet-test-utils",
  "pallet-timestamp",
  "pallet-transaction-payment",
  "pallet-transaction-payment-rpc-runtime-api",
@@ -12879,7 +12878,6 @@
  "pallet-structure",
  "pallet-sudo",
  "pallet-template-transaction-payment",
- "pallet-test-utils",
  "pallet-timestamp",
  "pallet-transaction-payment",
  "pallet-transaction-payment-rpc-runtime-api",
modifiednode/cli/Cargo.tomldiffbeforeafterboth
--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -335,8 +335,3 @@
     'quartz-runtime?/try-runtime',
     'opal-runtime?/try-runtime',
 ]
-
-test-pallets = [
-    'unique-runtime?/test-pallets',
-    'quartz-runtime?/test-pallets',
-]
modifiedruntime/common/config/mod.rsdiffbeforeafterboth
--- a/runtime/common/config/mod.rs
+++ b/runtime/common/config/mod.rs
@@ -22,5 +22,5 @@
 pub mod substrate;
 pub mod xcm;
 
-#[cfg(feature = "test-pallets")]
+#[cfg(feature = "pallet-test-utils")]
 pub mod test_pallets;
modifiedruntime/common/construct_runtime/mod.rsdiffbeforeafterboth
--- a/runtime/common/construct_runtime/mod.rs
+++ b/runtime/common/construct_runtime/mod.rs
@@ -94,10 +94,8 @@
                 EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
                 EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
 
-                #[test_pallets]
-                {
-                    TestUtils: pallet_test_utils,
-                }
+                #[runtimes(opal)]
+                TestUtils: pallet_test_utils = 255,
             }
         }
     }
modifiedruntime/common/construct_runtime/util.rsdiffbeforeafterboth
after · runtime/common/construct_runtime/util.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#[macro_export]18macro_rules! construct_runtime_impl {19    (20        select_runtime($select_runtime:ident);2122        pub enum Runtime where23            $($where_ident:ident = $where_ty:ty),* $(,)?24        {25            $(26                $(#[runtimes($($pallet_runtimes:ident),+ $(,)?)])?27                $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal28            ),*29            $(,)?30        }31    ) => {32        $crate::construct_runtime_helper! {33            select_runtime($select_runtime),34            selected_pallets(),3536            where_clause($($where_ident = $where_ty),*),37            pallets(38                $(39                    $(#[runtimes($($pallet_runtimes),+)])?40                    $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index41                ),*,42            )43        }44    }45}4647#[macro_export]48macro_rules! construct_runtime_helper {49    (50        select_runtime($select_runtime:ident),51        selected_pallets($($selected_pallets:tt)*),5253        where_clause($($where_clause:tt)*),54        pallets(55            #[runtimes($($pallet_runtimes:ident),+)]56            $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal,5758            $($pallets_tl:tt)*59        )60    ) => {61        $crate::add_runtime_specific_pallets! {62            select_runtime($select_runtime),63            runtimes($($pallet_runtimes),+,),64            selected_pallets($($selected_pallets)*),6566            where_clause($($where_clause)*),67            pallets(68                $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,69                $($pallets_tl)*70            )71        }72    };7374    (75        select_runtime($select_runtime:ident),76        selected_pallets($($selected_pallets:tt)*),7778        where_clause($($where_clause:tt)*),79        pallets(80            $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal,8182            $($pallets_tl:tt)*83        )84    ) => {85        $crate::construct_runtime_helper! {86            select_runtime($select_runtime),87            selected_pallets(88                $($selected_pallets)*89                $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,90            ),9192            where_clause($($where_clause)*),93            pallets($($pallets_tl)*)94        }95    };9697    (98        select_runtime($select_runtime:ident),99        selected_pallets($($selected_pallets:tt)*),100101        where_clause($($where_clause:tt)*),102        pallets()103    ) => {104        frame_support::construct_runtime! {105            pub enum Runtime where106                $($where_clause)*107            {108                $($selected_pallets)*109            }110        }111    };112}113114#[macro_export]115macro_rules! add_runtime_specific_pallets {116    (117        select_runtime(opal),118        runtimes(opal, $($_runtime_tl:tt)*),119        selected_pallets($($selected_pallets:tt)*),120121        where_clause($($where_clause:tt)*),122        pallets(123            $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal,124            $($pallets_tl:tt)*125        )126    ) => {127        $crate::construct_runtime_helper! {128            select_runtime(opal),129            selected_pallets(130                $($selected_pallets)*131                $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,132            ),133134            where_clause($($where_clause)*),135            pallets($($pallets_tl)*)136        }137    };138139    (140        select_runtime(quartz),141        runtimes(quartz, $($_runtime_tl:tt)*),142        selected_pallets($($selected_pallets:tt)*),143144        where_clause($($where_clause:tt)*),145        pallets(146            $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal,147            $($pallets_tl:tt)*148        )149    ) => {150        $crate::construct_runtime_helper! {151            select_runtime(quartz),152            selected_pallets(153                $($selected_pallets)*154                $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,155            ),156157            where_clause($($where_clause)*),158            pallets($($pallets_tl)*)159        }160    };161162    (163        select_runtime(unique),164        runtimes(unique, $($_runtime_tl:tt)*),165        selected_pallets($($selected_pallets:tt)*),166167        where_clause($($where_clause:tt)*),168        pallets(169            $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal,170            $($pallets_tl:tt)*171        )172    ) => {173        $crate::construct_runtime_helper! {174            select_runtime(unique),175            selected_pallets(176                $($selected_pallets)*177                $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,178            ),179180            where_clause($($where_clause)*),181            pallets($($pallets_tl)*)182        }183    };184185    (186        select_runtime($select_runtime:ident),187        runtimes($_current_runtime:ident, $($runtime_tl:tt)*),188        selected_pallets($($selected_pallets:tt)*),189190        where_clause($($where_clause:tt)*),191        pallets($($pallets:tt)*)192    ) => {193        $crate::add_runtime_specific_pallets! {194            select_runtime($select_runtime),195            runtimes($($runtime_tl)*),196            selected_pallets($($selected_pallets)*),197198            where_clause($($where_clause)*),199            pallets($($pallets)*)200        }201    };202203    (204        select_runtime($select_runtime:ident),205        runtimes(),206        selected_pallets($($selected_pallets:tt)*),207208        where_clause($($where_clause:tt)*),209        pallets(210            $_pallet_name:ident: $_pallet_mod:ident$(::{$($_pallet_parts:ty),*})? = $_index:literal,211            $($pallets_tl:tt)*212        )213    ) => {214        $crate::construct_runtime_helper! {215            select_runtime($select_runtime),216            selected_pallets($($selected_pallets)*),217218            where_clause($($where_clause)*),219            pallets($($pallets_tl)*)220        }221    };222}
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -170,9 +170,8 @@
 
     'pallet-test-utils?/std',
 ]
-test-pallets = ['pallet-test-utils']
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-opal-runtime = ['refungible', 'rmrk', 'app-promotion', 'foreign-assets']
+opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion', 'foreign-assets', 'pallet-test-utils']
 
 refungible = []
 scheduler = []
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -165,10 +165,7 @@
     "orml-xtokens/std",
     "orml-traits/std",
     "pallet-foreign-assets/std",
-
-    'pallet-test-utils?/std',
 ]
-test-pallets = ['pallet-test-utils']
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
 quartz-runtime = ['refungible']
 
@@ -490,11 +487,6 @@
 evm-coder = { default-features = false, path = '../../crates/evm-coder' }
 up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.30' }
 pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
-
-################################################################################
-# Test dependencies
-
-pallet-test-utils = { optional = true, default-features = false, path = "../../test-pallets/utils" }
 
 ################################################################################
 # Other Dependencies
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -166,10 +166,7 @@
     "orml-xtokens/std",
     "orml-traits/std",
     "pallet-foreign-assets/std",
-
-    'pallet-test-utils?/std',
 ]
-test-pallets = ['pallet-test-utils']
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
 unique-runtime = []
 
@@ -484,11 +481,6 @@
 evm-coder = { default-features = false, path = '../../crates/evm-coder' }
 up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.30' }
 pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
-
-################################################################################
-# Test dependencies
-
-pallet-test-utils = { optional = true, default-features = false, path = "../../test-pallets/utils" }
 
 ################################################################################
 # Other Dependencies