diff --git a/subxt/src/config/mod.rs b/subxt/src/config/mod.rs index bd7fd3ec39..32101d9b72 100644 --- a/subxt/src/config/mod.rs +++ b/subxt/src/config/mod.rs @@ -129,51 +129,24 @@ pub trait Header: Sized + Encode + Decode { #[cfg(feature = "substrate-compat")] mod substrate_impls { use super::*; - use primitive_types::{H256, U256}; - impl Header for sp_runtime::generic::Header + impl Header for T where - Self: Encode + Decode, - N: Copy + Into + Into + TryFrom, - H: sp_runtime::traits::Hash + Hasher, + ::Number: Into, { - type Number = N; - type Hasher = H; + type Number = T::Number; + type Hasher = T::Hashing; fn number(&self) -> Self::Number { - self.number + *self.number() } } - impl Hasher for sp_core::Blake2Hasher { - type Output = H256; + impl Hasher for T { + type Output = T::Output; fn hash(s: &[u8]) -> Self::Output { - ::hash(s) - } - } - - impl Hasher for sp_runtime::traits::BlakeTwo256 { - type Output = H256; - - fn hash(s: &[u8]) -> Self::Output { - ::hash(s) - } - } - - impl Hasher for sp_core::KeccakHasher { - type Output = H256; - - fn hash(s: &[u8]) -> Self::Output { - ::hash(s) - } - } - - impl Hasher for sp_runtime::traits::Keccak256 { - type Output = H256; - - fn hash(s: &[u8]) -> Self::Output { - ::hash(s) + ::hash(s) } } }