fn testnet_genesis(
	wasm_binary: &[u8],
	initial_authorities: Vec<(AccountId, AuraId, GrandpaId)>,
	root_key: AccountId,
	endowed_accounts: Vec<AccountId>,
	_enable_println: bool,
) -> GenesisConfig {
	GenesisConfig {
		system: SystemConfig {
			// Add Wasm runtime to storage.
			code: wasm_binary.to_vec(),
			changes_trie_config: Default::default(),
		},
		balances: BalancesConfig {
			// Configure endowed accounts with initial balance of 1 << 60.
			balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(),
		},
		session: SessionConfig {
			keys: initial_authorities
				.iter()
				.map(|x| (x.0.clone(), x.0.clone(), session_keys(x.1.clone(), x.2.clone())))
				.collect::<Vec<_>>(),
		},
		validator_set: ValidatorSetConfig {
			validators: initial_authorities.iter().map(|x| x.0.clone()).collect::<Vec<_>>(),
		},
		aura: AuraConfig { authorities: vec![] },
		grandpa: GrandpaConfig { authorities: vec![] },
		sudo: SudoConfig {
			// Assign network admin rights.
			key: root_key,
		},
		council: CouncilConfig {
			members: initial_authorities.iter().map(|x| x.0.clone()).collect::<Vec<_>>(),
			phantom: Default::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, AuraId, GrandpaId)>,
	root_key: AccountId,
	endowed_accounts: Vec<AccountId>,
	_enable_println: bool,
) -> GenesisConfig {
	GenesisConfig {
		system: SystemConfig {
			// Add Wasm runtime to storage.
			code: wasm_binary.to_vec(),
			changes_trie_config: Default::default(),
		},
		balances: BalancesConfig {
			// Configure endowed accounts with initial balance of 1 << 60.
			balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(),
		},
		session: SessionConfig {
			keys: initial_authorities
				.iter()
				.map(|x| (x.0.clone(), x.0.clone(), session_keys(x.1.clone(), x.2.clone())))
				.collect::<Vec<_>>(),
		},
		validator_set: ValidatorSetConfig {
			validators: initial_authorities.iter().map(|x| x.0.clone()).collect::<Vec<_>>(),
		},
		aura: AuraConfig { authorities: vec![] },
		grandpa: GrandpaConfig { authorities: vec![] },
		sudo: SudoConfig {
			// Assign network admin rights.
			key: root_key,
		},
		council: CouncilConfig {
			members: initial_authorities.iter().map(|x| x.0.clone()).collect::<Vec<_>>(),
			phantom: Default::default(),
		},
	}
}
fn testnet_genesis ( wasm_binary : & [ u8 ] , initial_authorities : Vec < ( AccountId , AuraId , GrandpaId ) > , root_key : AccountId , endowed_accounts : Vec < AccountId > , _enable_println : bool , ) -> GenesisConfig { GenesisConfig { system : SystemConfig { // Add Wasm runtime to storage. code : wasm_binary . to_vec ( ) , changes_trie_config : Default :: default ( ) , } , balances : BalancesConfig { // Configure endowed accounts with initial balance of 1 << 60. balances : endowed_accounts . iter ( ) . cloned ( ) . map ( | k | ( k , 1 << 60 ) ) . collect ( ) , } , session : SessionConfig { keys : initial_authorities . iter ( ) . map ( | x | ( x . 0 . clone ( ) , x . 0 . clone ( ) , session_keys ( x . 1 . clone ( ) , x . 2 . clone ( ) ) ) ) . collect :: < Vec < _ > > ( ) , } , validator_set : ValidatorSetConfig { validators : initial_authorities . iter ( ) . map ( | x | x . 0 . clone ( ) ) . collect :: < Vec < _ > > ( ) , } , aura : AuraConfig { authorities : vec ! [ ] } , grandpa : GrandpaConfig { authorities : vec ! [ ] } , sudo : SudoConfig { // Assign network admin rights. key : root_key , } , council : CouncilConfig { members : initial_authorities . iter ( ) . map ( | x | x . 0 . clone ( ) ) . collect :: < Vec < _ > > ( ) , phantom : Default :: default ( ) , } , } }
Configure initial storage state for FRAME modules.
Configure initial storage state for FRAME modules .
wasm_binary
&[u8]
initial_authorities
Vec<(AccountId, AuraId, GrandpaId)>
root_key
AccountId
endowed_accounts
Vec<AccountId>
_enable_println
bool
wasm_binary
&[u8]
initial_authorities
Vec<(AccountId, AuraId, GrandpaId)>
root_key
AccountId
endowed_accounts
Vec<AccountId>
_enable_println
bool