1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

Use write_all to write the whole pk in cli_setup()

This commit is contained in:
Alexey Tsvetkov 2021-03-09 15:19:07 +03:00 committed by GitHub
parent 2019803d20
commit 2c4a0c59f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,7 +152,7 @@ fn cli_setup<T: Field, S: Scheme<T>, B: Backend<T, S>>(
let mut vk_file = File::create(vk_path)
.map_err(|why| format!("couldn't create {}: {}", vk_path.display(), why))?;
vk_file
.write(
.write_all(
serde_json::to_string_pretty(&keypair.vk)
.unwrap()
.as_bytes(),
@ -163,7 +163,7 @@ fn cli_setup<T: Field, S: Scheme<T>, B: Backend<T, S>>(
let mut pk_file = File::create(pk_path)
.map_err(|why| format!("couldn't create {}: {}", pk_path.display(), why))?;
pk_file
.write(keypair.pk.as_ref())
.write_all(keypair.pk.as_ref())
.map_err(|why| format!("couldn't write to {}: {}", pk_path.display(), why))?;
println!("Setup completed.");