difftreelog
feat add test pallets mechanism
in: master
14 files changed
Cargo.lockdiffbeforeafterboth5345 "pallet-structure",5345 "pallet-structure",5346 "pallet-sudo",5346 "pallet-sudo",5347 "pallet-template-transaction-payment",5347 "pallet-template-transaction-payment",5348 "pallet-test-utils",5348 "pallet-timestamp",5349 "pallet-timestamp",5349 "pallet-transaction-payment",5350 "pallet-transaction-payment",5350 "pallet-transaction-payment-rpc-runtime-api",5351 "pallet-transaction-payment-rpc-runtime-api",6668 "up-sponsorship",6669 "up-sponsorship",6669]6670]66716672[[package]]6673name = "pallet-test-utils"6674version = "0.1.0"6675dependencies = [6676 "frame-support",6677 "frame-system",6678 "parity-scale-codec 3.1.5",6679 "scale-info",6680]667066816671[[package]]6682[[package]]6672name = "pallet-timestamp"6683name = "pallet-timestamp"8793 "pallet-structure",8804 "pallet-structure",8794 "pallet-sudo",8805 "pallet-sudo",8795 "pallet-template-transaction-payment",8806 "pallet-template-transaction-payment",8807 "pallet-test-utils",8796 "pallet-timestamp",8808 "pallet-timestamp",8797 "pallet-transaction-payment",8809 "pallet-transaction-payment",8798 "pallet-transaction-payment-rpc-runtime-api",8810 "pallet-transaction-payment-rpc-runtime-api",12866 "pallet-structure",12878 "pallet-structure",12867 "pallet-sudo",12879 "pallet-sudo",12868 "pallet-template-transaction-payment",12880 "pallet-template-transaction-payment",12881 "pallet-test-utils",12869 "pallet-timestamp",12882 "pallet-timestamp",12870 "pallet-transaction-payment",12883 "pallet-transaction-payment",12871 "pallet-transaction-payment-rpc-runtime-api",12884 "pallet-transaction-payment-rpc-runtime-api",Cargo.tomldiffbeforeafterbothno syntactic changes
node/cli/Cargo.tomldiffbeforeafterboth336 'opal-runtime?/try-runtime',336 'opal-runtime?/try-runtime',337]337]338339test-pallets = [340 'unique-runtime?/test-pallets',341 'quartz-runtime?/test-pallets',342]338343runtime/common/config/mod.rsdiffbeforeafterboth22pub mod substrate;22pub mod substrate;23pub mod xcm;23pub mod xcm;2425#[cfg(feature = "test-pallets")]26pub mod test_pallets;2427runtime/common/config/test_pallets.rsdiffbeforeafterbothno changes
runtime/common/construct_runtime/mod.rsdiffbeforeafterboth94 EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,94 EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,95 EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,95 EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,9697 #[test_pallets]98 {99 TestUtils: pallet_test_utils,100 }96 }101 }97 }102 }98 }103 }runtime/common/construct_runtime/util.rsdiffbeforeafterboth28 ),*28 ),*29 $(,)?29 $(,)?3031 #[test_pallets]32 {33 $(34 $test_pallet_name:ident: $test_pallet_mod:ident35 ),*36 $(,)?37 }30 }38 }31 ) => {39 ) => {32 $crate::construct_runtime_helper! {40 $crate::construct_runtime_helper! {33 select_runtime($select_runtime),41 select_runtime($select_runtime),34 selected_pallets(),42 selected_pallets(),43 test_pallets(44 $(45 $test_pallet_name: $test_pallet_mod46 ),*47 ),354836 where_clause($($where_ident = $where_ty),*),49 where_clause($($where_ident = $where_ty),*),37 pallets(50 pallets(49 (62 (50 select_runtime($select_runtime:ident),63 select_runtime($select_runtime:ident),51 selected_pallets($($selected_pallets:tt)*),64 selected_pallets($($selected_pallets:tt)*),65 test_pallets($($test_pallets:tt)*),526653 where_clause($($where_clause:tt)*),67 where_clause($($where_clause:tt)*),54 pallets(68 pallets(62 select_runtime($select_runtime),76 select_runtime($select_runtime),63 runtimes($($pallet_runtimes),+,),77 runtimes($($pallet_runtimes),+,),64 selected_pallets($($selected_pallets)*),78 selected_pallets($($selected_pallets)*),79 test_pallets($($test_pallets)*),658066 where_clause($($where_clause)*),81 where_clause($($where_clause)*),67 pallets(82 pallets(74 (89 (75 select_runtime($select_runtime:ident),90 select_runtime($select_runtime:ident),76 selected_pallets($($selected_pallets:tt)*),91 selected_pallets($($selected_pallets:tt)*),92 test_pallets($($test_pallets:tt)*),779378 where_clause($($where_clause:tt)*),94 where_clause($($where_clause:tt)*),79 pallets(95 pallets(88 $($selected_pallets)*104 $($selected_pallets)*89 $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,105 $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,90 ),106 ),107 test_pallets($($test_pallets)*),9110892 where_clause($($where_clause)*),109 where_clause($($where_clause)*),93 pallets($($pallets_tl)*)110 pallets($($pallets_tl)*)97 (114 (98 select_runtime($select_runtime:ident),115 select_runtime($select_runtime:ident),99 selected_pallets($($selected_pallets:tt)*),116 selected_pallets($($selected_pallets:tt)*),117 test_pallets($($test_pallets:tt)*),100118101 where_clause($($where_clause:tt)*),119 where_clause($($where_clause:tt)*),102 pallets()120 pallets()103 ) => {121 ) => {122 #[cfg(not(feature = "test-pallets"))]104 frame_support::construct_runtime! {123 frame_support::construct_runtime! {105 pub enum Runtime where124 pub enum Runtime where106 $($where_clause)*125 $($where_clause)*109 }128 }110 }129 }130131 #[cfg(feature = "test-pallets")]132 frame_support::construct_runtime! {133 pub enum Runtime where134 $($where_clause)*135 {136 $($selected_pallets)*137 $($test_pallets)*138 }139 }111 };140 };112}141}113142117 select_runtime(opal),146 select_runtime(opal),118 runtimes(opal, $($_runtime_tl:tt)*),147 runtimes(opal, $($_runtime_tl:tt)*),119 selected_pallets($($selected_pallets:tt)*),148 selected_pallets($($selected_pallets:tt)*),149 test_pallets($($test_pallets:tt)*),120150121 where_clause($($where_clause:tt)*),151 where_clause($($where_clause:tt)*),122 pallets(152 pallets(130 $($selected_pallets)*160 $($selected_pallets)*131 $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,161 $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,132 ),162 ),163 test_pallets($($test_pallets)*),133164134 where_clause($($where_clause)*),165 where_clause($($where_clause)*),135 pallets($($pallets_tl)*)166 pallets($($pallets_tl)*)140 select_runtime(quartz),171 select_runtime(quartz),141 runtimes(quartz, $($_runtime_tl:tt)*),172 runtimes(quartz, $($_runtime_tl:tt)*),142 selected_pallets($($selected_pallets:tt)*),173 selected_pallets($($selected_pallets:tt)*),174 test_pallets($($test_pallets:tt)*),143175144 where_clause($($where_clause:tt)*),176 where_clause($($where_clause:tt)*),145 pallets(177 pallets(153 $($selected_pallets)*185 $($selected_pallets)*154 $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,186 $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,155 ),187 ),188 test_pallets($($test_pallets)*),156189157 where_clause($($where_clause)*),190 where_clause($($where_clause)*),158 pallets($($pallets_tl)*)191 pallets($($pallets_tl)*)163 select_runtime(unique),196 select_runtime(unique),164 runtimes(unique, $($_runtime_tl:tt)*),197 runtimes(unique, $($_runtime_tl:tt)*),165 selected_pallets($($selected_pallets:tt)*),198 selected_pallets($($selected_pallets:tt)*),199 test_pallets($($test_pallets:tt)*),166200167 where_clause($($where_clause:tt)*),201 where_clause($($where_clause:tt)*),168 pallets(202 pallets(176 $($selected_pallets)*210 $($selected_pallets)*177 $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,211 $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index,178 ),212 ),213 test_pallets($($test_pallets)*),179214180 where_clause($($where_clause)*),215 where_clause($($where_clause)*),181 pallets($($pallets_tl)*)216 pallets($($pallets_tl)*)186 select_runtime($select_runtime:ident),221 select_runtime($select_runtime:ident),187 runtimes($_current_runtime:ident, $($runtime_tl:tt)*),222 runtimes($_current_runtime:ident, $($runtime_tl:tt)*),188 selected_pallets($($selected_pallets:tt)*),223 selected_pallets($($selected_pallets:tt)*),224 test_pallets($($test_pallets:tt)*),189225190 where_clause($($where_clause:tt)*),226 where_clause($($where_clause:tt)*),191 pallets($($pallets:tt)*)227 pallets($($pallets:tt)*)194 select_runtime($select_runtime),230 select_runtime($select_runtime),195 runtimes($($runtime_tl)*),231 runtimes($($runtime_tl)*),196 selected_pallets($($selected_pallets)*),232 selected_pallets($($selected_pallets)*),233 test_pallets($($test_pallets)*),197234198 where_clause($($where_clause)*),235 where_clause($($where_clause)*),199 pallets($($pallets)*)236 pallets($($pallets)*)204 select_runtime($select_runtime:ident),241 select_runtime($select_runtime:ident),205 runtimes(),242 runtimes(),206 selected_pallets($($selected_pallets:tt)*),243 selected_pallets($($selected_pallets:tt)*),244 test_pallets($($test_pallets:tt)*),207245208 where_clause($($where_clause:tt)*),246 where_clause($($where_clause:tt)*),209 pallets(247 pallets(214 $crate::construct_runtime_helper! {252 $crate::construct_runtime_helper! {215 select_runtime($select_runtime),253 select_runtime($select_runtime),216 selected_pallets($($selected_pallets)*),254 selected_pallets($($selected_pallets)*),255 test_pallets($($test_pallets)*),217256218 where_clause($($where_clause)*),257 where_clause($($where_clause)*),219 pallets($($pallets_tl)*)258 pallets($($pallets_tl)*)runtime/opal/Cargo.tomldiffbeforeafterboth168 "orml-traits/std",168 "orml-traits/std",169 "pallet-foreign-assets/std",169 "pallet-foreign-assets/std",170171 'pallet-test-utils?/std',170]172]173test-pallets = ['pallet-test-utils']171limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']174limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']172opal-runtime = ['refungible', 'rmrk', 'app-promotion', 'foreign-assets']175opal-runtime = ['refungible', 'rmrk', 'app-promotion', 'foreign-assets']173176494[dev-dependencies.logtest]497[dev-dependencies.logtest]495version = "2.0.0"498version = "2.0.0"499500################################################################################501# Test dependencies502pallet-test-utils = { optional = true, default-features = false, path = "../../test-pallets/utils" }503496504497################################################################################505################################################################################runtime/quartz/Cargo.tomldiffbeforeafterboth166 "orml-traits/std",166 "orml-traits/std",167 "pallet-foreign-assets/std",167 "pallet-foreign-assets/std",168169 'pallet-test-utils?/std',168]170]171test-pallets = ['pallet-test-utils']169limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']172limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']170quartz-runtime = ['refungible']173quartz-runtime = ['refungible']171174499[dev-dependencies.logtest]502[dev-dependencies.logtest]500version = "2.0.0"503version = "2.0.0"504505################################################################################506# Test dependencies507pallet-test-utils = { optional = true, default-features = false, path = "../../test-pallets/utils" }501508502################################################################################509################################################################################503# Build Dependencies510# Build Dependenciesruntime/unique/Cargo.tomldiffbeforeafterboth167 "orml-traits/std",167 "orml-traits/std",168 "pallet-foreign-assets/std",168 "pallet-foreign-assets/std",169170 'pallet-test-utils?/std',169]171]172test-pallets = ['pallet-test-utils']170limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']173limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']171unique-runtime = []174unique-runtime = []172175493[dev-dependencies.logtest]496[dev-dependencies.logtest]494version = "2.0.0"497version = "2.0.0"498499################################################################################500# Test dependencies501pallet-test-utils = { optional = true, default-features = false, path = "../../test-pallets/utils" }495502496################################################################################503################################################################################497# Build Dependencies504# Build Dependenciestest-pallets/utils/Cargo.lockdiffbeforeafterbothno changes
test-pallets/utils/Cargo.tomldiffbeforeafterbothno changes
test-pallets/utils/src/lib.rsdiffbeforeafterbothno changes
tests/src/pallet-presence.test.tsdiffbeforeafterboth49 'xtokens',49 'xtokens',50];50];5152const testPallets = [53 'testutils',54];515552// Pallets that depend on consensus and governance configuration56// Pallets that depend on consensus and governance configuration53const consensusPallets = [57const consensusPallets = [87 expect(helper.fetchAllPalletNames()).to.contain.members([...requiredPallets]);91 expect(helper.fetchAllPalletNames()).to.contain.members([...requiredPallets]);88 });92 });9394 itSub('Test pallets are present', async ({helper}) => {95 expect(helper.fetchAllPalletNames()).to.contain.members([...testPallets]);96 });899790 itSub('Governance and consensus pallets are present', async ({helper}) => {98 itSub('Governance and consensus pallets are present', async ({helper}) => {91 expect(helper.fetchAllPalletNames()).to.contain.members([...consensusPallets]);99 expect(helper.fetchAllPalletNames()).to.contain.members([...consensusPallets]);