Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 4ddf971

Browse files
committed
add tests
1 parent 0f41979 commit 4ddf971

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

frame/support/procedural/src/construct_runtime/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn construct_runtime_preprocess(
5353
auto_modules.push(module.clone())
5454
}
5555
}
56-
56+
5757
if !auto_modules.is_empty() {
5858

5959
// Make frame-support available to construct_runtime_args

frame/support/test/tests/instance.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
use sp_runtime::{generic, BuildStorage, traits::{BlakeTwo256, Verify}};
2121
use frame_support::{
22-
Parameter, traits::Get, parameter_types,
22+
Parameter, traits::Get, parameter_types, decl_construct_runtime_args,
2323
metadata::{
2424
DecodeDifferent, StorageMetadata, StorageEntryModifier, StorageEntryType, DefaultByteGetter,
2525
StorageEntryMetadata, StorageHasher,
@@ -118,6 +118,8 @@ mod module1 {
118118
mod module2 {
119119
use super::*;
120120

121+
decl_construct_runtime_args!(Module, Call, Storage, Config<T>, Event<T>, Origin<T>, Inherent);
122+
121123
pub trait Trait<I=DefaultInstance>: system::Trait {
122124
type Amount: Parameter + Default;
123125
type Event: From<Event<Self, I>> + Into<<Self as system::Trait>::Event>;
@@ -243,7 +245,7 @@ impl system::Trait for Runtime {
243245
type Call = Call;
244246
}
245247

246-
frame_support::construct_runtime!(
248+
frame_support::construct_runtime!(#[local_macro(module2)]
247249
pub enum Runtime where
248250
Block = Block,
249251
NodeBlock = Block,
@@ -256,16 +258,10 @@ frame_support::construct_runtime!(
256258
Module1_2: module1::<Instance2>::{
257259
Module, Call, Storage, Event<T>, Config<T>, Origin<T>, Inherent
258260
},
259-
Module2: module2::{Module, Call, Storage, Event<T>, Config<T>, Origin<T>, Inherent},
260-
Module2_1: module2::<Instance1>::{
261-
Module, Call, Storage, Event<T>, Config<T>, Origin<T>, Inherent
262-
},
263-
Module2_2: module2::<Instance2>::{
264-
Module, Call, Storage, Event<T>, Config<T>, Origin<T>, Inherent
265-
},
266-
Module2_3: module2::<Instance3>::{
267-
Module, Call, Storage, Event<T>, Config<T>, Origin<T>, Inherent
268-
},
261+
Module2: module2,
262+
Module2_1: module2::<Instance1>,
263+
Module2_2: module2::<Instance2>,
264+
Module2_3: module2::<Instance3>,
269265
Module3: module3::{Module, Call},
270266
}
271267
);

0 commit comments

Comments
 (0)