fn testnet_genesis(
	wasm_binary: &[u8],
	initial_authorities: Vec<(
		AccountId,
		AccountId,
		GrandpaId,
		BabeId,
		ImOnlineId,
		AuthorityDiscoveryId,
	)>,
	root_key: AccountId,
	endowed_accounts: Vec<AccountId>,
	_enable_println: bool,
) -> GenesisConfig {
	GenesisConfig {
		frame_system: Some(SystemConfig {
			// Add Wasm runtime to storage.
			code: wasm_binary.to_vec(),
			changes_trie_config: Default::default(),
		}),
		pallet_balances: Some(BalancesConfig {
			// Configure endowed accounts with initial balance of 1 << 60.
			balances: endowed_accounts.iter().cloned().map(|k|(k, 1 << 60)).collect(),
		}),
		pallet_grandpa: Some(GrandpaConfig {
			authorities: vec![] 
		}),
		pallet_sudo: Some(SudoConfig {
			// Assign network admin rights.
			key: root_key,
		}),
		pallet_standard_token: Some(TokenConfig{
			preregistered: [1u128, 1_000_000_000_000_000_000_000_000u128].to_vec()  // [(asset id 0 with native token that ignores balance), (asset id 1 with MTR total supply)]
		}),
		pallet_standard_oracle: Some(OracleConfig{
			oracles: [get_account_id_from_seed::<sr25519::Public>("Alice")].to_vec()
		}),
		// Staking related configs
		pallet_babe: Some(BabeConfig { authorities: vec![] }),
		pallet_authority_discovery: Some(AuthorityDiscoveryConfig { keys: vec![] }),
		pallet_im_online: Some(ImOnlineConfig { keys: vec![] }),
		pallet_treasury: Some(Default::default()),
		pallet_session: Some(SessionConfig {
			keys: initial_authorities
				.iter()
				.map(|x| {
					(
						x.0.clone(),
						x.0.clone(),
						session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone()),
					)
				})
				.collect::<Vec<_>>(),
		}),
		pallet_staking: Some(StakingConfig {
			validator_count: initial_authorities.len() as u32 * 2,
			minimum_validator_count: initial_authorities.len() as u32,
			stakers: initial_authorities
				.iter()
				.map(|x| (x.0.clone(), x.1.clone(), STASH, StakerStatus::Validator))
				.collect(),
			invulnerables: initial_authorities.iter().map(|x| x.0.clone()).collect(),
			slash_reward_fraction: Perbill::from_percent(10),
			..Default::default()
		}),
		pallet_elections_phragmen: Some(ElectionsConfig { members: vec![] }),
		pallet_collective_Instance1: Some(CouncilConfig::default()),
	}
}
/// Configure initial storage state for FRAME modules.
Configure initial storage state for FRAME modules.
Configure initial storage state for FRAME modules .
fn testnet_genesis(
	wasm_binary: &[u8],
	initial_authorities: Vec<(
		AccountId,
		AccountId,
		GrandpaId,
		BabeId,
		ImOnlineId,
		AuthorityDiscoveryId,
	)>,
	root_key: AccountId,
	endowed_accounts: Vec<AccountId>,
	_enable_println: bool,
) -> GenesisConfig {
	GenesisConfig {
		frame_system: Some(SystemConfig {
			// Add Wasm runtime to storage.
			code: wasm_binary.to_vec(),
			changes_trie_config: Default::default(),
		}),
		pallet_balances: Some(BalancesConfig {
			// Configure endowed accounts with initial balance of 1 << 60.
			balances: endowed_accounts.iter().cloned().map(|k|(k, 1 << 60)).collect(),
		}),
		pallet_grandpa: Some(GrandpaConfig {
			authorities: vec![] 
		}),
		pallet_sudo: Some(SudoConfig {
			// Assign network admin rights.
			key: root_key,
		}),
		pallet_standard_token: Some(TokenConfig{
			preregistered: [1u128, 1_000_000_000_000_000_000_000_000u128].to_vec()  // [(asset id 0 with native token that ignores balance), (asset id 1 with MTR total supply)]
		}),
		pallet_standard_oracle: Some(OracleConfig{
			oracles: [get_account_id_from_seed::<sr25519::Public>("Alice")].to_vec()
		}),
		// Staking related configs
		pallet_babe: Some(BabeConfig { authorities: vec![] }),
		pallet_authority_discovery: Some(AuthorityDiscoveryConfig { keys: vec![] }),
		pallet_im_online: Some(ImOnlineConfig { keys: vec![] }),
		pallet_treasury: Some(Default::default()),
		pallet_session: Some(SessionConfig {
			keys: initial_authorities
				.iter()
				.map(|x| {
					(
						x.0.clone(),
						x.0.clone(),
						session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone()),
					)
				})
				.collect::<Vec<_>>(),
		}),
		pallet_staking: Some(StakingConfig {
			validator_count: initial_authorities.len() as u32 * 2,
			minimum_validator_count: initial_authorities.len() as u32,
			stakers: initial_authorities
				.iter()
				.map(|x| (x.0.clone(), x.1.clone(), STASH, StakerStatus::Validator))
				.collect(),
			invulnerables: initial_authorities.iter().map(|x| x.0.clone()).collect(),
			slash_reward_fraction: Perbill::from_percent(10),
			..Default::default()
		}),
		pallet_elections_phragmen: Some(ElectionsConfig { members: vec![] }),
		pallet_collective_Instance1: Some(CouncilConfig::default()),
	}
}
fn testnet_genesis ( wasm_binary : & [ u8 ] , initial_authorities : Vec < ( AccountId , AccountId , GrandpaId , BabeId , ImOnlineId , AuthorityDiscoveryId , ) > , root_key : AccountId , endowed_accounts : Vec < AccountId > , _enable_println : bool , ) -> GenesisConfig { GenesisConfig { frame_system : Some ( SystemConfig { // Add Wasm runtime to storage. code : wasm_binary . to_vec ( ) , changes_trie_config : Default :: default ( ) , } ) , pallet_balances : Some ( BalancesConfig { // Configure endowed accounts with initial balance of 1 << 60. balances : endowed_accounts . iter ( ) . cloned ( ) . map ( | k | ( k , 1 << 60 ) ) . collect ( ) , } ) , pallet_grandpa : Some ( GrandpaConfig { authorities : vec ! [ ] } ) , pallet_sudo : Some ( SudoConfig { // Assign network admin rights. key : root_key , } ) , pallet_standard_token : Some ( TokenConfig { preregistered : [ 1u128 , 1_000_000_000_000_000_000_000_000u128 ] . to_vec ( ) // [(asset id 0 with native token that ignores balance), (asset id 1 with MTR total supply)] } ) , pallet_standard_oracle : Some ( OracleConfig { oracles : [ get_account_id_from_seed :: < sr25519 :: Public > ( " " ) ] . to_vec ( ) } ) , // Staking related configs pallet_babe : Some ( BabeConfig { authorities : vec ! [ ] } ) , pallet_authority_discovery : Some ( AuthorityDiscoveryConfig { keys : vec ! [ ] } ) , pallet_im_online : Some ( ImOnlineConfig { keys : vec ! [ ] } ) , pallet_treasury : Some ( Default :: default ( ) ) , pallet_session : Some ( SessionConfig { keys : initial_authorities . iter ( ) . map ( | x | { ( x . 0 . clone ( ) , x . 0 . clone ( ) , session_keys ( x . 2 . clone ( ) , x . 3 . clone ( ) , x . 4 . clone ( ) , x . 5 . clone ( ) ) , ) } ) . collect :: < Vec < _ > > ( ) , } ) , pallet_staking : Some ( StakingConfig { validator_count : initial_authorities . len ( ) as u32 * 2 , minimum_validator_count : initial_authorities . len ( ) as u32 , stakers : initial_authorities . iter ( ) . map ( | x | ( x . 0 . clone ( ) , x . 1 . clone ( ) , STASH , StakerStatus :: Validator ) ) . collect ( ) , invulnerables : initial_authorities . iter ( ) . map ( | x | x . 0 . clone ( ) ) . collect ( ) , slash_reward_fraction : Perbill :: from_percent ( 10 ) , .. Default :: default ( ) } ) , pallet_elections_phragmen : Some ( ElectionsConfig { members : vec ! [ ] } ) , pallet_collective_Instance1 : Some ( CouncilConfig :: default ( ) ) , } }
Configure initial storage state for FRAME modules.
Configure initial storage state for FRAME modules .
wasm_binary
&[u8]
initial_authorities
Vec<(
		AccountId,
		AccountId,
		GrandpaId,
		BabeId,
		ImOnlineId,
		AuthorityDiscoveryId,
	)>
root_key
AccountId
endowed_accounts
Vec<AccountId>
_enable_println
bool
wasm_binary
&[u8]
initial_authorities
Vec<(
		AccountId,
		AccountId,
		GrandpaId,
		BabeId,
		ImOnlineId,
		AuthorityDiscoveryId,
	)>
root_key
AccountId
endowed_accounts
Vec<AccountId>
_enable_println
bool