2222
2323use sp_runtime:: { generic, MultiSignature , traits:: { Verify , BlakeTwo256 , IdentifyAccount } } ;
2424use parity_scale_codec:: { Encode , Decode } ;
25+ #[ cfg( feature = "std" ) ]
26+ use parity_util_mem:: MallocSizeOf ;
2527
2628/// The block number type used by Polkadot.
2729/// 32-bits will allow for 136 years of blocks assuming 1 block per second.
@@ -57,6 +59,7 @@ pub type Hash = sp_core::H256;
5759///
5860/// This type makes it easy to enforce that a hash is a candidate hash on the type level.
5961#[ derive( Clone , Copy , Encode , Decode , Hash , Eq , PartialEq , Debug , Default ) ]
62+ #[ cfg_attr( feature = "std" , derive( MallocSizeOf ) ) ]
6063pub struct CandidateHash ( pub Hash ) ;
6164
6265#[ cfg( feature="std" ) ]
@@ -103,6 +106,7 @@ pub type DownwardMessage = sp_std::vec::Vec<u8>;
103106/// A wrapped version of `DownwardMessage`. The difference is that it has attached the block number when
104107/// the message was sent.
105108#[ derive( Encode , Decode , Clone , sp_runtime:: RuntimeDebug , PartialEq ) ]
109+ #[ cfg_attr( feature = "std" , derive( MallocSizeOf ) ) ]
106110pub struct InboundDownwardMessage < BlockNumber = crate :: BlockNumber > {
107111 /// The block number at which this messages was put into the downward message queue.
108112 pub sent_at : BlockNumber ,
@@ -112,6 +116,7 @@ pub struct InboundDownwardMessage<BlockNumber = crate::BlockNumber> {
112116
113117/// An HRMP message seen from the perspective of a recipient.
114118#[ derive( Encode , Decode , Clone , sp_runtime:: RuntimeDebug , PartialEq ) ]
119+ #[ cfg_attr( feature = "std" , derive( MallocSizeOf ) ) ]
115120pub struct InboundHrmpMessage < BlockNumber = crate :: BlockNumber > {
116121 /// The block number at which this message was sent.
117122 /// Specifically, it is the block number at which the candidate that sends this message was
@@ -123,6 +128,7 @@ pub struct InboundHrmpMessage<BlockNumber = crate::BlockNumber> {
123128
124129/// An HRMP message seen from the perspective of a sender.
125130#[ derive( Encode , Decode , Clone , sp_runtime:: RuntimeDebug , PartialEq , Eq , Hash ) ]
131+ #[ cfg_attr( feature = "std" , derive( MallocSizeOf ) ) ]
126132pub struct OutboundHrmpMessage < Id > {
127133 /// The para that will get this message in its downward message queue.
128134 pub recipient : Id ,
0 commit comments