diff --git a/primitive-types/src/lib.rs b/primitive-types/src/lib.rs index b2f019802..dd372a9eb 100644 --- a/primitive-types/src/lib.rs +++ b/primitive-types/src/lib.rs @@ -62,11 +62,21 @@ construct_fixed_hash! { #[cfg_attr(feature = "scale-info", derive(TypeInfo))] pub struct H256(32); } +construct_fixed_hash! { + /// Fixed-size uninterpreted hash type with 48 bytes (384 bits) size. + #[cfg_attr(feature = "scale-info", derive(TypeInfo))] + pub struct H384(48); +} construct_fixed_hash! { /// Fixed-size uninterpreted hash type with 64 bytes (512 bits) size. #[cfg_attr(feature = "scale-info", derive(TypeInfo))] pub struct H512(64); } +construct_fixed_hash! { + /// Fixed-size uninterpreted hash type with 96 bytes (768 bits) size. + #[cfg_attr(feature = "scale-info", derive(TypeInfo))] + pub struct H768(96); +} #[cfg(feature = "num-traits")] mod num_traits { @@ -90,7 +100,9 @@ mod serde { impl_fixed_hash_serde!(H128, 16); impl_fixed_hash_serde!(H160, 20); impl_fixed_hash_serde!(H256, 32); + impl_fixed_hash_serde!(H384, 48); impl_fixed_hash_serde!(H512, 64); + impl_fixed_hash_serde!(H768, 96); } #[cfg(feature = "impl-codec")] @@ -105,7 +117,9 @@ mod codec { impl_fixed_hash_codec!(H128, 16); impl_fixed_hash_codec!(H160, 20); impl_fixed_hash_codec!(H256, 32); + impl_fixed_hash_codec!(H384, 48); impl_fixed_hash_codec!(H512, 64); + impl_fixed_hash_codec!(H768, 96); } #[cfg(feature = "impl-rlp")] @@ -120,7 +134,9 @@ mod rlp { impl_fixed_hash_rlp!(H128, 16); impl_fixed_hash_rlp!(H160, 20); impl_fixed_hash_rlp!(H256, 32); + impl_fixed_hash_rlp!(H384, 48); impl_fixed_hash_rlp!(H512, 64); + impl_fixed_hash_rlp!(H768, 96); } impl_fixed_hash_conversions!(H256, H160);