123use crate::{Module, Trait};4use frame_support::{impl_outer_origin, parameter_types, weights::Weight};5use frame_system as system;6use sp_core::H256;7use sp_runtime::{8 testing::Header,9 traits::{BlakeTwo256, IdentityLookup},10 Perbill,11};1213impl_outer_origin! {14 pub enum Origin for Test {}15}1617181920#[derive(Clone, Eq, PartialEq)]21pub struct Test;22parameter_types! {23 pub const BlockHashCount: u64 = 250;24 pub const MaximumBlockWeight: Weight = 1024;25 pub const MaximumBlockLength: u32 = 2 * 1024;26 pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);27}28impl system::Trait for Test {29 type Origin = Origin;30 type Call = ();31 type Index = u64;32 type BlockNumber = u64;33 type Hash = H256;34 type Hashing = BlakeTwo256;35 type AccountId = u64;36 type Lookup = IdentityLookup<Self::AccountId>;37 type Header = Header;38 type Event = ();39 type BlockHashCount = BlockHashCount;40 type MaximumBlockWeight = MaximumBlockWeight;41 type MaximumBlockLength = MaximumBlockLength;42 type AvailableBlockRatio = AvailableBlockRatio;43 type Version = ();44 type ModuleToIndex = ();45 type AccountData = ();46 type OnNewAccount = ();47 type OnKilledAccount = ();48}49impl Trait for Test {50 type Event = ();51}52pub type TemplateModule = Module<Test>;53545556pub fn new_test_ext() -> sp_io::TestExternalities {57 system::GenesisConfig::default()58 .build_storage::<Test>()59 .unwrap()60 .into()61}