async fn new(size: usize, rng: &mut NodeRng) -> Self {
        assert!(
            size >= 1,
            "Network size must have at least one node (size: {})",
            size
        );
        let first_node_secret_key_with_stake = SecretKeyWithStake {
            secret_key: Arc::new(SecretKey::random(rng)),
            stake: rng.gen_range(100..999),
        };
        let other_secret_keys_with_stakes = {
            let mut other_secret_keys_with_stakes = Vec::new();
            for _ in 1..size {
                let staked_secret_key = SecretKeyWithStake {
                    secret_key: Arc::new(SecretKey::random(rng)),
                    stake: rng.gen_range(100..999),
                };
                other_secret_keys_with_stakes.push(staked_secret_key)
            }
            other_secret_keys_with_stakes
        };

        Self::new_with_keys(
            first_node_secret_key_with_stake,
            other_secret_keys_with_stakes,
            rng,
        )
        .await
    }
/// Instantiates a new test chain configuration.
///
/// Generates secret keys for `size` validators and creates a matching chainspec.
Instantiates a new test chain configuration.
Generates secret keys for `size` validators and creates a matching chainspec.
Instantiates a new test chain configuration . Generates secret keys for ` size ` validators and creates a matching chainspec .
async fn new(size: usize, rng: &mut NodeRng) -> Self {
        assert!(
            size >= 1,
            "Network size must have at least one node (size: {})",
            size
        );
        let first_node_secret_key_with_stake = SecretKeyWithStake {
            secret_key: Arc::new(SecretKey::random(rng)),
            stake: rng.gen_range(100..999),
        };
        let other_secret_keys_with_stakes = {
            let mut other_secret_keys_with_stakes = Vec::new();
            for _ in 1..size {
                let staked_secret_key = SecretKeyWithStake {
                    secret_key: Arc::new(SecretKey::random(rng)),
                    stake: rng.gen_range(100..999),
                };
                other_secret_keys_with_stakes.push(staked_secret_key)
            }
            other_secret_keys_with_stakes
        };
        Self::new_with_keys(
            first_node_secret_key_with_stake,
            other_secret_keys_with_stakes,
            rng,
        )
        .await
    }
async fn new ( size : usize , rng : & mut NodeRng ) -> Self { assert ! ( size 1 " " size ) ; let first_node_secret_key_with_stake = SecretKeyWithStake { secret_key : Arc :: new ( SecretKey :: random ( rng ) ) , stake : rng . gen_range ( 100 .. 999 ) , } ; let other_secret_keys_with_stakes = { let mut other_secret_keys_with_stakes = Vec :: new ( ) ; for _ in 1 .. size { let staked_secret_key = SecretKeyWithStake { secret_key : Arc :: new ( SecretKey :: random ( rng ) ) , stake : rng . gen_range ( 100 .. 999 ) , } ; other_secret_keys_with_stakes . push ( staked_secret_key ) } other_secret_keys_with_stakes } ; Self :: new_with_keys ( first_node_secret_key_with_stake , other_secret_keys_with_stakes , rng , ) . await }
Instantiates a new test chain configuration.
Instantiates a new test chain configuration .
size
usize
rng
&mut NodeRng
size
usize
rng
&mut NodeRng