frame_support_test_stg_frame_crate/
lib.rs1use frame::deps::{frame_support, frame_system};
22
23#[frame_support::pallet]
24pub mod pallet {
25 use super::*;
26 use frame_support::pallet_prelude::*;
27
28 #[pallet::pallet]
29 pub struct Pallet<T>(_);
30
31 #[pallet::config]
32 pub trait Config: frame_system::Config {}
37
38 #[pallet::genesis_config]
39 #[derive(frame_support::DefaultNoBound)]
40 pub struct GenesisConfig<T: Config> {
41 #[serde(skip)]
42 _config: core::marker::PhantomData<T>,
43 }
44
45 #[pallet::genesis_build]
46 impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
47 fn build(&self) {}
48 }
49}
50
51#[cfg(test)]
52mod tests {
54 use super::{
55 frame_support::{construct_runtime, derive_impl},
56 frame_system, pallet,
57 };
58
59 type Block = frame_system::mocking::MockBlock<Runtime>;
60
61 impl crate::pallet::Config for Runtime {}
62
63 #[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
64 impl frame_system::Config for Runtime {
65 type Block = Block;
66 }
67
68 construct_runtime! {
69 pub struct Runtime
70 {
71 System: frame_system,
72 Pallet: pallet,
73 }
74 }
75}