diff --git a/src/internal_macros.rs b/src/internal_macros.rs index ece0f0f6..288de32a 100644 --- a/src/internal_macros.rs +++ b/src/internal_macros.rs @@ -119,19 +119,19 @@ macro_rules! debug_from_display { pub(crate) use debug_from_display; #[cfg(test)] -macro_rules! hex_script (($s:expr) => (<$crate::Script as core::str::FromStr>::from_str($s).unwrap())); -#[cfg(test)] -pub(crate) use hex_script; +pub(crate) use test_macros::*; #[cfg(test)] -macro_rules! hex_hash (($h:ident, $s:expr) => ($h::from_slice(&<$crate::prelude::Vec as $crate::hashes::hex::FromHex>::from_hex($s).unwrap()).unwrap())); -#[cfg(test)] -pub(crate) use hex_hash; +mod test_macros { + macro_rules! hex_script (($s:expr) => (<$crate::Script as core::str::FromStr>::from_str($s).unwrap())); + pub(crate) use hex_script; -#[cfg(test)] -macro_rules! hex_decode (($h:ident, $s:expr) => (deserialize::<$h>(&<$crate::prelude::Vec as $crate::hashes::hex::FromHex>::from_hex($s).unwrap()).unwrap())); -#[cfg(test)] -pub(crate) use hex_decode; + macro_rules! hex_hash (($h:ident, $s:expr) => ($h::from_slice(&<$crate::prelude::Vec as $crate::hashes::hex::FromHex>::from_hex($s).unwrap()).unwrap())); + pub(crate) use hex_hash; + + macro_rules! hex_decode (($h:ident, $s:expr) => (deserialize::<$h>(&<$crate::prelude::Vec as $crate::hashes::hex::FromHex>::from_hex($s).unwrap()).unwrap())); + pub(crate) use hex_decode; +} macro_rules! serde_string_impl { ($name:ident, $expecting:literal) => {