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