diff --git a/crates/types/src/codec/mod.rs b/crates/types/src/codec/mod.rs index 2489bdf6..ee4f0261 100644 --- a/crates/types/src/codec/mod.rs +++ b/crates/types/src/codec/mod.rs @@ -26,6 +26,11 @@ pub use malachitebft_codec::{Codec, HasEncodedLen}; /// - `$ty`: The message type to encode/decode /// - `$version_ty`: The version enum type /// - `$version_val`: The specific version value to use +/// +/// Must stay above the `pub mod` declarations at the bottom of this file: +/// `network` and `wal` reach this macro through textual scope, not through a +/// path, so moving the module declarations above it — or moving this below +/// them — breaks all 11 invocation sites with `cannot find macro`. macro_rules! impl_versioned_codec { ($codec_ty:ty, $ty:ty, $version_ty:ty, $version_val:expr) => { impl malachitebft_codec::Codec<$ty> for $codec_ty { @@ -77,8 +82,6 @@ macro_rules! impl_versioned_codec { }; } -pub(crate) use impl_versioned_codec; - pub mod error; pub mod network; pub mod proto; diff --git a/crates/types/src/codec/network.rs b/crates/types/src/codec/network.rs index 9b7b3d45..c9456a88 100644 --- a/crates/types/src/codec/network.rs +++ b/crates/types/src/codec/network.rs @@ -23,7 +23,6 @@ use malachitebft_core_types::ValidatorProof; use malachitebft_sync::{self as sync}; use crate::codec::error::CodecError; -use crate::codec::impl_versioned_codec; use crate::codec::proto::ProtobufCodec; use crate::codec::versions::{ LivenessMsgVersion, ProposalPartVersion, SignedConsensusMsgVersion, StreamMessageVersion, diff --git a/crates/types/src/codec/wal.rs b/crates/types/src/codec/wal.rs index 285d9f18..bd26eb69 100644 --- a/crates/types/src/codec/wal.rs +++ b/crates/types/src/codec/wal.rs @@ -19,7 +19,6 @@ use malachitebft_core_consensus::{ProposedValue, SignedConsensusMsg}; use malachitebft_core_types::PolkaCertificate; -use crate::codec::impl_versioned_codec; use crate::codec::versions::{ PolkaCertificateVersion, ProposedValueVersion, SignedConsensusMsgVersion, };