refactor(tests): fix clippy warnings

This commit is contained in:
2025-09-28 20:27:43 +03:00
parent ad70a53c75
commit 5abcd400d4
8 changed files with 106 additions and 74 deletions

14
tests/common/host.rs Normal file
View File

@@ -0,0 +1,14 @@
use crate::common::manifest::load_example_manifest;
use captra::HostState;
use ed25519_dalek::SigningKey;
use rand::rngs::OsRng;
/// Build a [`HostState`] with a fixed seed and a fresh [`SigningKey`] (`OsRng`).
/// # Panics
#[must_use]
pub fn make_host_with_seed(seed: u64) -> HostState {
let manifest = load_example_manifest();
let mut csprng = OsRng;
let keypair = SigningKey::generate(&mut csprng);
HostState::new(manifest, seed, keypair)
}