aboutsummaryrefslogtreecommitdiffstats
path: root/src/simtest/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-30 16:10:34 +0100
committertv <tv@krebsco.de>2026-10-30 16:10:34 +0100
commita6d5ea115df597e7fe1dc13a55261c2ff9a28ed7 (patch)
tree36ab2529761d42dcf48d533fc464cf07f7123ed4 /src/simtest/mod.rs
parente2e77a273986c09b401d082eba9006243c5092a4 (diff)
decouple simulation test from mycelium
Diffstat (limited to 'src/simtest/mod.rs')
-rw-r--r--src/simtest/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/simtest/mod.rs b/src/simtest/mod.rs
index be2dc7b..e6ee7a7 100644
--- a/src/simtest/mod.rs
+++ b/src/simtest/mod.rs
@@ -65,6 +65,16 @@ impl Sim {
}
}
+ /// [`new`](Self::new), with messages put into bytes by `codec` (a transport's
+ /// envelope) instead of the wire encoding alone.
+ #[cfg_attr(not(feature = "mycelium"), allow(dead_code))]
+ pub(crate) fn with_codec(seed: u64, codec: crate::transport::sim::Codec) -> Self {
+ Self {
+ net: SimNet::with_codec(seed, codec),
+ ..Self::new(seed)
+ }
+ }
+
/// [`new`](Self::new), with every node under the identity layer: its key derived
/// from its name, its node ID as `local_id`.
pub(crate) fn with_identity(seed: u64) -> Self {