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.
This commit is contained in:
Tobin C. Harding 2024-09-03 11:23:14 +10:00
parent 6fac593ec9
commit 98328b5a7b
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 1 additions and 1 deletions

View File

@ -181,7 +181,7 @@ macro_rules! impl_hashencode {
($hashtype:ident) => {
impl $crate::consensus::Encodable for $hashtype {
fn consensus_encode<W: $crate::io::Write + ?Sized>(&self, w: &mut W) -> core::result::Result<usize, $crate::io::Error> {
self.0.consensus_encode(w)
self.as_byte_array().consensus_encode(w)
}
}