diff --git a/src/hash_types.rs b/src/hash_types.rs index 514c5309..3eefe39a 100644 --- a/src/hash_types.rs +++ b/src/hash_types.rs @@ -16,23 +16,22 @@ //! to avoid mixing data of the same hash format (like SHA256d) but of different meaning //! (transaction id, block hash etc). -use std::io; - use consensus::encode::{Encodable, Decodable, Error}; -use hashes::{sha256, sha256d, hash160, Hash}; -use hashes::hex::{ToHex, FromHex}; +use hashes::{Hash, sha256, sha256d, ripemd160, hash160}; +use hashes::hex::{FromHex, ToHex}; macro_rules! impl_hashencode { ($hashtype:ident) => { - impl Encodable for $hashtype { - fn consensus_encode(&self, s: S) -> Result { + impl $crate::consensus::Encodable for $hashtype { + fn consensus_encode(&self, s: S) -> Result { self.0.consensus_encode(s) } } - impl Decodable for $hashtype { - fn consensus_decode(d: D) -> Result { - Ok(Self::from_inner(<<$hashtype as Hash>::Inner>::consensus_decode(d)?)) + impl $crate::consensus::Decodable for $hashtype { + fn consensus_decode(d: D) -> Result { + use $crate::hashes::Hash; + Ok(Self::from_inner(<<$hashtype as $crate::hashes::Hash>::Inner>::consensus_decode(d)?)) } } }