@@ -127,7 +127,7 @@ pub enum PeerKind {
127127}
128128
129129/// A message received by the gossipsub system and stored locally in caches..
130- #[ derive( Clone , PartialEq , Eq , Hash , Debug ) ]
130+ #[ derive( Clone , PartialEq , Eq , Hash ) ]
131131pub struct RawMessage {
132132 /// Id of the peer that published this message.
133133 pub source : Option < PeerId > ,
@@ -151,6 +151,20 @@ pub struct RawMessage {
151151 pub validated : bool ,
152152}
153153
154+ impl std:: fmt:: Debug for RawMessage {
155+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
156+ f. debug_struct ( "RawMessage" )
157+ . field ( "source" , & self . source )
158+ . field ( "data length" , & self . data . len ( ) )
159+ . field ( "sequence_number" , & self . sequence_number )
160+ . field ( "topic" , & self . topic )
161+ . field ( "signature" , & self . signature )
162+ . field ( "key" , & self . key )
163+ . field ( "validated" , & self . validated )
164+ . finish ( )
165+ }
166+ }
167+
154168impl PeerKind {
155169 /// Returns true if peer speaks any gossipsub version.
156170 pub ( crate ) fn is_gossipsub ( & self ) -> bool {
0 commit comments