parent
9f6a2e51b2
commit
1fef74b00c
|
@ -168,7 +168,7 @@ pub fn write_keypair_file(
|
|||
}
|
||||
}
|
||||
.write(true)
|
||||
.create_new(true)
|
||||
.create(true)
|
||||
.open(outfile)?;
|
||||
|
||||
write_keypair(keypair, &mut f)
|
||||
|
@ -200,7 +200,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_write_keypair_file() {
|
||||
let outfile = tmp_file_path("test_gen_keypair_file.json");
|
||||
let outfile = tmp_file_path("test_write_keypair_file.json");
|
||||
let serialized_keypair = write_keypair_file(&Keypair::new(), &outfile).unwrap();
|
||||
let keypair_vec: Vec<u8> = serde_json::from_str(&serialized_keypair).unwrap();
|
||||
assert!(Path::new(&outfile).exists());
|
||||
|
@ -232,6 +232,13 @@ mod tests {
|
|||
assert!(!Path::new(&outfile).exists());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_write_keypair_file_overwrite_ok() {
|
||||
let outfile = tmp_file_path("test_write_keypair_file_overwrite_ok.json");
|
||||
write_keypair_file(&Keypair::new(), &outfile).unwrap();
|
||||
write_keypair_file(&Keypair::new(), &outfile).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_keypair_from_seed() {
|
||||
let good_seed = vec![0; 32];
|
||||
|
|
Loading…
Reference in New Issue