diff --git a/src/consensus/encode.rs b/src/consensus/encode.rs index a2f5bcf5..cdf4496d 100644 --- a/src/consensus/encode.rs +++ b/src/consensus/encode.rs @@ -34,7 +34,7 @@ use prelude::*; use core::{fmt, mem, u32, convert::From}; #[cfg(feature = "std")] use std::error; -use hashes::{sha256d, Hash}; +use hashes::{sha256d, Hash, sha256}; use hash_types::{BlockHash, FilterHash, TxMerkleNode, FilterHeader}; use io::{self, Cursor, Read}; @@ -756,6 +756,18 @@ impl Decodable for sha256d::Hash { } } +impl Encodable for sha256::Hash { + fn consensus_encode(&self, s: S) -> Result { + self.into_inner().consensus_encode(s) + } +} + +impl Decodable for sha256::Hash { + fn consensus_decode(d: D) -> Result { + Ok(Self::from_inner(<::Inner>::consensus_decode(d)?)) + } +} + // Tests #[cfg(test)] mod tests {