From 0ee0cd19b7ceabf5d75e1b8fdd074a6e758bc6db Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Oct 2026 16:10:34 +0100 Subject: decouple simulation test from mycelium --- src/simtest/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/simtest') 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 { -- cgit v1.3.1