From 9c0f4b1a6037bb7f29cf2b9f5d0afb9c458849d4 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Wed, 22 Jan 2020 11:28:11 +0100 Subject: [PATCH] Fixing namespaces in `impl_hashencode` --- src/hash_types.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) 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)?)) } } }