parent
d173e6ef87
commit
e2c68d8775
11
src/drone.rs
11
src/drone.rs
|
@ -262,7 +262,16 @@ mod tests {
|
|||
fn tmp_ledger_path(name: &str) -> String {
|
||||
let keypair = KeyPair::new();
|
||||
|
||||
format!("farf/{}-{}", name, keypair.pubkey())
|
||||
let id = {
|
||||
let ids: Vec<_> = keypair
|
||||
.pubkey()
|
||||
.iter()
|
||||
.map(|id| format!("{}", id))
|
||||
.collect();
|
||||
ids.join("")
|
||||
};
|
||||
|
||||
format!("farf/{}-{}", name, id)
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -384,7 +384,16 @@ mod tests {
|
|||
fn tmp_ledger_path(name: &str) -> String {
|
||||
let keypair = KeyPair::new();
|
||||
|
||||
format!("farf/{}-{}", name, keypair.pubkey())
|
||||
let id = {
|
||||
let ids: Vec<_> = keypair
|
||||
.pubkey()
|
||||
.iter()
|
||||
.map(|id| format!("{}", id))
|
||||
.collect();
|
||||
ids.join("")
|
||||
};
|
||||
|
||||
format!("farf/{}-{}", name, id)
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -39,6 +39,10 @@ fn entry_at(file: &mut File, at: u64) -> io::Result<Entry> {
|
|||
deserialize_from(file.take(len)).map_err(err_bincode_to_io)
|
||||
}
|
||||
|
||||
//fn next_offset(file: &mut File) -> io::Result<u64> {
|
||||
// deserialize_from(file.take(SIZEOF_U64)).map_err(err_bincode_to_io)
|
||||
//}
|
||||
|
||||
fn next_entry(file: &mut File) -> io::Result<Entry> {
|
||||
let len = deserialize_from(file.take(SIZEOF_USIZE)).map_err(err_bincode_to_io)?;
|
||||
deserialize_from(file.take(len)).map_err(err_bincode_to_io)
|
||||
|
@ -437,6 +441,8 @@ mod tests {
|
|||
assert!(entries0.verify(&id));
|
||||
}
|
||||
|
||||
fn tmp_ledger_path() -> String {}
|
||||
|
||||
#[test]
|
||||
fn test_ledger_reader_writer() {
|
||||
let ledger_path = tmp_ledger_path("test_ledger_reader_writer");
|
||||
|
|
|
@ -297,7 +297,16 @@ mod tests {
|
|||
fn tmp_ledger_path(name: &str) -> String {
|
||||
let keypair = KeyPair::new();
|
||||
|
||||
format!("farf/{}-{}", name, keypair.pubkey())
|
||||
let id = {
|
||||
let ids: Vec<_> = keypair
|
||||
.pubkey()
|
||||
.iter()
|
||||
.map(|id| format!("{}", id))
|
||||
.collect();
|
||||
ids.join("")
|
||||
};
|
||||
|
||||
format!("farf/{}-{}", name, id)
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
11
src/tvu.rs
11
src/tvu.rs
|
@ -177,7 +177,16 @@ pub mod tests {
|
|||
fn tmp_ledger_path(name: &str) -> String {
|
||||
let keypair = KeyPair::new();
|
||||
|
||||
format!("farf/{}-{}", name, keypair.pubkey())
|
||||
let id = {
|
||||
let ids: Vec<_> = keypair
|
||||
.pubkey()
|
||||
.iter()
|
||||
.map(|id| format!("{}", id))
|
||||
.collect();
|
||||
ids.join("")
|
||||
};
|
||||
|
||||
format!("farf/{}-{}", name, id)
|
||||
}
|
||||
|
||||
/// Test that message sent from leader to target1 and replicated to target2
|
||||
|
|
Loading…
Reference in New Issue