fn install_chainspec(
        rng: &mut TestRng,
        root_dir: &Path,
        version: &ProtocolVersion,
    ) -> Chainspec {
        let mut chainspec = Chainspec::random(rng);
        chainspec.protocol_config.version = *version;

        let subdir = root_dir.join(dir_name_from_version(version));
        fs::create_dir(&subdir).unwrap();

        let path = subdir.join(CHAINSPEC_NAME);
        fs::write(
            path,
            toml::to_string_pretty(&chainspec).expect("should encode to toml"),
        )
        .expect("should install chainspec");
        chainspec
    }
/// Creates the appropriate subdir in `root_dir`, and adds a random chainspec.toml with the
/// protocol_config.version field set to `version`.
Creates the appropriate subdir in `root_dir`, and adds a random chainspec.toml with the
protocol_config.version field set to `version`.
Creates the appropriate subdir in ` root_dir ` and adds a random chainspec . toml with the protocol_config . version field set to ` version ` .
fn install_chainspec(
        rng: &mut TestRng,
        root_dir: &Path,
        version: &ProtocolVersion,
    ) -> Chainspec {
        let mut chainspec = Chainspec::random(rng);
        chainspec.protocol_config.version = *version;
        let subdir = root_dir.join(dir_name_from_version(version));
        fs::create_dir(&subdir).unwrap();
        let path = subdir.join(CHAINSPEC_NAME);
        fs::write(
            path,
            toml::to_string_pretty(&chainspec).expect("should encode to toml"),
        )
        .expect("should install chainspec");
        chainspec
    }
fn install_chainspec ( rng : & mut TestRng , root_dir : & Path , version : & ProtocolVersion , ) -> Chainspec { let mut chainspec = Chainspec :: random ( rng ) ; chainspec . protocol_config . version = * version ; let subdir = root_dir . join ( dir_name_from_version ( version ) ) ; fs :: create_dir ( & subdir ) . unwrap ( ) ; let path = subdir . join ( CHAINSPEC_NAME ) ; fs :: write ( path , toml :: to_string_pretty ( & chainspec ) . expect ( " " ) , ) . expect ( " " ) ; chainspec }
Creates the appropriate subdir in `root_dir`, and adds a random chainspec.toml with the
protocol_config.version field set to `version`.
Creates the appropriate subdir in ` root_dir ` and adds a random chainspec . toml with the protocol_config . version field set to ` version ` .
rng
&mut TestRng
root_dir
&Path
version
&ProtocolVersion
rng
&mut TestRng
root_dir
&Path
version
&ProtocolVersion