mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-02-28 14:33:37 -08:00
test(rosenpass): adapt gen-ipc-msg-types to fully go through. Explicit test for SHAKE256 still missing
This commit is contained in:
@@ -77,10 +77,8 @@ impl Tree {
|
|||||||
|
|
||||||
/// Helper for generating hash-based message IDs for the IPC API
|
/// Helper for generating hash-based message IDs for the IPC API
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
|
|
||||||
fn print_IPC_API_info(shake_or_blake: EitherShakeOrBlake, name: String) -> Result<()> {
|
|
||||||
let tree = Tree::Branch(
|
let tree = Tree::Branch(
|
||||||
format!("Rosenpass IPC API {}", name).to_owned(),
|
"Rosenpass IPC API".to_owned(),
|
||||||
vec![Tree::Branch(
|
vec![Tree::Branch(
|
||||||
"Rosenpass Protocol Server".to_owned(),
|
"Rosenpass Protocol Server".to_owned(),
|
||||||
vec![
|
vec![
|
||||||
@@ -98,9 +96,6 @@ fn main() -> Result<()> {
|
|||||||
|
|
||||||
println!("type RawMsgType = u128;");
|
println!("type RawMsgType = u128;");
|
||||||
println!();
|
println!();
|
||||||
tree.gen_code(shake_or_blake)
|
tree.gen_code(EitherShakeOrBlake::Left(SHAKE256Core))?;
|
||||||
}
|
tree.gen_code(EitherShakeOrBlake::Right(Blake2bCore))
|
||||||
|
|
||||||
print_IPC_API_info(EitherShakeOrBlake::Left(SHAKE256Core), " (SHAKE256)".to_owned())?;
|
|
||||||
print_IPC_API_info(EitherShakeOrBlake::Right(Blake2bCore), " (Blake2b)".to_owned())
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use std::{borrow::Borrow, process::Command};
|
use std::{process::Command};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_gen_ipc_msg_types() -> anyhow::Result<()> {
|
fn test_gen_ipc_msg_types() -> anyhow::Result<()> {
|
||||||
@@ -11,5 +11,6 @@ fn test_gen_ipc_msg_types() -> anyhow::Result<()> {
|
|||||||
assert!(stdout.contains("type RawMsgType = u128;"));
|
assert!(stdout.contains("type RawMsgType = u128;"));
|
||||||
assert!(stdout.contains("const SUPPLY_KEYPAIR_RESPONSE : RawMsgType = RawMsgType::from_le_bytes(hex!(\"f2dc 49bd e261 5f10 40b7 3c16 ec61 edb9\"));"));
|
assert!(stdout.contains("const SUPPLY_KEYPAIR_RESPONSE : RawMsgType = RawMsgType::from_le_bytes(hex!(\"f2dc 49bd e261 5f10 40b7 3c16 ec61 edb9\"));"));
|
||||||
|
|
||||||
|
// TODO: Also test SHAKE256 here
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user