From 98328b5a7b458891d7cff329e6460f5795a6493b Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 3 Sep 2024 11:23:14 +1000 Subject: [PATCH] Use as_byte_array to encode hash type Instead of accessing the inner type of a hash wrapper type when consensus encoding we can call `as_byte_array()`. Done in preparation for moving `Txid` and `Wtxid` to `primitives`. Internal change only. --- bitcoin/src/internal_macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin/src/internal_macros.rs b/bitcoin/src/internal_macros.rs index e59f2f4e1..208dbb688 100644 --- a/bitcoin/src/internal_macros.rs +++ b/bitcoin/src/internal_macros.rs @@ -181,7 +181,7 @@ macro_rules! impl_hashencode { ($hashtype:ident) => { impl $crate::consensus::Encodable for $hashtype { fn consensus_encode(&self, w: &mut W) -> core::result::Result { - self.0.consensus_encode(w) + self.as_byte_array().consensus_encode(w) } }