1use crate::keyring::*;
22use kitchensink_runtime::{
23 constants::currency::*, AccountId, AssetsConfig, BalancesConfig, IndicesConfig,
24 RuntimeGenesisConfig, SessionConfig, SocietyConfig, StakerStatus, StakingConfig,
25};
26use sp_keyring::Ed25519Keyring;
27use sp_runtime::Perbill;
28
29pub fn config() -> RuntimeGenesisConfig {
31 config_endowed(Default::default())
32}
33
34pub fn config_endowed(extra_endowed: Vec<AccountId>) -> RuntimeGenesisConfig {
37 let mut endowed = vec![
38 (alice(), 111 * DOLLARS),
39 (bob(), 100 * DOLLARS),
40 (charlie(), 100_000_000 * DOLLARS),
41 (dave(), 112 * DOLLARS),
42 (eve(), 101 * DOLLARS),
43 (ferdie(), 101 * DOLLARS),
44 ];
45
46 endowed.extend(extra_endowed.into_iter().map(|endowed| (endowed, 100 * DOLLARS)));
47
48 RuntimeGenesisConfig {
49 indices: IndicesConfig { indices: vec![] },
50 balances: BalancesConfig { balances: endowed, ..Default::default() },
51 session: SessionConfig {
52 keys: vec![
53 (alice(), dave(), session_keys_from_seed(Ed25519Keyring::Alice.into())),
54 (bob(), eve(), session_keys_from_seed(Ed25519Keyring::Bob.into())),
55 (charlie(), ferdie(), session_keys_from_seed(Ed25519Keyring::Charlie.into())),
56 ],
57 ..Default::default()
58 },
59 staking: StakingConfig {
60 stakers: vec![
61 (dave(), dave(), 111 * DOLLARS, StakerStatus::Validator),
62 (eve(), eve(), 100 * DOLLARS, StakerStatus::Validator),
63 (ferdie(), ferdie(), 100 * DOLLARS, StakerStatus::Validator),
64 ],
65 validator_count: 3,
66 minimum_validator_count: 0,
67 slash_reward_fraction: Perbill::from_percent(10),
68 invulnerables: vec![alice(), bob(), charlie()],
69 ..Default::default()
70 },
71 society: SocietyConfig { pot: 0 },
72 assets: AssetsConfig { assets: vec![(9, alice(), true, 1)], ..Default::default() },
73 ..Default::default()
74 }
75}