Fixing broken test
This commit is contained in:
@@ -36,6 +36,11 @@ fn ensure_side_directory_exists(side_dir: &PathBuf) -> Result<(), std::io::Error
|
||||
mod tests {
|
||||
use std::{fs, path::Path};
|
||||
|
||||
use fastcrypto::{
|
||||
ed25519::Ed25519KeyPair,
|
||||
traits::{EncodeDecodeBase64, KeyPair, ToFromBytes},
|
||||
};
|
||||
|
||||
use super::*;
|
||||
|
||||
fn default_side_node_config() -> SideNodeConfig {
|
||||
@@ -69,8 +74,9 @@ mod tests {
|
||||
assert!(file_path.exists());
|
||||
|
||||
// check that the pem is readable
|
||||
let pem = fs::read_to_string(file_path).unwrap();
|
||||
assert!(pem::parse_many(&pem).is_ok());
|
||||
let data = fs::read_to_string(file_path).expect("couldn't read key file");
|
||||
let keys = Ed25519KeyPair::decode_base64(&data).expect("couldn't load keypair from file");
|
||||
assert_eq!(keys.public().as_bytes().len(), 32);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -4,7 +4,7 @@ use bft_crdt_derive::add_crdt_fields;
|
||||
|
||||
use bft_json_crdt::{
|
||||
json_crdt::{BaseCrdt, CrdtNode, IntoCrdtNode},
|
||||
keypair::{make_keypair, Ed25519KeyPair, KeyPair},
|
||||
keypair::{Ed25519KeyPair, KeyPair},
|
||||
list_crdt::ListCrdt,
|
||||
};
|
||||
|
||||
@@ -31,7 +31,6 @@ pub(crate) struct Transaction {
|
||||
|
||||
pub(crate) fn new(side_dir: PathBuf) -> (BaseCrdt<CrdtList>, Ed25519KeyPair) {
|
||||
let keys = keys::load_from_file(side_dir);
|
||||
// let keys = make_keypair();
|
||||
let bft_crdt = BaseCrdt::<CrdtList>::new(&keys);
|
||||
println!("Author is {}", keys.public().to_string());
|
||||
(bft_crdt, keys)
|
||||
|
||||
Reference in New Issue
Block a user