-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmock.rs
68 lines (63 loc) · 1.77 KB
/
mock.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
use frame_support::traits::ConstU32;
use frame_support::{
construct_runtime,
traits::{ConstU16, ConstU64},
};
use hex_literal::hex;
use sidechain_domain::*;
use sp_core::H256;
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
AccountId32, BuildStorage,
};
pub type Block = frame_system::mocking::MockBlock<Test>;
pub type AccountId = AccountId32;
pub type PartnerChainAddress = AccountId32;
construct_runtime! {
pub enum Test {
System: frame_system,
AddressAssociations: crate::pallet
}
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type Hash = H256;
type Hashing = BlakeTwo256;
type AccountId = AccountId;
type Lookup = IdentityLookup<Self::AccountId>;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = ConstU64<250>;
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type ExtensionsWeightInfo = ();
type SS58Prefix = ConstU16<42>;
type OnSetCode = ();
type MaxConsumers = ConstU32<16>;
type Block = Block;
type Nonce = u64;
type RuntimeTask = RuntimeTask;
type SingleBlockMigrations = ();
type MultiBlockMigrator = ();
type PreInherents = ();
type PostInherents = ();
type PostTransactions = ();
}
impl crate::pallet::Config for Test {
type WeightInfo = ();
type PartnerChainAddress = PartnerChainAddress;
fn genesis_utxo() -> UtxoId {
UtxoId::new(hex!("59104061ffa0d66f9ba0135d6fc6a884a395b10f8ae9cb276fc2c3bfdfedc260"), 1)
}
}
pub fn new_test_ext() -> sp_io::TestExternalities {
frame_system::GenesisConfig::<Test>::default().build_storage().unwrap().into()
}