fn testnet_genesis(
    wasm_binary: &[u8],
    initial_authorities: Vec<(AuraId, GrandpaId)>,
    root_key: AccountId,
    endowed_accounts: Vec<AccountId>,
    _enable_println: bool,
    prices: Vec<(Asset, FixedNumber)>,
) -> GenesisConfig {
    let now = SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .expect("Unable to get current Unix timestamp");
    let prev_period_start = get_prev_period_start(now, node_template_runtime::PricePeriod::get());
    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,
        }),
        oracle: Some(OracleConfig {
            prices: prices.iter().cloned().collect(),
        }),
        financial_pallet: Some(FinancialConfig {
            prices: prices
                .iter()
                .cloned()
                .map(|(a, p)| (a, vec![p], prev_period_start))
                .collect(),
        }),
        manual_timestamp: Some(ManualTimestampConfig {
            timestamp: now.as_millis().try_into().expect("Too much milliseconds"),
        }),
    }
}
/// 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,
    prices: Vec<(Asset, FixedNumber)>,
) -> GenesisConfig {
    let now = SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .expect("Unable to get current Unix timestamp");
    let prev_period_start = get_prev_period_start(now, node_template_runtime::PricePeriod::get());
    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,
        }),
        oracle: Some(OracleConfig {
            prices: prices.iter().cloned().collect(),
        }),
        financial_pallet: Some(FinancialConfig {
            prices: prices
                .iter()
                .cloned()
                .map(|(a, p)| (a, vec![p], prev_period_start))
                .collect(),
        }),
        manual_timestamp: Some(ManualTimestampConfig {
            timestamp: now.as_millis().try_into().expect("Too much milliseconds"),
        }),
    }
}
fn testnet_genesis ( wasm_binary : & [ u8 ] , initial_authorities : Vec < ( AuraId , GrandpaId ) > , root_key : AccountId , endowed_accounts : Vec < AccountId > , _enable_println : bool , prices : Vec < ( Asset , FixedNumber ) > , ) -> GenesisConfig { let now = SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) . expect ( " " ) ; let prev_period_start = get_prev_period_start ( now , node_template_runtime :: PricePeriod :: get ( ) ) ; 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 , } ) , oracle : Some ( OracleConfig { prices : prices . iter ( ) . cloned ( ) . collect ( ) , } ) , financial_pallet : Some ( FinancialConfig { prices : prices . iter ( ) . cloned ( ) . map ( | ( a , p ) | ( a , vec ! [ p ] , prev_period_start ) ) . collect ( ) , } ) , manual_timestamp : Some ( ManualTimestampConfig { timestamp : now . as_millis ( ) . try_into ( ) . expect ( " " ) , } ) , } }
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
prices
Vec<(Asset, FixedNumber)>
wasm_binary
&[u8]
initial_authorities
Vec<(AuraId, GrandpaId)>
root_key
AccountId
endowed_accounts
Vec<AccountId>
_enable_println
bool
prices
Vec<(Asset, FixedNumber)>