fn testnet_genesis(
	wasm_binary: &[u8],
	initial_authorities: Vec<(AuraId, GrandpaId)>,
	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_aura: Some(AuraConfig {
			authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(),
		}),
		pallet_grandpa: Some(GrandpaConfig {
			authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(),
		}),
		pallet_sudo: Some(SudoConfig {
			// Assign network admin rights.
			key: root_key,
		}),
		orml_tokens: Some(TokensConfig {
			endowed_accounts: endowed_accounts
			.iter()
			.flat_map(|x| {
				vec![
					(x.clone(), CurrencyId::DOT, 10u128.pow(16)),
					(x.clone(), CurrencyId::BTC, 10u128.pow(16)),
					(x.clone(), CurrencyId::MAAR, 10u128.pow(16)),
				]
			})
			.collect(),
		}),
	}
}
/// 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<(AuraId, GrandpaId)>,
	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_aura: Some(AuraConfig {
			authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(),
		}),
		pallet_grandpa: Some(GrandpaConfig {
			authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(),
		}),
		pallet_sudo: Some(SudoConfig {
			// Assign network admin rights.
			key: root_key,
		}),
		orml_tokens: Some(TokensConfig {
			endowed_accounts: endowed_accounts
			.iter()
			.flat_map(|x| {
				vec![
					(x.clone(), CurrencyId::DOT, 10u128.pow(16)),
					(x.clone(), CurrencyId::BTC, 10u128.pow(16)),
					(x.clone(), CurrencyId::MAAR, 10u128.pow(16)),
				]
			})
			.collect(),
		}),
	}
}
fn testnet_genesis ( wasm_binary : & [ u8 ] , initial_authorities : Vec < ( AuraId , GrandpaId ) > , 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_aura : Some ( AuraConfig { authorities : initial_authorities . iter ( ) . map ( | x | ( x . 0 . clone ( ) ) ) . collect ( ) , } ) , pallet_grandpa : Some ( GrandpaConfig { authorities : initial_authorities . iter ( ) . map ( | x | ( x . 1 . clone ( ) , 1 ) ) . collect ( ) , } ) , pallet_sudo : Some ( SudoConfig { // Assign network admin rights. key : root_key , } ) , orml_tokens : Some ( TokensConfig { endowed_accounts : endowed_accounts . iter ( ) . flat_map ( | x | { vec ! [ ( x clone ( ) CurrencyId DOT 10u128 pow ( 16 ) ) ( x clone ( ) CurrencyId BTC 10u128 pow ( 16 ) ) ( x clone ( ) CurrencyId MAAR 10u128 pow ( 16 ) ) ] } ) . collect ( ) , } ) , } }
Configure initial storage state for FRAME modules.
Configure initial storage state for FRAME modules .
wasm_binary
&[u8]
initial_authorities
Vec<(AuraId, GrandpaId)>
root_key
AccountId
endowed_accounts
Vec<AccountId>
_enable_println
bool
wasm_binary
&[u8]
initial_authorities
Vec<(AuraId, GrandpaId)>
root_key
AccountId
endowed_accounts
Vec<AccountId>
_enable_println
bool